Hello, I am using learning about function calling in open ai using node js I am trying to get the latitude and longitude in argument. If I pass a single parameter like location than its working fine but I want to get two seprate args called lat and long but I am getting error 400
Below is the code
{
name: “getCurrentWeather”,
description: “get the weather forecast in a given location”,
parameters: [{
type: "object", // specify that the parameter is an object
properties: {
latitude: {
type: "string", // specify the parameter type as a string
description: "The location, e.g. Beijing, China. But it should be written in latitude"
},
longitude: {
type: "string", // specify the parameter type as a string
description: "The location, e.g. Beijing, China. But it should be written in longitude"
},
},
required: ["latitude", "longitude"] // specify that the location parameter is required
}]
}
Here is the error
{
“error”: “400 [{‘type’: ‘object’, ‘properties’: {‘latitude’: {‘type’: ‘string’, ‘description’: ‘The location, e.g. Beijing, China. But it should be written in latitude’}, ‘longitude’: {‘type’: ‘string’, ‘description’: ‘The location, e.g. Beijing, China. But it should be written in longitude’}}, ‘required’: [‘latitude’, ‘longitude’]}] is not of type ‘object’ - ‘functions.0.parameters’”
}
Any help or lead is appreciated tq