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

Prioritize tool calls over eager text responses #505

Merged
merged 5 commits into from
Dec 20, 2024

Conversation

sydney-runkle
Copy link
Member

@sydney-runkle sydney-runkle commented Dec 19, 2024

Fix #268
Fix #363
Fix #510

Copy link

cloudflare-workers-and-pages bot commented Dec 20, 2024

Deploying pydantic-ai with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6f9670f
Status: ✅  Deploy successful!
Preview URL: https://f739a933.pydantic-ai.pages.dev
Branch Preview URL: https://fix-mixed-tool-text-response.pydantic-ai.pages.dev

View logs

@sydney-runkle sydney-runkle changed the title WIP: prioritize tool calls over eager text responses Prioritize tool calls over eager text responses Dec 20, 2024
sydney-runkle and others added 3 commits December 20, 2024 11:19
@sydney-runkle sydney-runkle enabled auto-merge (squash) December 20, 2024 16:26
@sydney-runkle sydney-runkle merged commit 866a031 into main Dec 20, 2024
13 checks passed
@sydney-runkle sydney-runkle deleted the fix-mixed-tool-text-responses branch December 20, 2024 16:28
Copy link
Member

@samuelcolvin samuelcolvin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a test to test_agent.py that demonstrates this behaviour.

system_prompt='Be concise, reply with one sentence.',
system_prompt=(
'Be concise, reply with one sentence.'
'Use the `get_lat_lng` tool to get the latitude and longitude of the locations, '
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's worth having a comment here saying

''Be concise, reply with one sentence.' is enough for some models like openAI, but Gemini in particular needs this explicit prompt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants