From 4fc6b1ae407b3572e65b5d8d49e60c3ea47e2bf8 Mon Sep 17 00:00:00 2001 From: Hoan Luu Huu <110280845+xquanluu@users.noreply.github.com> Date: Fri, 23 Jan 2026 22:07:08 +0700 Subject: [PATCH] support google gemini tts (#590) * support google gemini tts * wip --- src/api/constants.ts | 7 + .../internal/views/speech-services/form.tsx | 402 ++++++++++-------- 2 files changed, 222 insertions(+), 187 deletions(-) diff --git a/src/api/constants.ts b/src/api/constants.ts index 872710f..8c2fdb5 100644 --- a/src/api/constants.ts +++ b/src/api/constants.ts @@ -432,6 +432,13 @@ export const DEEPGRAM_STT_ENPOINT = [ { name: "EU-hosted", value: "api.eu.deepgram.com" }, ]; +// ElevenLabs API URI options +export const ELEVENLABS_API_URI_OPTIONS = [ + { name: "US", value: "api.elevenlabs.io" }, + { name: "EU", value: "api.eu.residency.elevenlabs.io" }, + { name: "IN", value: "api.in.residency.elevenlabs.io" }, +]; + /** 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 84693ff..58510bd 100644 --- a/src/containers/internal/views/speech-services/form.tsx +++ b/src/containers/internal/views/speech-services/form.tsx @@ -97,6 +97,7 @@ import { DEFAULT_VERBIO_MODEL, DISABLE_ADDITIONAL_SPEECH_VENDORS, DISABLE_CUSTOM_SPEECH, + ELEVENLABS_API_URI_OPTIONS, GOOGLE_CUSTOM_VOICES_REPORTED_USAGE, VERBIO_STT_MODELS, } from "src/api/constants"; @@ -110,13 +111,6 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { const { toastError, toastSuccess } = useToast(); const navigate = useNavigate(); const user = useSelectState("user"); - - // ElevenLabs API URI options - const ELEVENLABS_API_URI_OPTIONS = [ - { name: "US", value: "api.elevenlabs.io" }, - { name: "EU", value: "api.eu.residency.elevenlabs.io" }, - { name: "IN", value: "api.in.residency.elevenlabs.io" }, - ]; const currentServiceProvider = useSelectState("currentServiceProvider"); const regions = useRegionVendors(); const [accounts] = useServiceProviderData("Accounts"); @@ -418,6 +412,9 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { ...(vendor === VENDOR_AWS && { aws_region: region || null, }), + ...(vendor === VENDOR_GOOGLE && { + model_id: ttsModelId || null, + }), ...(vendor === VENDOR_MICROSOFT && { region: region || null, use_custom_tts: @@ -852,6 +849,10 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { setOptionsInitialChecked(true); } if (credential?.data?.vendor === VENDOR_GOOGLE) { + // Load model_id for Gemini TTS + if (credential.data.model_id) { + setTtsModelId(credential.data.model_id); + } // let try to check if there is custom voices getGoogleCustomVoices({ speech_credential_sid: credential.data.speech_credential_sid, @@ -1236,218 +1237,245 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { )} {ttsCheck && vendor === VENDOR_GOOGLE && ( -
-
+ )} )}