On the example they provide at the docummentation:
const tools = [
{
type: "function",
function: {
name: "get_current_weather",
description: "Get the current weather in a given location",
parameters: {
type: "object",
properties: {
location: {
type: "string",
description: "The city and state, e.g. San Francisco, CA",
},
unit: { type: "string", enum: ["celsius", "fahrenheit"] },
},
required: ["location"],
},
},
},
];
What about when I have no parameter on the method?
I have tried a couple of options, such as leaving blank the parameters key, not passing it. It gives me back error.
The point is: the parameter is a local variable called ‘image’, which will change locally. I have tried to pass image as a variable as parameter, did not work.
I have an idea to interfere where the function is called, namely:
const functionResponse = functionToCall(
functionArgs.location,
functionArgs.unit
)
Replace by:
const functionResponse = functionToCall(
this.image
)
I am using TypeScript.
Current solution that works: allows it pass a parameter, and just ignore the parameter; it is a dummy parameter, meaningless.
Wondering if we have a more elegant solution.