dograh/api/services
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
..
auth chore: cleaup mps v1 billing (#507) 2026-07-07 18:38:29 +05:30
campaign feat: centralise workflow run authorization 2026-06-12 18:16:30 +05:30
configuration feat(tts): add xAI as a Voice (TTS) provider (#476) 2026-07-08 09:05:43 +05:30
filesystem chore: refactor file upload mechanism to avoid NFS dependency (#496) 2026-07-03 20:01:52 +05:30
gen_ai chore: cleaup mps v1 billing (#507) 2026-07-07 18:38:29 +05:30
gender Initial Commit 🚀 🚀 2025-09-09 14:37:32 +05:30
integrations feat: add template variable rendering for transfer call destination 2026-07-02 13:36:29 +05:30
pipecat feat(tts): add xAI as a Voice (TTS) provider (#476) 2026-07-08 09:05:43 +05:30
reports feat: billing and credit management v2 (#429) 2026-06-12 14:55:30 +05:30
telephony fix: fix agent stream contract with cloudonix (#504) 2026-07-06 23:58:04 +05:30
voice_prompting_guide chore: improve upon mcp prompts (#494) 2026-07-03 18:14:03 +05:30
worker_sync feat: add worker sync events 2026-04-04 14:26:47 +05:30
workflow chore: cleaup mps v1 billing (#507) 2026-07-07 18:38:29 +05:30
managed_model_services.py feat: centralise workflow run authorization 2026-06-12 18:16:30 +05:30
mps_billing.py feat: billing and credit management v2 (#429) 2026-06-12 14:55:30 +05:30
mps_service_key_client.py chore: cleaup mps v1 billing (#507) 2026-07-07 18:38:29 +05:30
organization_context.py feat: billing and credit management v2 (#429) 2026-06-12 14:55:30 +05:30
organization_preferences.py feat: add config v2 to simplify billing (#428) 2026-06-09 16:10:26 +05:30
posthog_client.py chore: fix phantom user creation in posthog 2026-06-19 21:08:09 +05:30
quota_service.py chore: cleaup mps v1 billing (#507) 2026-07-07 18:38:29 +05:30
storage.py fix: pass s3 compose settings into storage 2026-06-24 18:37:20 +05:30
tool_management.py feat: create tools using MCP 2026-05-31 16:50:44 +05:30
user_onboarding.py feat: UI refresh and user onboarding (#430) 2026-06-17 19:49:33 +05:30
workflow_run_artifacts.py chore: refactor file upload mechanism to avoid NFS dependency (#496) 2026-07-03 20:01:52 +05:30
workflow_run_billing.py chore: cleaup mps v1 billing (#507) 2026-07-07 18:38:29 +05:30