Skip to content

feat(xai): wire the 26-voice Grok catalog into both SDKs - #218

Merged
nicolotognoni merged 1 commit into
mainfrom
feat/xai-voice-catalog
Aug 24, 2026
Merged

nicolotognoni merged 1 commit into
mainfrom
feat/xai-voice-catalog

Conversation

@fra-shipper

Copy link
Copy Markdown
Collaborator

Summary

The xAI (Grok) STT / TTS / Realtime providers shipped in #211, but the 26-voice roster lived only in docs prose. This PR wires it into both SDKs.

  • Typed immutable catalog: XAI_VOICES / XAI_VOICE_IDS / XAI_DEFAULT_VOICE plus isXaiBuiltinVoice / normalizeXaiVoice / getXaiVoice (TS) and is_xai_builtin_voice / normalize_xai_voice / get_xai_voice (Python), exported from the package root.
  • Normalization at the wire: XaiTTS (REST voice_id) and XaiRealtimeAdapter (session.update voice) trim + lowercase built-in ids; custom cloned voice_ids stay opaque and are never rejected. XAI_REALTIME_DEFAULT_VOICE remains exported as an alias.
  • Config helpers: providers.xai() (TTS, key xai_tts) and xaiAsr() / xai_asr() (STT, key xai). The Python TTSConfig / STTConfig factories in telephony/common.py now resolve those keys to XaiTTS / XaiSTT (previously a dead end).
  • patter init lists xAI in both STT and TTS provider tables (XAI_API_KEY).
  • Docs (xai-tts.mdx, both SDKs) and CHANGELOG.

Test plan

  • TS: tsc --noEmit clean; vitest run 166 files, 2616 passed / 9 skipped
  • Python: pytest tests 3016 passed / 33 skipped / 2 xfailed
  • New unit tests: xai-voices.test.ts (10), test_xai_voices.py (17), factory regression tests for xai() / xai_asr(), adapter tests asserting the normalized voice is what gets sent
  • CI green on this PR

🤖 Generated with Claude Code

Typed immutable voice roster (XAI_VOICES / XAI_VOICE_IDS / XAI_DEFAULT_VOICE)
with case-insensitive builtin lookup and trim+lowercase normalization applied
before the voice reaches xAI (REST voice_id, session.update voice). Custom
cloned voice_ids stay opaque and are never rejected.

Adds providers.xai() / xaiAsr() (TS) and xai() / xai_asr() (Python) config
helpers, resolves the xai_tts / xai keys in the Python TTSConfig/STTConfig
factories, lists xAI in the patter init STT/TTS tables, and points the
xai-tts docs at the catalog. TS: tsc clean, 2616 tests; Python: 3016 tests.
@nicolotognoni
nicolotognoni merged commit f018751 into main Aug 24, 2026
18 of 20 checks passed
@github-actions
github-actions Bot deleted the feat/xai-voice-catalog branch August 25, 2026 04:39

This branch was successfully deployed

1 active deployment
staging - docs — fc1e22ad Deployed Aug 24, 2026 by mintlify[bot]
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.

2 participants