mirror of
https://github.com/jambonz/jambonz-webapp.git
synced 2025-12-19 05:37:43 +00:00
support gladia stt (#572)
This commit is contained in:
@@ -56,6 +56,7 @@ import {
|
||||
VENDOR_DEEPGRAM_FLUX,
|
||||
VENDOR_RESEMBLE,
|
||||
VENDOR_HOUNDIFY,
|
||||
VENDOR_GLADIA,
|
||||
} from "src/vendor";
|
||||
import { MSG_REQUIRED_FIELDS } from "src/constants";
|
||||
import {
|
||||
@@ -510,6 +511,10 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => {
|
||||
resemble_tts_uri: resembleTtsUri || null,
|
||||
resemble_tts_use_tls: resembleTtsUseTls ? 1 : 0,
|
||||
}),
|
||||
...(vendor === VENDOR_GLADIA && {
|
||||
api_key: apiKey || null,
|
||||
region: region || null,
|
||||
}),
|
||||
};
|
||||
|
||||
if (credential && credential.data) {
|
||||
@@ -561,7 +566,8 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => {
|
||||
vendor === VENDOR_CARTESIA ||
|
||||
vendor === VENDOR_OPENAI ||
|
||||
vendor === VENDOR_RESEMBLE ||
|
||||
vendor === VENDOR_DEEPGRAM_FLUX
|
||||
vendor === VENDOR_DEEPGRAM_FLUX ||
|
||||
vendor === VENDOR_GLADIA
|
||||
? apiKey
|
||||
: null,
|
||||
}),
|
||||
@@ -1040,6 +1046,7 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => {
|
||||
vendor !== VENDOR_DEEPGRAM_FLUX &&
|
||||
vendor !== VENDOR_HOUNDIFY &&
|
||||
vendor !== VENDOR_OPENAI &&
|
||||
vendor !== VENDOR_GLADIA &&
|
||||
vendor != VENDOR_CUSTOM && (
|
||||
<label htmlFor="use_for_tts" className="chk">
|
||||
<input
|
||||
@@ -1929,7 +1936,8 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => {
|
||||
vendor === VENDOR_OPENAI ||
|
||||
vendor === VENDOR_DEEPGRAM_FLUX ||
|
||||
vendor === VENDOR_RESEMBLE ||
|
||||
vendor === VENDOR_SPEECHMATICS) && (
|
||||
vendor === VENDOR_SPEECHMATICS ||
|
||||
vendor === VENDOR_GLADIA) && (
|
||||
<fieldset>
|
||||
<label htmlFor={`${vendor}_apikey`}>
|
||||
API key<span>*</span>
|
||||
|
||||
8
src/vendor/index.tsx
vendored
8
src/vendor/index.tsx
vendored
@@ -31,6 +31,7 @@ export const VENDOR_CARTESIA = "cartesia";
|
||||
export const VENDOR_OPENAI = "openai";
|
||||
export const VENDOR_RESEMBLE = "resemble";
|
||||
export const VENDOR_HOUNDIFY = "houndify";
|
||||
export const VENDOR_GLADIA = "gladia";
|
||||
|
||||
export const vendors: VendorOptions[] = [
|
||||
{
|
||||
@@ -133,6 +134,10 @@ export const vendors: VendorOptions[] = [
|
||||
name: "SoundHound",
|
||||
value: VENDOR_HOUNDIFY,
|
||||
},
|
||||
{
|
||||
name: "Gladia",
|
||||
value: VENDOR_GLADIA,
|
||||
},
|
||||
].sort((a, b) => a.name.localeCompare(b.name)) as VendorOptions[];
|
||||
|
||||
export const AWS_CREDENTIAL_ACCESS_KEY = "access_key";
|
||||
@@ -165,12 +170,14 @@ export const useRegionVendors = () => {
|
||||
import("./regions/ms-azure-regions"),
|
||||
import("./regions/ibm-regions"),
|
||||
import("./regions/speechmatics-regions"),
|
||||
import("./regions/gladia-regions"),
|
||||
]).then(
|
||||
([
|
||||
{ default: awsRegions },
|
||||
{ default: msRegions },
|
||||
{ default: ibmRegions },
|
||||
{ default: speechmaticsRegions },
|
||||
{ default: gladiaRegions },
|
||||
]) => {
|
||||
if (!ignore) {
|
||||
setRegions({
|
||||
@@ -178,6 +185,7 @@ export const useRegionVendors = () => {
|
||||
microsoft: msRegions,
|
||||
ibm: ibmRegions,
|
||||
speechmatics: speechmaticsRegions,
|
||||
gladia: gladiaRegions,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
14
src/vendor/regions/gladia-regions.ts
vendored
Normal file
14
src/vendor/regions/gladia-regions.ts
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import type { Region } from "../types";
|
||||
|
||||
export const regions: Region[] = [
|
||||
{
|
||||
name: "US West",
|
||||
value: "us-west",
|
||||
},
|
||||
{
|
||||
name: "EU West",
|
||||
value: "eu-west",
|
||||
},
|
||||
];
|
||||
|
||||
export default regions;
|
||||
4
src/vendor/types.ts
vendored
4
src/vendor/types.ts
vendored
@@ -23,7 +23,8 @@ export type Vendor =
|
||||
| "openai"
|
||||
| "Cartesia"
|
||||
| "Resemble"
|
||||
| "Houndify";
|
||||
| "Houndify"
|
||||
| "gladia";
|
||||
|
||||
export interface VendorOptions {
|
||||
name: Vendor;
|
||||
@@ -85,6 +86,7 @@ export interface RegionVendors {
|
||||
microsoft: Region[];
|
||||
ibm: Region[];
|
||||
speechmatics: Region[];
|
||||
gladia: Region[];
|
||||
}
|
||||
|
||||
export interface TtsModels {
|
||||
|
||||
Reference in New Issue
Block a user