support deepgram EU-hosted STT (#555)

* support deepgram EU-hosted STT

* wip

* fix review comment

* wip

* wip
This commit is contained in:
Hoan Luu Huu
2025-08-04 18:24:33 +07:00
committed by GitHub
parent 031e5e923e
commit a372c09bc6
2 changed files with 26 additions and 4 deletions

View File

@@ -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";

View File

@@ -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}
/>
<label htmlFor={`${vendor}_deepgram_stt_enpoint`}>
Deepgram STT Endpoint<span>*</span>
</label>
<Selector
id={"deepgram_stt_enpoint"}
name={"deepgram_stt_enpoint"}
value={deepgramSttUri}
options={DEEPGRAM_STT_ENPOINT}
onChange={(e) => {
setDeepgramSttUri(e.target.value);
setDeepgramSttUseTls(hasValue(e.target.value));
}}
/>
</Checkzone>
<Checkzone
disabled={hasValue(credential)}