Skip to content

Handle ReAct tool selection failures more gracefully #8114

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

Merged
merged 6 commits into from
Apr 25, 2025
Merged

Conversation

okhat
Copy link
Collaborator

@okhat okhat commented Apr 25, 2025

We've accumulated a few reports, sometimes with Google models (Gemma, Gemini) but also with Qwen, that when the model wants to finish, it fails to format that properly. This results in an unnecessary exception, instead of ending execution gracefully.

This PR refines the base instructions for dspy.ReAct and handles mid-trajectory failures more gracefully. The final extraction step is still responsible for processing. This results in better respect for the ReAct contract.

@okhat okhat merged commit d6de70c into main Apr 25, 2025
3 checks passed
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.

1 participant