Structured Agent Output: Output.choice | AI SDK Agents | AI SDK Agents
Structured Agent Output: Output.choice
Demonstrate structured agent outputs using ToolLoopAgent with Output.choice. Constrain agent responses to predefined choices for predictable, type-safe outputs.
Output.choice
Constrains agent output to predefined choices. The agent must select one of the specified options, ensuring predictable responses.
Example Prompts
Get the weather for San Francisco. What should I wear?What's the weather in New York? Recommend clothing.Check weather in Tokyo and suggest what to wear.