-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Description
Hello, Pydantic AI Team 👋
I’d like to propose a feature that allows for the creation of highly specialized agents that only execute tools without streaming textual output from LLM model (Disable reflection after tool use).
Use Case:
Consider a Search Agent that solely runs tool calls, passing their outputs to an Analyst Agent for processing. The Analyst Agent then collaborates with a Critique Agent to construct the final response. This setup enables modular and efficient agent interactions where streaming text from intermediate agents is unnecessary.
Current Limitation:
From my understanding, the framework does not currently support an agent that exclusively executes tools without attempting to stream a final response. I attempted to implement a workaround using .iter() and breaking the stream when an answer starts forming, but this approach was unsuccessful.
Questions & Contribution:
- Does this feature align with your roadmap or design philosophy?
- Is there a way to implement this behavior using an existing but undocumented approach?
- If this makes sense to you, I’d be happy to contribute a PR! Could you provide guidance on how best to implement it?
Looking forward to your thoughts! 🚀
References
I like how autogen managed to do this, their AssistantAgent (similar to Agent in pydantic-ai) has reflect_on_tool_use param and if it is False - FinalResult is just tool outputs.
Check the link to their docs for more details and check last block in diagram pls https://microsoft.github.io/autogen/dev/reference/python/autogen_agentchat.agents.html#autogen_agentchat.agents.AssistantAgent