diff --git a/src/api/types.ts b/src/api/types.ts index 6658243..7e4eaf8 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -258,6 +258,8 @@ export interface SpeechCredential { custom_tts_endpoint: null | string; use_custom_stt: number; custom_stt_endpoint: null | string; + client_id: null | string; + secret: null | string; } export interface Alert { diff --git a/src/containers/internal/views/speech-services/form.tsx b/src/containers/internal/views/speech-services/form.tsx index d5719f9..f107067 100644 --- a/src/containers/internal/views/speech-services/form.tsx +++ b/src/containers/internal/views/speech-services/form.tsx @@ -22,6 +22,7 @@ import { VENDOR_AWS, VENDOR_GOOGLE, VENDOR_MICROSOFT, + VENDOR_NUANCE, VENDOR_WELLSAID, } from "src/vendor"; import { MSG_REQUIRED_FIELDS } from "src/constants"; @@ -51,6 +52,8 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { const [apiKey, setApiKey] = useState(""); const [accessKeyId, setAccessKeyId] = useState(""); const [secretAccessKey, setSecretAccessKey] = useState(""); + const [clientId, setClientId] = useState(""); + const [secretKey, setSecretKey] = useState(""); const [googleServiceKey, setGoogleServiceKey] = useState(null); const [useCustomTts, setUseCustomTts] = useState(false); @@ -137,6 +140,8 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { vendor === VENDOR_MICROSOFT || vendor === VENDOR_WELLSAID ? apiKey : null, + client_id: vendor === VENDOR_NUANCE ? clientId : null, + secret: vendor === VENDOR_NUANCE ? secretKey : null, }) .then(({ json }) => { toastSuccess("Speech credential created successfully"); @@ -195,6 +200,14 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { setRegion(credential.data.aws_region); } + if (credential.data.client_id) { + setClientId(credential.data.client_id); + } + + if (credential.data.secret) { + setSecretKey(credential.data.secret); + } + setUseCustomTts(credential.data.use_custom_tts > 0 ? true : false); setUseCustomStt(credential.data.use_custom_stt > 0 ? true : false); setCustomTtsEndpoint(credential.data.custom_tts_endpoint || ""); @@ -304,6 +317,35 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => { )} )} + {vendor === VENDOR_NUANCE && ( +
+ + setClientId(e.target.value)} + disabled={credential ? true : false} + /> + + setSecretKey(e.target.value)} + disabled={credential ? true : false} + /> +
+ )} {vendor === VENDOR_AWS && (