Add xAI streaming STT service
New `XAISTTService` wraps xAI's real-time speech-to-text WebSocket (`wss://api.x.ai/v1/stt`). It extends `WebsocketSTTService`, authenticates with the `XAI_API_KEY` as a Bearer token on the WS handshake, and streams raw audio (PCM/mu-law/A-law) with configurable interim results, endpointing, language, multichannel, and diarization settings. - `src/pipecat/services/xai/stt.py`: new service, settings dataclass, and `language_to_xai_stt_language` helper. - `src/pipecat/services/stt_latency.py`: `XAI_TTFS_P99` default. - `pyproject.toml` / `uv.lock`: `xai` extra now pulls in `websockets-base`. - `README.md`: link to xAI STT in the services table. - `examples/voice/voice-xai.py`: swap DeepgramSTTService for XAISTTService so the xAI voice example is fully xAI. - `examples/transcription/transcription-xai.py`: new transcription-only example using the new service.
This commit is contained in:
4
uv.lock
generated
4
uv.lock
generated
@@ -4403,6 +4403,9 @@ websockets-base = [
|
||||
whisper = [
|
||||
{ name = "faster-whisper" },
|
||||
]
|
||||
xai = [
|
||||
{ name = "websockets" },
|
||||
]
|
||||
|
||||
[package.dev-dependencies]
|
||||
dev = [
|
||||
@@ -4507,6 +4510,7 @@ requires-dist = [
|
||||
{ name = "pipecat-ai", extras = ["websockets-base"], marker = "extra == 'soniox'" },
|
||||
{ name = "pipecat-ai", extras = ["websockets-base"], marker = "extra == 'ultravox'" },
|
||||
{ name = "pipecat-ai", extras = ["websockets-base"], marker = "extra == 'websocket'" },
|
||||
{ name = "pipecat-ai", extras = ["websockets-base"], marker = "extra == 'xai'" },
|
||||
{ name = "pipecat-ai-small-webrtc-prebuilt", marker = "extra == 'runner'", specifier = ">=2.4.0" },
|
||||
{ name = "piper-tts", marker = "extra == 'piper'", specifier = ">=1.3.0,<2" },
|
||||
{ name = "protobuf", specifier = ">=6.31.1,<7" },
|
||||
|
||||
Reference in New Issue
Block a user