dograh/api/services/pipecat
developer603 8a4a2e25db
feat: allow overriding base URL of OpenAI STT and TTS (#377)
Mirrors the LLM treatment from #368 for the OpenAI STT and OpenAI TTS
providers. Users running OpenAI-compatible self-hosted services (vLLM,
Speaches, llama.cpp, custom proxies) can now point Dograh at them via
the OpenAI provider with `base_url`, instead of being forced onto the
Speaches provider as a workaround.

Changes:

* `registry.py` — add `base_url` field (default `https://api.openai.com/v1`)
  to `OpenAISTTConfiguration` and `OpenAITTSService`, identical in shape
  to the existing `OpenAILLMService.base_url` from #368.

* `service_factory.py` — in the OPENAI branches of `create_stt_service`
  and `create_tts_service`, lift `base_url` off the user config, run it
  through `_validate_runtime_service_url`, and forward it as a kwarg to
  `OpenAISTTService` / `OpenAITTSService` (both already accept it). Same
  pattern as the LLM branch.

* `test_user_configured_service_url_security.py` — adds four runtime
  validation tests covering private-IP rejection and localhost rejection
  in SaaS mode for both STT and TTS. Existing OSS-mode permissiveness
  is unchanged (DEPLOYMENT_MODE=oss skips the validator, as before).

No schema migration needed — Pydantic populates the default; existing
configurations without `base_url` continue to talk to api.openai.com.

`check_validity.py` requires no edits because the per-service validation
loop already iterates `("base_url", "endpoint")` via `getattr`, and the
`_check_openai_api_key` dispatcher already routes OPENAI providers
through the base_url-aware code path (introduced in #368) for STT and
TTS too.

Tests pass locally:

    pytest api/tests/test_user_configured_service_url_security.py
    23 passed in 4.80s   (19 existing + 4 new)

Co-authored-by: developer603 <developer603@users.noreply.github.com>
2026-06-02 12:06:58 +05:30
..
realtime fix: fix rtf logs and gemini live turn taking 2026-05-31 16:05:03 +05:30
__init__.py Initial Commit 🚀 🚀 2025-09-09 14:37:32 +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 chore: update pipecat to 1.3.0 (#379) 2026-05-29 16:19:42 +05:30
exceptions.py Initial Commit 🚀 🚀 2025-09-09 14:37:32 +05:30
in_memory_buffers.py feat: add chat based testing for voice agent (#308) 2026-05-21 15:20:02 +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: abort immediately on max call duration exceed 2026-05-31 13:21:37 +05:30
pipeline_metrics_aggregator.py chore: upgrade pipecat 2026-03-06 16:49:14 +05:30
pre_call_fetch.py feat: add pre call fetch configuration (#222) 2026-04-06 12:30:37 +05:30
realtime_feedback_events.py feat: add chat based testing for voice agent (#308) 2026-05-21 15:20:02 +05:30
realtime_feedback_observer.py fix: fix rtf logs and gemini live turn taking 2026-05-31 16:05:03 +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 chore: update pipecat to 1.3.0 (#379) 2026-05-29 16:19:42 +05:30
service_factory.py feat: allow overriding base URL of OpenAI STT and TTS (#377) 2026-06-02 12:06:58 +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