dograh/api
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
..
alembic feat(webhooks): durable retrying delivery for final webhooks (#478) 2026-07-02 21:44:14 +05:30
assets feat: telephony call transfer (#155) 2026-02-16 14:33:33 +05:30
db feat(webhooks): durable retrying delivery for final webhooks (#478) 2026-07-02 21:44:14 +05:30
errors Feat/inbound telephony (#113) 2026-01-12 10:10:30 +05:30
mcp_server chore: improve upon mcp prompts (#494) 2026-07-03 18:14:03 +05:30
native/rnnoise Initial Commit 🚀 🚀 2025-09-09 14:37:32 +05:30
routes chore: cleaup mps v1 billing (#507) 2026-07-07 18:38:29 +05:30
schemas feat: client gen default configurations (#499) 2026-07-04 18:37:50 +05:30
services feat(tts): add xAI as a Voice (TTS) provider (#476) 2026-07-08 09:05:43 +05:30
tasks chore: cleaup mps v1 billing (#507) 2026-07-07 18:38:29 +05:30
tests feat(tts): add xAI as a Voice (TTS) provider (#476) 2026-07-08 09:05:43 +05:30
utils Feat/enhanced timestamped transcript (#501) 2026-07-07 14:47:43 +05:30
.cursorignore Initial Commit 🚀 🚀 2025-09-09 14:37:32 +05:30
.dockerignore Initial Commit 🚀 🚀 2025-09-09 14:37:32 +05:30
.env.example chore: drain active calls before rolling updates (#474) 2026-06-29 06:00:31 +05:30
.env.test.example chore: drain active calls before rolling updates (#474) 2026-06-29 06:00:31 +05:30
.gitignore Initial Commit 🚀 🚀 2025-09-09 14:37:32 +05:30
__init__.py Initial Commit 🚀 🚀 2025-09-09 14:37:32 +05:30
AGENTS.md feat: add chat based testing for voice agent (#308) 2026-05-21 15:20:02 +05:30
alembic.ini chore: bump pipecat version and fix tests (#263) 2026-05-04 21:35:37 +05:30
app.py fix: add CORS preflight handler and ACAO header for embed config endpoint (#403) 2026-06-03 21:27:44 +05:30
CLAUDE.md Chore/add setup and contributing docs (#90) 2025-12-27 09:25:20 +05:30
conftest.py feat: add devcontainer based setup (#352) 2026-05-25 20:44:22 +05:30
constants.py feat(webhooks): durable retrying delivery for final webhooks (#478) 2026-07-02 21:44:14 +05:30
Dockerfile feat: add Helm chart for Kubernetes deployment (#365) 2026-07-03 12:39:39 +05:30
enums.py chore: refactor status processor (#465) 2026-06-24 22:07:35 +05:30
logging_config.py feat: add headless mode, redesign floating widget, refactor lifecycle callbacks (#268) 2026-05-07 12:23:41 +05:30
pyproject.toml chore(main): release dograh 1.41.0 (#497) 2026-07-06 21:37:02 +05:30
pytest.ini feat: refactor node spec and add mcp tools (#244) 2026-04-21 07:56:16 +05:30
requirements.dev.txt feat: add devcontainer based setup (#352) 2026-05-25 20:44:22 +05:30
requirements.txt Implement cost calculator for Tuber (#471) 2026-07-02 12:51:14 +05:30
sdk_expose.py feat: refactor node spec and add mcp tools (#244) 2026-04-21 07:56:16 +05:30