ai
ai copied to clipboard
fix(render): parse the args based on the zod schema
#1065 Take 3
#1065 was reverted in #1080 due to a bug where the toolCallPayload.func.arguments
were a string rather than a Record. In #1113 this behavior was fixed so now that bug should be gone since Zod will be parsing the object.
We recommend using streamUI
instead of render
(which is now deprecated). Would this also apply to streamUI
?
In streamUI
, this is now handled via safeParseJSON
, see: https://github.com/vercel/ai/blob/a4848928c030a0e79d9d1b58c7c9893b573f1302/packages/core/rsc/stream-ui/stream-ui.tsx#L261-L272