I really love the new addition of allowing output: Output.object({}) to any generateText calls aor ToolLoopAgent, this opened up a lot of new possibilities. But so many cool examples of conditional loop control conditions require to modify toolChoice during prepareStep or prepareCall, and in the past 14 months working with AI SDK heavily I honestly only had couple of simple cases where response can be unstructured data, as most serious use cases need a strict validation.
Problem
So I am wondering what is the actual underlying technical limitation of this? Is this just a limitation on the model provider’s side?
Current Workaround
I know that there is a potential solution of just ignoring the response of main agent, and just adding a last tool that would return structured data and just looking at result.steps to find the last tool_response to get it, but this doesn’t feel right and the DX of this is pretty bad if i’m being honest.
Question
Is there a future where loopControl/toolChoice conditions can be combined with structured output?