Skip to content

Conversation

HareeshBahuleyan
Copy link
Contributor

@HareeshBahuleyan HareeshBahuleyan commented Oct 9, 2025

@HareeshBahuleyan HareeshBahuleyan linked an issue Oct 9, 2025 that may be closed by this pull request
@HareeshBahuleyan HareeshBahuleyan self-assigned this Oct 9, 2025
Copy link

codecov bot commented Oct 9, 2025

Codecov Report

❌ Patch coverage is 74.65753% with 37 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/any_agent/frameworks/openai.py 64.42% 26 Missing and 11 partials ⚠️
Files with missing lines Coverage Δ
src/any_agent/testing/helpers.py 40.98% <ø> (-29.51%) ⬇️
src/any_agent/tools/wrappers.py 94.56% <100.00%> (ø)
tests/conftest.py 79.74% <100.00%> (-11.40%) ⬇️
tests/unit/conftest.py 100.00% <100.00%> (ø)
tests/unit/frameworks/test_any_agent.py 100.00% <100.00%> (ø)
tests/unit/frameworks/test_openai.py 100.00% <100.00%> (ø)
tests/unit/tools/test_exception_run.py 100.00% <100.00%> (ø)
tests/unit/tools/test_unit_wrappers.py 96.36% <100.00%> (ø)
src/any_agent/frameworks/openai.py 63.22% <64.42%> (-15.73%) ⬇️

... and 47 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

daavoo pushed a commit to mozilla-ai/any-llm that referenced this pull request Oct 13, 2025
…ies with Mistral (#535)

Current support is limited to `params.response_format` being a Pydantic
Model. This PR enables using openAI schema. Will be useful when
migrating openai agents framework to use any-llm:
mozilla-ai/any-agent#828
@HareeshBahuleyan HareeshBahuleyan marked this pull request as ready for review October 14, 2025 09:56
@HareeshBahuleyan
Copy link
Contributor Author

Integration tests passing on CI: https://github.com/mozilla-ai/any-agent/actions/runs/18492592870

Status of running [OPENAI] framework integration tests locally:

@daavoo I guess Gemini and XAI not supporting OpenAI structured output format is something that we cannot fix.
Hence I think we based on the code review, we could proceed with the PR.

@daavoo
Copy link
Contributor

daavoo commented Oct 14, 2025

@daavoo I guess Gemini and XAI not supporting OpenAI structured output format is something that we cannot fix.

@HareeshBahuleyan I don't think we can fix it in any-agent but I don't see why we couldn't make this work with changes in any-llm

@HareeshBahuleyan
Copy link
Contributor Author

but I don't see why we couldn't make this work with changes in any-llm

@daavoo Do you mean implementing a helper function in any-llm to convert openAI JSON schema format to Pydantic?

@daavoo
Copy link
Contributor

daavoo commented Oct 14, 2025

but I don't see why we couldn't make this work with changes in any-llm

@daavoo Do you mean implementing a helper function in any-llm to convert openAI JSON schema format to Pydantic?

no, I mean that any-llm should support receiving as response_format any of the argument types that openai supports and take care of converting them to the appropriate format for each provider under the hood (in this case there should be some conversion for gemini and xai)

@HareeshBahuleyan
Copy link
Contributor Author

Sounds reasonable, created issues in any-llm to track this: mozilla-ai/any-llm#541 and mozilla-ai/any-llm#542

@daavoo daavoo self-requested a review October 14, 2025 17:37
Copy link
Contributor

@daavoo daavoo left a comment

Choose a reason for hiding this comment

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

I run the tests with the debugger and implementation looks good.

We weed to update pyproject.toml and would be great to try the class-based AnyLLM API.

@daavoo daavoo force-pushed the 770-migrate-openai-to-any-llm branch from bc7c97e to 0a8b73b Compare October 15, 2025 11:13
@HareeshBahuleyan HareeshBahuleyan force-pushed the 770-migrate-openai-to-any-llm branch 2 times, most recently from 74a470c to daa8b42 Compare October 17, 2025 11:30
@HareeshBahuleyan
Copy link
Contributor Author

Rerun of integration tests after class-based AnyLLM definition:
https://github.com/mozilla-ai/any-agent/actions/runs/18588782499

Copy link
Contributor

@daavoo daavoo left a comment

Choose a reason for hiding this comment

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

Thanks for addressing all the comments @HareeshBahuleyan 🙏

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.

Migrate openai to use any-llm

2 participants