Skip to content

Conversation

@WorldInnovationsDepartment

This PR introduces the reflect_on_tool_call parameter, similar to AutoGen, allowing agents to bypass reflection on tool calls when unnecessary.

Key Changes:
• reflect_on_tool_call Implementation: If set to False, the agent directly returns tool call results without generating an additional LLM response.
• Performance Optimization: Ensures no unnecessary model calls occur when reflect_on_tool_call=False, improving efficiency.
• GraphDeps Refactor: Introduced _build_graph_deps to simplify dependency overrides and make GraphDeps more flexible.

For further details, refer to the related issue: pydantic-ai#1024.

Change inspired to such feature from Autogen framework which I used often and now I am missing in PydAI :(

@WorldInnovationsDepartment WorldInnovationsDepartment marked this pull request as draft March 4, 2025 14:32
@WorldInnovationsDepartment WorldInnovationsDepartment changed the title Added ability to reflect on tool use Ability to disable reflection after tool use Mar 4, 2025
@WorldInnovationsDepartment WorldInnovationsDepartment changed the title Ability to disable reflection after tool use Disable reflection after tool use Mar 4, 2025
@WorldInnovationsDepartment WorldInnovationsDepartment marked this pull request as ready for review March 4, 2025 16:47
@WorldInnovationsDepartment WorldInnovationsDepartment changed the title Disable reflection after tool use 🔥 Disable reflection after tool use Mar 4, 2025
@WorldInnovationsDepartment WorldInnovationsDepartment changed the title 🔥 Disable reflection after tool use Disable reflection after tool use Mar 4, 2025
@aristide1997
Copy link

This would be very useful, we still don’t have a way of doing this

@DouweM
Copy link
Collaborator

DouweM commented Apr 30, 2025

This is related to #1463, which @dmontagu is working on. That likely addresses this use this case as well, so I'll close this until we determine it doesn't.

@DouweM DouweM closed this Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants