From a372c09bc6379dddaa029c12e1d21453821a0893 Mon Sep 17 00:00:00 2001 From: Hoan Luu Huu <110280845+xquanluu@users.noreply.github.com> Date: Mon, 4 Aug 2025 18:24:33 +0700 Subject: [PATCH] support deepgram EU-hosted STT (#555) * support deepgram EU-hosted STT * wip * fix review comment * wip * wip --- src/api/constants.ts | 5 ++++ .../internal/views/speech-services/form.tsx | 25 ++++++++++++++++--- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/api/constants.ts b/src/api/constants.ts index 79fdbcd..cf47af4 100644 --- a/src/api/constants.ts +++ b/src/api/constants.ts @@ -418,6 +418,11 @@ export const CurrencySymbol: Currency = { usd: "$", }; +export const DEEPGRAM_STT_ENPOINT = [ + { name: "US (Default)", value: "" }, + { name: "EU-hosted", value: "api.eu.deepgram.com" }, +]; + /** User scope values values */ export const USER_ADMIN = "admin"; export const USER_SP = "service_provider"; diff --git a/src/containers/internal/views/speech-services/form.tsx b/src/containers/internal/views/speech-services/form.tsx index a1ddd4f..733fba9 100644 --- a/src/containers/internal/views/speech-services/form.tsx +++ b/src/containers/internal/views/speech-services/form.tsx @@ -83,6 +83,7 @@ import { setAccountFilter, setLocation } from "src/store/localStore"; import { ADDITIONAL_SPEECH_VENDORS, ASSEMBLYAI_STT_VERSIONS, + DEEPGRAM_STT_ENPOINT, DEFAULT_ASSEMBLYAI_STT_VERSION, DEFAULT_CARTESIA_OPTIONS, DEFAULT_ELEVENLABS_OPTIONS, @@ -811,9 +812,7 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { setUseCustomVoicesCheck(json.length > 0); }); } - if (credential?.data?.deepgram_stt_uri) { - setDeepgramSttUri(credential.data.deepgram_stt_uri); - } + setDeepgramSttUri(credential?.data?.deepgram_stt_uri || ""); if (credential?.data?.deepgram_tts_uri) { setDeepgramTtsUri(credential.data.deepgram_tts_uri); } @@ -822,7 +821,12 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { credential?.data?.deepgram_stt_use_tls > 0 ? true : false, ); } - setInitialDeepgramOnpremCheck(hasValue(credential?.data?.deepgram_stt_uri)); + setInitialDeepgramOnpremCheck( + hasValue(credential?.data?.deepgram_stt_uri) && + !DEEPGRAM_STT_ENPOINT.map((e) => e.value).includes( + credential?.data?.deepgram_stt_uri, + ), + ); if (credential?.data?.user_id) { setUserId(credential.data.user_id); @@ -2033,6 +2037,19 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { onChange={(e) => setApiKey(e.target.value)} disabled={credential ? true : false} /> + + { + setDeepgramSttUri(e.target.value); + setDeepgramSttUseTls(hasValue(e.target.value)); + }} + />