feat: add OpenAI Responses routing for chat#770
Open
afurm wants to merge 1 commit into
Open
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #770 +/- ##
==========================================
+ Coverage 87.05% 87.25% +0.19%
==========================================
Files 119 120 +1
Lines 5594 5820 +226
Branches 1407 1475 +68
==========================================
+ Hits 4870 5078 +208
- Misses 724 742 +18 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Adds OpenAI Responses API support behind the existing
RubyLLM.chatinterface.This keeps Chat Completions as the default path in
:auto, then routes native OpenAI requests to Responses when the request requires it, including native Responses tools likeweb_search, deep-research models, Responses-only params, and GPT-5 tool calls with reasoning enabled.The change also adds:
config.openai_api_mode = :auto | :chat_completions | :responseswith_params(openai_api_mode: :responses)Closes #213.
Type of change
Scope check
Required for new features
Quality check
overcommit --installand all hooks passbundle exec rake vcr:record[provider_name]bundle exec rspecmodels.json,aliases.json)Validation run:
bundle exec rspec spec/ruby_llm/providersbundle exec rubocop --ignore-unrecognized-cops ...git diff --checkVCR cassettes were not re-recorded in this branch.
AI-generated code
API changes
Adds a new OpenAI configuration option,
openai_api_mode, and a provider-specific per-request routing param with the same name.