Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable reflection after tool use #1040

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

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

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.

2 participants