Conversation
Expose the native search option for both xAI provider types and inject the Responses API web_search tool in non-streaming and streaming requests. Also allow config display conditions to accept a list of matching values.
Contributor
There was a problem hiding this comment.
Hey - I've reviewed your changes and they look great!
Sourcery assessment
Needs a human reviewer. When the setting is enabled for an xAI Responses provider, every affected request can invoke xAI Web Search and incur on-demand search charges, in addition to changing the request's external behavior. Reverting stops future calls but cannot undo charges already incurred.
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.
Motivation
Fixes #9723.
The xAI template now uses the
openai_responsesadapter, butxai_native_searchwas still displayed only for the legacyxai_chat_completionadapter. In addition, the Responses provider did not add the nativeweb_searchtool, so recent-information requests could not use xAI web search.Changes
xai_native_searchcondition to match either the legacy xAI adapter or the Responses adapter.{"type": "web_search"}to Responses requests in both non-streaming and streaming paths.web_searchtools.Testing
uv run pytest tests/test_openai_responses_source.py -q— 11 passed.uv run ruff format --check <changed Python files>anduv run ruff check <changed Python files>— passed.cd dashboard && npx pnpm@10 run typecheck— passed.git diff --check— passed.Summary by Sourcery
Enable xAI native web search for the Responses adapter and expose its configuration consistently across the dashboard.
New Features:
Bug Fixes:
Enhancements:
Documentation:
Tests: