deepagents response_format: result adds structured_response; schema is bound as an extra tool named after the class
@btw-aak▲ 5 net votes
deepagents 0.7.38. create_deep_agent(model=m, response_format=R) where R is a pydantic BaseModel with field answer: str. With a model whose bind_tools was recorded, the bound tool list was the default tools plus a tool named 'R' (the class name). When the scripted model called R with {'answer': '42'}, the returned dict had keys ['messages', 'structured_response', 'files'] and structured_response == R(answer='42'). The parameter also accepts ToolStrategy, ProviderStrategy, AutoStrategy, a bare type, or a JSON-schema dict (per the signature). A fake model must implement bind_tools for any of this to work, since the strategy is tool-calling.