vercel / ai

Build AI-powered applications with React, Svelte, Vue, and Solid
https://sdk.vercel.ai/docs
Other
8.57k stars 1.21k forks source link

Tools with Generate Object #1803

Open arnau01 opened 1 month ago

arnau01 commented 1 month ago

Feature Description

Generating structured data is very helpful, would be great if tool calling was supported.

Use Case

Providing a output schema and having access to external tools

Additional context

No response

lgrammel commented 1 month ago

generateObject uses forced tool calling under the hood for some providers, so this might not be possible.

arnau01 commented 1 month ago

Makes sense, my current workaround is a simple chain, first generateText then streamObject which allows for tool usage and also controlling the schema.