-
-
Notifications
You must be signed in to change notification settings - Fork 140
[Platform] Migrate OpenAI to Responses API #871
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
Conversation
|
lol, please hold. Forgot to add a whole bunch of tests. Feel free to review functionality in the meantime |
47ae95d to
57f7762
Compare
57f7762 to
546019d
Compare
546019d to
9af9306
Compare
70d3673 to
8166232
Compare
chr-hertel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
I extracted the |
8166232 to
95ea744
Compare
chr-hertel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine from my end to merge after #1052 - which is needed to not break all bridges sitting on top of OpenAI ModelClients and ResultConverters.
…ai embeddings- and completions-based platforms (chr-hertel) This PR was merged into the main branch. Discussion ---------- [Platform][Generic] Introduce generic platform for openai embeddings- and completions-based platforms | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | Docs? | yes | Issues | Fix #114 | License | MIT Replaces #938 and unblocks #871 - diff looks a bit weird due to git mixing up removed classes and new generic bridge. - [x] Tests - [x] Docs - [x] Bundle This enables to use tools like Litellm without specific bridge with a configuration like this: ```yaml # config/packages/ai.yaml ai: platform: generic: litellm: base_url: '%env(LITELLM_HOST_URL)%' # e.g. http://localhost:4000 api_key: '%env(LITELLM_API_KEY)%' # e.g. sk-1234 model_catalog: 'Symfony\AI\Platform\Bridge\Generic\ModelCatalog' # see below agent: test: platform: 'ai.platform.generic.litellm' model: 'mistral-small-latest' tools: false services: Symfony\AI\Platform\Bridge\Generic\ModelCatalog: $models: mistral-small-latest: class: 'Symfony\AI\Platform\Bridge\Generic\CompletionsModel' capabilities: - !php/const 'Symfony\AI\Platform\Capability::INPUT_MESSAGES' - !php/const 'Symfony\AI\Platform\Capability::OUTPUT_TEXT' - !php/const 'Symfony\AI\Platform\Capability::OUTPUT_STREAMING' - !php/const 'Symfony\AI\Platform\Capability::OUTPUT_STRUCTURED' - !php/const 'Symfony\AI\Platform\Capability::INPUT_IMAGE' - !php/const 'Symfony\AI\Platform\Capability::TOOL_CALLING' ``` <img width="1216" height="635" alt="image" src="https://github.com/user-attachments/assets/7984afb3-40f9-454f-9d3d-6abdba1c828a" /> Commits ------- a42f298 Introduce generic platform for openai embeddings- and completions-based platforms
|
#1052 is now merged 👍 |
chr-hertel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Thanks @chr-hertel, having a look now |
ef3d3a3 to
217b545
Compare
b707560 to
1029073
Compare
chr-hertel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much @paulinevos - can imagine that was a bit annoying 🙈 but well done! 🙏
1029073 to
82ec95b
Compare
|
Thank you @paulinevos. |
|
Amazing work, thank you so much 😊 |
…ion (chr-hertel) This PR was merged into the main branch. Discussion ---------- [Demo] Patch max_output_token after OpenAI responses migration | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | Docs? | no | Issues | | License | MIT Follows #871 Commits ------- fee3a4b Patch max_output_token after OpenAI responses migration
…gration (chr-hertel) This PR was merged into the main branch. Discussion ---------- [Platform][Azure] Patch Azure OpenAI after responses API migration | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | Docs? | no | Issues | | License | MIT Follows #871 Commits ------- fc53587 Patch Azure OpenAI after responses API migration


This PR migrates OpenAI from chat completions (deprecated) to the Responses API. I tried to keep the scope small and just support everything already in place as seamlessly as possible. The Responses API does offer some more functionality that we should look into supporting (e.g. MCP tool calling, expanded reasoning functionality), but I found that OOS for this migration.
One thing to note it that the Responses API as of now lacks Audio capabilities ("coming soon", according to the docs), so that example is temporarily disabled and so is the
Gptaudio capability for now.Note: my PRs are best reviewed commit by commit