Skip to content

Port from pydantic-ai to openai-agents SDK #211

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 8 commits into from
May 11, 2025
Merged

Port from pydantic-ai to openai-agents SDK #211

merged 8 commits into from
May 11, 2025

Conversation

pamelafox
Copy link
Contributor

Purpose

I wasn't able to fix pydantic-AI to remove the extra call after the tool call, so I ported to the openai-agents SDK, which has built-in support for that via the tool_use_behavior="stop_on_first_tool", argument to the Agent. This seems to be working fairly well, though I've seen that llama3.1 from Ollama is only succeeding half the time (sometimes it returns JSON in the content string instead of as a tool call). Not sure what's affecting the reliability of the Ollama SLM calls.

Does this introduce a breaking change?

When developers merge from main and run the server, azd up, or azd deploy, will this produce an error?
If you're not sure, try it out on an old environment.

[ ] Yes
[X] No

Type of change

[ ] Bugfix
[X] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

Code quality checklist

See CONTRIBUTING.md for more details.

  • The current tests all pass (python -m pytest).
  • I added tests that prove my fix is effective or that my feature works
  • I ran python -m pytest --cov to verify 100% coverage of added lines
  • I ran python -m mypy to check for type errors
  • I either used the pre-commit hooks or ran ruff manually on my code.

@pamelafox pamelafox merged commit 5a3deac into main May 11, 2025
16 checks passed
@pamelafox pamelafox deleted the agents branch May 11, 2025 07:23
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