mirror of
https://github.com/jambonz/jambonz-webapp.git
synced 2025-12-19 05:37:43 +00:00
support mod cartesia transcribe (#536)
This commit is contained in:
@@ -429,6 +429,7 @@ export interface SpeechCredential {
|
|||||||
label: null | string;
|
label: null | string;
|
||||||
cobalt_server_uri: null | string;
|
cobalt_server_uri: null | string;
|
||||||
model_id: null | string;
|
model_id: null | string;
|
||||||
|
stt_model_id: null | string;
|
||||||
voice_engine: null | string;
|
voice_engine: null | string;
|
||||||
engine_version: null | string;
|
engine_version: null | string;
|
||||||
model: null | string;
|
model: null | string;
|
||||||
|
|||||||
@@ -260,7 +260,19 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => {
|
|||||||
switch (vendor) {
|
switch (vendor) {
|
||||||
case VENDOR_PLAYHT:
|
case VENDOR_PLAYHT:
|
||||||
return "Voice Engine";
|
return "Voice Engine";
|
||||||
|
case VENDOR_DEEPGRAM:
|
||||||
|
return "Model ID";
|
||||||
case VENDOR_CARTESIA:
|
case VENDOR_CARTESIA:
|
||||||
|
return "TTS Model ID";
|
||||||
|
default:
|
||||||
|
return "Model";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const getSTTModelLabelByVendor = (vendor: Lowercase<Vendor>) => {
|
||||||
|
switch (vendor) {
|
||||||
|
case VENDOR_CARTESIA:
|
||||||
|
return " STT Model ID";
|
||||||
case VENDOR_DEEPGRAM:
|
case VENDOR_DEEPGRAM:
|
||||||
return "Model ID";
|
return "Model ID";
|
||||||
default:
|
default:
|
||||||
@@ -397,6 +409,7 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => {
|
|||||||
}),
|
}),
|
||||||
...(vendor === VENDOR_CARTESIA && {
|
...(vendor === VENDOR_CARTESIA && {
|
||||||
model_id: ttsModelId || null,
|
model_id: ttsModelId || null,
|
||||||
|
stt_model_id: sttModelId || null,
|
||||||
options: options || null,
|
options: options || null,
|
||||||
}),
|
}),
|
||||||
...(vendor === VENDOR_CUSTOM && {
|
...(vendor === VENDOR_CUSTOM && {
|
||||||
@@ -758,6 +771,8 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => {
|
|||||||
(vendor === VENDOR_OPENAI || vendor === VENDOR_DEEPGRAM)
|
(vendor === VENDOR_OPENAI || vendor === VENDOR_DEEPGRAM)
|
||||||
) {
|
) {
|
||||||
setSttModelId(credential.data.model_id);
|
setSttModelId(credential.data.model_id);
|
||||||
|
} else if (credential.data.stt_model_id) {
|
||||||
|
setSttModelId(credential.data.stt_model_id);
|
||||||
}
|
}
|
||||||
if (credential?.data?.playht_tts_uri) {
|
if (credential?.data?.playht_tts_uri) {
|
||||||
setPlayhtTtsUri(credential.data.playht_tts_uri);
|
setPlayhtTtsUri(credential.data.playht_tts_uri);
|
||||||
@@ -961,7 +976,6 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => {
|
|||||||
vendor !== VENDOR_WHISPER &&
|
vendor !== VENDOR_WHISPER &&
|
||||||
vendor !== VENDOR_PLAYHT &&
|
vendor !== VENDOR_PLAYHT &&
|
||||||
vendor !== VENDOR_RIMELABS &&
|
vendor !== VENDOR_RIMELABS &&
|
||||||
vendor !== VENDOR_CARTESIA &&
|
|
||||||
vendor !== VENDOR_ELEVENLABS && (
|
vendor !== VENDOR_ELEVENLABS && (
|
||||||
<label htmlFor="use_for_stt" className="chk">
|
<label htmlFor="use_for_stt" className="chk">
|
||||||
<input
|
<input
|
||||||
@@ -1712,9 +1726,9 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => {
|
|||||||
)}
|
)}
|
||||||
{(vendor == VENDOR_ELEVENLABS ||
|
{(vendor == VENDOR_ELEVENLABS ||
|
||||||
vendor == VENDOR_WHISPER ||
|
vendor == VENDOR_WHISPER ||
|
||||||
vendor === VENDOR_CARTESIA ||
|
|
||||||
vendor === VENDOR_PLAYHT ||
|
vendor === VENDOR_PLAYHT ||
|
||||||
vendor == VENDOR_RIMELABS) &&
|
vendor == VENDOR_RIMELABS ||
|
||||||
|
(ttsCheck && vendor === VENDOR_CARTESIA)) &&
|
||||||
ttsModels.length > 0 && (
|
ttsModels.length > 0 && (
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<label htmlFor={`${vendor}_tts_model_id`}>
|
<label htmlFor={`${vendor}_tts_model_id`}>
|
||||||
@@ -1731,11 +1745,13 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => {
|
|||||||
/>
|
/>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
)}
|
)}
|
||||||
{(vendor == VENDOR_OPENAI || vendor === VENDOR_DEEPGRAM) &&
|
{(vendor == VENDOR_OPENAI ||
|
||||||
|
vendor === VENDOR_DEEPGRAM ||
|
||||||
|
(sttCheck && vendor === VENDOR_CARTESIA)) &&
|
||||||
sttModels.length > 0 && (
|
sttModels.length > 0 && (
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<label htmlFor={`${vendor}_stt_model_id`}>
|
<label htmlFor={`${vendor}_stt_model_id`}>
|
||||||
{getModelLabelByVendor(vendor)}
|
{getSTTModelLabelByVendor(vendor)}
|
||||||
</label>
|
</label>
|
||||||
<Selector
|
<Selector
|
||||||
id={"stt_model_id"}
|
id={"stt_model_id"}
|
||||||
|
|||||||
Reference in New Issue
Block a user