Problem Defining Tools with Optional Input Parameters #666
Unanswered
jasontjahjono
asked this question in
Q&A
Replies: 1 comment
-
Do you happen to be working against OpenAI? I ran into this myself a few weeks ago. The wrapper around zodToJsonSchema that this repo uses seems to mark everything as required. I found a workaround for it. I can say more if you want me to. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi i'm trying to create a tool-calling agent in Langgraph typescript. I've defined the agent, tool, and tool input schema as follows:
Tool Schema:
Tool:
I also prompted the agent to default to unspecified if user does not specify an optional field.
The problem is that every time a user prompts: "i wanna book a room", the agent always returns an AIMessage "do you have any view preference (Ocean, Forest, Resort)" instead of defaulting to "unspecified".
How do I implement optional input params for tools correctly? Thank you
Beta Was this translation helpful? Give feedback.
All reactions