Skip to content

Backport: chore(provider/xai): deprecate searchParameters (live search) in favor of web_search/x_search tools#15718

Merged
dancer merged 1 commit into
release-v6.0from
backport-pr-15713-to-release-v6.0
May 30, 2026
Merged

Backport: chore(provider/xai): deprecate searchParameters (live search) in favor of web_search/x_search tools#15718
dancer merged 1 commit into
release-v6.0from
backport-pr-15713-to-release-v6.0

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

This is an automated backport of #15713 to the release-v6.0 branch. FYI @dancer

…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
@github-actions github-actions Bot enabled auto-merge (squash) May 29, 2026 22:28
@dancer dancer closed this May 29, 2026
auto-merge was automatically disabled May 29, 2026 22:37

Pull request was closed

@dancer dancer reopened this May 29, 2026
@dancer dancer enabled auto-merge (squash) May 29, 2026 22:38
@dancer dancer merged commit 165d531 into release-v6.0 May 30, 2026
48 checks passed
@dancer dancer deleted the backport-pr-15713-to-release-v6.0 branch May 30, 2026 00:50
@github-actions
Copy link
Copy Markdown
Contributor Author

🚀 Published in:

Package Version
@ai-sdk/mcp 1.0.45 github npm
@ai-sdk/xai 3.0.93 github npm

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.

3 participants