what would happen in a team of agents, when agents use different response models (different pydantic schema)?
in addition, should the response model of the team be a superset of the agents response models?
what would happen in a team of agents, when agents use different response models (different pydantic schema)?
in addition, should the response model of the team be a superset of the agents response models?
Hi, Thank you for your question
Yes — agents in a team can each have their own response models (custom Pydantic schemas), and that works fine. But when you’re calling team.arun()
, the team itself also needs a response_model
, and that’s where things get important.
What happens if agents return different models?
Agno expects the team’s response to conform to a single schema, so if different agents return different formats:
Recommended Approach
Set the team’s response_model
to be a superset or union of the possible responses from individual agents.
You can do this by:
Optional
fields for everything that might appearUnion
typeThis way, the team can successfully parse and return any of the agent responses without issue.