chore(provider/xai): deprecate searchParameters (live search) in favor of web_search/x_search tools#15713
Merged
Merged
Conversation
…r of web_search/x_search tools
gr2m
approved these changes
May 29, 2026
github-actions Bot
added a commit
that referenced
this pull request
May 29, 2026
…r of web_search/x_search tools (#15713) ## background xAI has deprecated Live Search. the `search_parameters` field on chat completions now returns `410 Gone` with: > `Live search is deprecated. Please switch to the Agent Tools API: https://docs.x.ai/docs/guides/tools/overview` verified live against `api.x.ai` across grok-4.3 / grok-3-latest and all search modes. through the SDK the option is broken either way: - `xai.chat(modelId)` → serializes `search_parameters`, xAI returns `410 Gone` - `xai(modelId)` / `xai.responses(modelId)` → the responses model never read `searchParameters`, so it is silently dropped and no search runs (a no-op) so the option is non-functional on every path. the working replacement is the `web_search` / `x_search` agent tools on the responses endpoint, already supported via `xai.tools.webSearch()` / `xai.tools.xSearch()`. ## summary - mark `searchParameters` as `@deprecated` in `xai-chat-language-model-options.ts`, pointing users to `xai.tools.webSearch()` / `xai.tools.xSearch()` with `xai.responses(modelId)`. follows the same JSDoc-on-zod-field convention already used in the file (`xHandles`) and other providers (black-forest-labs, google interactions) - the serialization is intentionally left in place (no breaking change) — the option still exists, it's just flagged - remove the two now-dead example files (`generate-text/xai/search.ts`, `stream-text/xai/search.ts`). they used the default `xai()` callable (responses), so they were silently no-op'ing even before the deprecation. their replacements already exist: `responses-web-search.ts`, `web-search-image-understanding.ts`, `x-search-video-understanding.ts` ## verification - raw curl: `search_parameters` returns `410` on grok-4.3 / grok-3-latest, modes `auto` and `on` - via SDK: `xai.chat(...)` with `searchParameters` → `410 Gone`; `xai(...)` (responses) → option silently dropped (no `search_parameters` in request body) - replacement examples run live against xAI and return real cited results (`responses-web-search.ts`, `web-search-image-understanding.ts`) - xai package tests pass, type-check and build clean ## related - #12827
Contributor
|
✅ Backport PR created: #15718 |
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.
background
xAI has deprecated Live Search. the
search_parametersfield on chat completions now returns410 Gonewith:verified live against
api.x.aiacross grok-4.3 / grok-3-latest and all search modes. through the SDK the option is broken either way:xai.chat(modelId)→ serializessearch_parameters, xAI returns410 Gonexai(modelId)/xai.responses(modelId)→ the responses model never readsearchParameters, so it is silently dropped and no search runs (a no-op)so the option is non-functional on every path. the working replacement is the
web_search/x_searchagent tools on the responses endpoint, already supported viaxai.tools.webSearch()/xai.tools.xSearch().summary
searchParametersas@deprecatedinxai-chat-language-model-options.ts, pointing users toxai.tools.webSearch()/xai.tools.xSearch()withxai.responses(modelId). follows the same JSDoc-on-zod-field convention already used in the file (xHandles) and other providers (black-forest-labs, google interactions)generate-text/xai/search.ts,stream-text/xai/search.ts). they used the defaultxai()callable (responses), so they were silently no-op'ing even before the deprecation. their replacements already exist:responses-web-search.ts,web-search-image-understanding.ts,x-search-video-understanding.tsverification
search_parametersreturns410on grok-4.3 / grok-3-latest, modesautoandonxai.chat(...)withsearchParameters→410 Gone;xai(...)(responses) → option silently dropped (nosearch_parametersin request body)responses-web-search.ts,web-search-image-understanding.ts)related