support gladia stt (#572)

This commit is contained in:
Hoan Luu Huu
2025-10-20 15:47:55 +07:00
committed by GitHub
parent 6aae8d9930
commit 7a0eb71bae
4 changed files with 35 additions and 3 deletions

View File

@@ -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>

View File

@@ -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
View 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
View File

@@ -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 {