diff --git a/src/api/constants.ts b/src/api/constants.ts index e7d187d..4e26269 100644 --- a/src/api/constants.ts +++ b/src/api/constants.ts @@ -205,6 +205,14 @@ export const DEFAULT_ELEVENLABS_MODEL = "eleven_multilingual_v2"; export const DEFAULT_WHISPER_MODEL = "tts-1"; +// VERBIO +export const VERBIO_STT_MODELS = [ + { name: "V1", value: "V1" }, + { name: "V2", value: "V2" }, +]; + +export const DEFAULT_VERBIO_MODEL = "V1"; + // Google Custom Voice reported usage options export const DEFAULT_GOOGLE_CUSTOM_VOICES_REPORTED_USAGE = "REALTIME"; diff --git a/src/api/types.ts b/src/api/types.ts index d07a5b1..0b266f1 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -402,6 +402,7 @@ export interface SpeechCredential { custom_stt_endpoint_url: null | string; custom_stt_endpoint: null | string; client_id: null | string; + client_secret: null | string; secret: null | string; nuance_tts_uri: null | string; nuance_stt_uri: null | string; @@ -418,6 +419,7 @@ export interface SpeechCredential { cobalt_server_uri: null | string; model_id: null | string; voice_engine: null | string; + engine_version: null | string; model: null | string; options: null | string; deepgram_stt_uri: null | string; diff --git a/src/containers/internal/views/speech-services/form.tsx b/src/containers/internal/views/speech-services/form.tsx index 82f66c9..9e69115 100644 --- a/src/containers/internal/views/speech-services/form.tsx +++ b/src/containers/internal/views/speech-services/form.tsx @@ -46,6 +46,7 @@ import { AWS_CREDENTIAL_IAM_ASSUME_ROLE, AWS_CREDENTIAL_ACCESS_KEY, AWS_INSTANCE_PROFILE, + VENDOR_VERBIO, } from "src/vendor"; import { MSG_REQUIRED_FIELDS } from "src/constants"; import { @@ -77,8 +78,10 @@ import { DEFAULT_GOOGLE_CUSTOM_VOICES_REPORTED_USAGE, DEFAULT_PLAYHT_OPTIONS, DEFAULT_RIMELABS_OPTIONS, + DEFAULT_VERBIO_MODEL, DISABLE_CUSTOM_SPEECH, GOOGLE_CUSTOM_VOICES_REPORTED_USAGE, + VERBIO_STT_MODELS, } from "src/api/constants"; type SpeechServiceFormProps = { @@ -106,6 +109,7 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { const [secretAccessKey, setSecretAccessKey] = useState(""); const [clientId, setClientId] = useState(""); const [secretKey, setSecretKey] = useState(""); + const [clientSecret, setClientSecret] = useState(""); const [googleServiceKey, setGoogleServiceKey] = useState(null); const [sttRegion, setSttRegion] = useState(""); @@ -113,6 +117,7 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { const [ttsRegion, setTtsRegion] = useState(""); const [ttsApiKey, setTtsApiKey] = useState(""); const [ttsModelId, setTtsModelId] = useState(""); + const [engineVersion, setEngineVersion] = useState(DEFAULT_VERBIO_MODEL); const [instanceId, setInstanceId] = useState(""); const [initialCheckCustomTts, setInitialCheckCustomTts] = useState(false); const [initialCheckCustomStt, setInitialCheckCustomStt] = useState(false); @@ -353,6 +358,9 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { deepgram_stt_uri: deepgramSttUri || null, deepgram_stt_use_tls: deepgramSttUseTls ? 1 : 0, }), + ...(vendor === VENDOR_VERBIO && { + engine_version: engineVersion, + }), }; if (credential && credential.data) { @@ -405,6 +413,10 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { userId && { user_id: userId, }), + ...(vendor === VENDOR_VERBIO && { + client_id: clientId, + client_secret: clientSecret, + }), riva_server_uri: vendor == VENDOR_NVIDIA ? rivaServerUri : null, }) .then(({ json }) => { @@ -647,6 +659,15 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { : AWS_INSTANCE_PROFILE, ); } + if (credential?.data?.client_id) { + setClientId(credential.data.client_id); + } + if (credential?.data?.client_secret) { + setClientSecret(credential.data.client_secret); + } + if (credential?.data?.engine_version) { + setEngineVersion(credential.data.engine_version); + } }, [credential]); const updateCustomVoices = ( @@ -1183,6 +1204,58 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { )} + {vendor === VENDOR_VERBIO && ( + <> +
+ + setClientId(e.target.value)} + disabled={credential ? true : false} + /> + + setClientSecret(e.target.value)} + disabled={credential ? true : false} + /> +
+
+ + { + setEngineVersion(e.target.value); + }} + /> +
+ + )} {vendor === VENDOR_AWS && (