You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I observe that sometimes my custom tool is called with optional arguments only. The required argument is missing in function call. After investigating the code, i found that, in class OpenAIVoiceReactAgent, in tool_defs dict, "required" is missing. In OpenAI Realtime api documentation: [https://platform.openai.com/docs/guides/realtime/concepts] there is a "required" key in parameters during session configuration. After adding this in tool_defs, the situation seems to be improved. But still, i see, although less frequently, tool call with only optional arguments.
Question:
Why is it omitted from tool_defs?
How to make sure tool calling is done correctly?
Code from react-voice-agent:
# sent tools and instructions with initial chunk
tool_defs = [
{
"type": "function",
"name": tool.name,
"description": tool.description,
"parameters": {"type": "object", "properties": tool.args},
}
An example from OpenAI Realtime API documentation
{
tools: [
{
name: "get_weather",
description: "Get the weather at a given location",
parameters: {
type: "object",
properties: {
location: {
type: "string",
description: "Location to get the weather from",
},
scale: {
type: "string",
enum: ['celsius', 'farenheit']
},
},
required: ["location", "scale"],
},
},
...
]
}
Any help much appreciated. Thanks a lot for this example implementation !!!
Regards
Arun
The text was updated successfully, but these errors were encountered:
arunkumar-ramzy
changed the title
Missing "required" key in tool definitions in session configuration
Missing "required" key in tool definitions while configuring session
Oct 26, 2024
Hello
I observe that sometimes my custom tool is called with optional arguments only. The required argument is missing in function call. After investigating the code, i found that, in class OpenAIVoiceReactAgent, in tool_defs dict, "required" is missing. In OpenAI Realtime api documentation: [https://platform.openai.com/docs/guides/realtime/concepts] there is a "required" key in parameters during session configuration. After adding this in tool_defs, the situation seems to be improved. But still, i see, although less frequently, tool call with only optional arguments.
Question:
Code from react-voice-agent:
An example from OpenAI Realtime API documentation
Any help much appreciated. Thanks a lot for this example implementation !!!
Regards
Arun
The text was updated successfully, but these errors were encountered: