ai icon indicating copy to clipboard operation
ai copied to clipboard

fix(render): parse the args based on the zod schema

Open IdoPesok opened this issue 4 months ago • 2 comments

#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.

IdoPesok avatar Mar 06 '24 16:03 IdoPesok

We recommend using streamUI instead of render (which is now deprecated). Would this also apply to streamUI?

lgrammel avatar May 08 '24 14:05 lgrammel

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

unstubbable avatar May 08 '24 15:05 unstubbable