Skip to content

Add api_host and timeout to XaiProvider#5742

Open
colesmcintosh wants to merge 4 commits into
pydantic:mainfrom
colesmcintosh:coles/xai-provider-api-host
Open

Add api_host and timeout to XaiProvider#5742
colesmcintosh wants to merge 4 commits into
pydantic:mainfrom
colesmcintosh:coles/xai-provider-api-host

Conversation

@colesmcintosh
Copy link
Copy Markdown
Contributor

@colesmcintosh colesmcintosh commented May 31, 2026

Forwards the xAI SDK client's api_host (gateway / regional / proxy setups) and timeout (client-level default) options through XaiProvider, so users don't have to drop down to a prebuilt xai_client for common deployment ergonomics. Both map to real SDK constructor parameters (api_host: str, timeout: float | None), and unset options are omitted so the SDK's own defaults apply.

This combines what were originally two separate PRs (#5742 for api_host and #5743 for timeout); since both rewrote the same __init__ overloads and as written were mutually exclusive, shipping them together avoids a merge conflict. #5743 is closed in favor of this one.

Checklist

  • Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it.
  • No breaking changes in accordance with the version policy.
  • PR title is fit for the release changelog.

@github-actions github-actions Bot added size: S Small PR (≤100 weighted lines) feature New feature request, or PR implementing a feature (enhancement) labels May 31, 2026
Forward the xAI SDK client's `api_host` (gateway/regional/proxy setups) and `timeout` (client-level default) options through `XaiProvider`, so users don't have to drop down to a prebuilt `xai_client` for common deployment ergonomics. Unset options are omitted so the SDK's own defaults apply.
@colesmcintosh colesmcintosh force-pushed the coles/xai-provider-api-host branch from d69ebe8 to 2b30ddd Compare June 1, 2026 20:50
@colesmcintosh colesmcintosh changed the title Add api_host to XaiProvider Add api_host and timeout to XaiProvider Jun 1, 2026
@colesmcintosh colesmcintosh marked this pull request as ready for review June 1, 2026 20:55
@colesmcintosh
Copy link
Copy Markdown
Contributor Author

The failing test on 3.x (lowest-versions) checks are unrelated to this change. They're caused by aiohttp 3.14.0 (published to PyPI on 2026-06-01) removing aiohttp.streams.AsyncStreamReaderMixin, which vcrpy still imports — so the lowest-direct resolver pulls the new aiohttp and the whole suite errors at collection. Tracked in #5751, with the fix in #5752 (Pin aiohttp below 3.14 for vcrpy).

This branch is already up to date with main, so once #5752 merges I'll re-merge main here to pick up the constraint and the lowest-versions matrix should go green. All other CI jobs pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature request, or PR implementing a feature (enhancement) size: S Small PR (≤100 weighted lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant