Hello
I have the following function spec.
let spec = {
name: "getPopulation",
description:
"Find the population of a given state. The state is represented by an ID named stateId. The user will give a state name and the corresponding stateId needs to be obtained",
parameters: {
type: "object",
properties: {
stateId: {
type: "integer",
description: "The ID of the state",
enum: [
{ value: 1, description: "Alabama" },
{ value: 2, description: "Alaska" },
{ value: 3, description: "Arizona" },
{ value: 4, description: "Arkansas" },
{ value: 5, description: "California" },
],
},
},
required: ["stateId"],
},
};
export default spec;
I am trying to get the stateId based on the users query
What is the population of Alabama?
I was hoping it would give the function call response like below
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": null,
"function_call": {
"name": "getPopulation",
"arguments": "{\n \"stateId\": 1\n}"
}
},
"finish_reason": "function_call"
}
],
But it always gives me some random number.
Any suggestions?