Replies: 2 comments 4 replies
-
@mlynch I've written up a short guide on how to improve tool calling with the AI SDK: https://sdk.vercel.ai/docs/ai-sdk-core/tools-and-tool-calling#prompt-engineering-with-tools Automatic retries when the parsing fails are planned (no timeline yet) |
Beta Was this translation helpful? Give feedback.
4 replies
-
It happened to me when I set the whole z.object to optional, if you do so, try removing it (or if you have a nested optional on the parameters) and check if it works. |
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
-
I'm using tool/function calling to modify a data structure (using gpt-4o). My tool has a number of parameters, such as
label
anddescription
of a new item to add to the structure. Often, the tool will be called with missing fields as required by the zod schema, causing a runtime error. I am unsure what to do in this situation. I would think the model just wouldn't call my tool if it wasn't able to provide the required parameters, yet it does. I'm really at a loss about how to handle this scenario or even how error handling works in this case.Any advice?
Beta Was this translation helpful? Give feedback.
All reactions