dograh/api/services/pipecat
Tararais a2240db45a
feat(tts): add xAI as a Voice (TTS) provider (#476)
* feat(tts): add xAI as a Voice (TTS) provider

pipecat already ships an xAI TTS service (XAITTSService, WebSocket
streaming) but dograh never wired it into the service configuration, so
xAI could not be selected as a Voice provider in the cascading pipeline.

Wire it through:
- registry: ServiceProviders.XAI + XAITTSConfiguration (voices
  eve/ara/leo/rex/sal, language, computed model) registered in TTSConfig
- service_factory: build XAITTSService in create_tts_service
- check_validity: api-key validation hook
- tests for the factory + docs

The Voice provider dropdown is schema-driven, so xAI appears with no UI
changes.

* fix(tts): validate xAI API key and drop misleading auto-language hint

Addresses review feedback on the xAI Voice provider:

- check_validity: replace the no-op xAI key check with real validation
  against xAI's OpenAI-compatible API (models.list on https://api.x.ai/v1),
  so a bad BYOK key is caught at configuration time instead of at call time.
- registry: remove the "auto" language hint from the field description.
  pipecat's Language enum has no "auto" member, so the factory fell back to
  English silently; the description no longer advertises detection we don't do.
- tests: cover xAI key validation (registered, accepts valid, rejects bad).

* fix(tts): validate xAI key against the TTS voices endpoint

xAI supports endpoint-scoped API keys, so a key scoped to Text-to-Speech
may lack the /v1/models ACL and would be wrongly rejected by the previous
models.list() check. Validate against GET /v1/tts/voices instead — the
scope the key actually needs for TTS — treating 401/403 as an invalid key
and connection errors as a clean, actionable message.

* fix: harden xAI TTS integration

---------

Co-authored-by: Sabiha Khan <sabihak89@gmail.com>
Co-authored-by: Sabiha Khan <87858386+chewwbaka@users.noreply.github.com>
2026-07-08 09:05:43 +05:30
..
realtime Fix realtime initial greeting handling (#481) 2026-06-29 17:25:42 +05:30
__init__.py Initial Commit 🚀 🚀 2025-09-09 14:37:32 +05:30
active_calls.py chore: drain active calls before rolling updates (#474) 2026-06-29 06:00:31 +05:30
audio_config.py feat: refactor telephony to support multiple telephony configurations (#251) 2026-04-29 11:39:57 +05:30
audio_file_cache.py feat: add full document mode in knowledge base 2026-04-09 13:49:20 +05:30
audio_mixer.py feat: refactor telephony to support multiple telephony configurations (#251) 2026-04-29 11:39:57 +05:30
audio_playback.py feat: refactor node spec and add mcp tools (#244) 2026-04-21 07:56:16 +05:30
event_handlers.py Feat/enhanced timestamped transcript (#501) 2026-07-07 14:47:43 +05:30
exceptions.py Initial Commit 🚀 🚀 2025-09-09 14:37:32 +05:30
gemini_json_schema_adapter.py fix: support Gemini JSON schema tools (#463) 2026-06-24 18:50:44 +05:30
in_memory_buffers.py Feat/enhanced timestamped transcript (#501) 2026-07-07 14:47:43 +05:30
minimax_tts.py feat: add MiniMax provider support (Chat + TTS) (#309) 2026-05-22 13:09:41 +05:30
pipeline_builder.py chore: update pipecat to 1.3.0 (#379) 2026-05-29 16:19:42 +05:30
pipeline_engine_callbacks_processor.py feat: client gen default configurations (#499) 2026-07-04 18:37:50 +05:30
pipeline_metrics_aggregator.py chore: upgrade pipecat 2026-03-06 16:49:14 +05:30
pre_call_fetch.py chore: update docs for pre-call data fetch 2026-06-05 14:16:56 +05:30
realtime_feedback_events.py Feat/enhanced timestamped transcript (#501) 2026-07-07 14:47:43 +05:30
realtime_feedback_observer.py Feat/enhanced timestamped transcript (#501) 2026-07-07 14:47:43 +05:30
recording_audio_cache.py feat: add recording audio option in tool and node transitions (#232) 2026-04-10 17:53:42 +05:30
recording_router_processor.py feat: add recording audio option in tool and node transitions (#232) 2026-04-10 17:53:42 +05:30
run_pipeline.py Feat/enhanced timestamped transcript (#501) 2026-07-07 14:47:43 +05:30
service_factory.py feat(tts): add xAI as a Voice (TTS) provider (#476) 2026-07-08 09:05:43 +05:30
tracing_config.py feat: add chat based testing for voice agent (#308) 2026-05-21 15:20:02 +05:30
transport_params.py feat: add openai realtime models (#298) 2026-05-16 18:05:23 +05:30
transport_setup.py feat: add openai realtime models (#298) 2026-05-16 18:05:23 +05:30
turn_context.py chore: bump pipecat version 2026-02-11 18:18:32 +05:30
worker_runner.py chore: update pipecat to 1.3.0 (#379) 2026-05-29 16:19:42 +05:30
ws_sender_registry.py feat: add transcript panel during live call for better visibility (#116) 2026-01-13 22:48:18 +05:30