diff --git a/apps/api/src/stt/batch-assemblyai.ts b/apps/api/src/stt/assemblyai/batch.ts similarity index 98% rename from apps/api/src/stt/batch-assemblyai.ts rename to apps/api/src/stt/assemblyai/batch.ts index e02515c811..ed3dfcaeb5 100644 --- a/apps/api/src/stt/batch-assemblyai.ts +++ b/apps/api/src/stt/assemblyai/batch.ts @@ -1,4 +1,4 @@ -import { env } from "../env"; +import { env } from "../../env"; import type { BatchAlternatives, BatchChannel, @@ -6,7 +6,7 @@ import type { BatchResponse, BatchResults, BatchWord, -} from "./batch-types"; +} from "../batch-types"; const ASSEMBLYAI_API_URL = "https://api.assemblyai.com/v2"; const POLL_INTERVAL_MS = 3000; diff --git a/apps/api/src/stt/assemblyai/index.ts b/apps/api/src/stt/assemblyai/index.ts new file mode 100644 index 0000000000..32079ce98f --- /dev/null +++ b/apps/api/src/stt/assemblyai/index.ts @@ -0,0 +1,2 @@ +export { buildAssemblyAIUrl, createAssemblyAIProxy } from "./live"; +export { transcribeWithAssemblyAI } from "./batch"; diff --git a/apps/api/src/stt/assemblyai.ts b/apps/api/src/stt/assemblyai/live.ts similarity index 89% rename from apps/api/src/stt/assemblyai.ts rename to apps/api/src/stt/assemblyai/live.ts index bee1d851c6..2fe3b7b5a8 100644 --- a/apps/api/src/stt/assemblyai.ts +++ b/apps/api/src/stt/assemblyai/live.ts @@ -1,5 +1,5 @@ -import { env } from "../env"; -import { WsProxyConnection } from "./connection"; +import { env } from "../../env"; +import { WsProxyConnection } from "../connection"; const CONTROL_MESSAGE_TYPES = new Set(["Terminate"]); diff --git a/apps/api/src/stt/batch-deepgram.ts b/apps/api/src/stt/deepgram/batch.ts similarity index 93% rename from apps/api/src/stt/batch-deepgram.ts rename to apps/api/src/stt/deepgram/batch.ts index d3464fe12e..1042a2a0b0 100644 --- a/apps/api/src/stt/batch-deepgram.ts +++ b/apps/api/src/stt/deepgram/batch.ts @@ -1,5 +1,5 @@ -import { env } from "../env"; -import type { BatchParams, BatchResponse } from "./batch-types"; +import { env } from "../../env"; +import type { BatchParams, BatchResponse } from "../batch-types"; const DEEPGRAM_BATCH_URL = "https://api.deepgram.com/v1/listen"; diff --git a/apps/api/src/stt/deepgram/index.ts b/apps/api/src/stt/deepgram/index.ts new file mode 100644 index 0000000000..ca4b7bbe9c --- /dev/null +++ b/apps/api/src/stt/deepgram/index.ts @@ -0,0 +1,2 @@ +export { buildDeepgramUrl, createDeepgramProxy } from "./live"; +export { transcribeWithDeepgram } from "./batch"; diff --git a/apps/api/src/stt/deepgram.ts b/apps/api/src/stt/deepgram/live.ts similarity index 90% rename from apps/api/src/stt/deepgram.ts rename to apps/api/src/stt/deepgram/live.ts index 0b7adcdd0e..3e280b04f4 100644 --- a/apps/api/src/stt/deepgram.ts +++ b/apps/api/src/stt/deepgram/live.ts @@ -1,5 +1,5 @@ -import { env } from "../env"; -import { WsProxyConnection } from "./connection"; +import { env } from "../../env"; +import { WsProxyConnection } from "../connection"; const CONTROL_MESSAGE_TYPES = new Set(["KeepAlive", "CloseStream", "Finalize"]); diff --git a/apps/api/src/stt/index.ts b/apps/api/src/stt/index.ts index c30e3fc09f..e77c269494 100644 --- a/apps/api/src/stt/index.ts +++ b/apps/api/src/stt/index.ts @@ -1,21 +1,27 @@ -import { createAssemblyAIProxy } from "./assemblyai"; -import { transcribeWithAssemblyAI } from "./batch-assemblyai"; -import { transcribeWithDeepgram } from "./batch-deepgram"; -import { transcribeWithSoniox } from "./batch-soniox"; +import { createAssemblyAIProxy, transcribeWithAssemblyAI } from "./assemblyai"; import type { BatchParams, BatchProvider, BatchResponse } from "./batch-types"; import { WsProxyConnection } from "./connection"; -import { createDeepgramProxy } from "./deepgram"; -import { createSonioxProxy } from "./soniox"; +import { createDeepgramProxy, transcribeWithDeepgram } from "./deepgram"; +import { createSonioxProxy, transcribeWithSoniox } from "./soniox"; export { WsProxyConnection, type WsProxyOptions } from "./connection"; export { normalizeWsData, type WsPayload } from "./utils"; -export { buildDeepgramUrl, createDeepgramProxy } from "./deepgram"; -export { buildAssemblyAIUrl, createAssemblyAIProxy } from "./assemblyai"; -export { buildSonioxUrl, createSonioxProxy } from "./soniox"; +export { + buildDeepgramUrl, + createDeepgramProxy, + transcribeWithDeepgram, +} from "./deepgram"; +export { + buildAssemblyAIUrl, + createAssemblyAIProxy, + transcribeWithAssemblyAI, +} from "./assemblyai"; +export { + buildSonioxUrl, + createSonioxProxy, + transcribeWithSoniox, +} from "./soniox"; export type { BatchParams, BatchProvider, BatchResponse } from "./batch-types"; -export { transcribeWithDeepgram } from "./batch-deepgram"; -export { transcribeWithAssemblyAI } from "./batch-assemblyai"; -export { transcribeWithSoniox } from "./batch-soniox"; export const UPSTREAM_URL_HEADER = "x-owh-upstream-url"; export const UPSTREAM_AUTH_HEADER = "x-owh-upstream-auth"; diff --git a/apps/api/src/stt/batch-soniox.ts b/apps/api/src/stt/soniox/batch.ts similarity index 98% rename from apps/api/src/stt/batch-soniox.ts rename to apps/api/src/stt/soniox/batch.ts index 611f629b63..df73f80a16 100644 --- a/apps/api/src/stt/batch-soniox.ts +++ b/apps/api/src/stt/soniox/batch.ts @@ -1,4 +1,4 @@ -import { env } from "../env"; +import { env } from "../../env"; import type { BatchAlternatives, BatchChannel, @@ -6,7 +6,7 @@ import type { BatchResponse, BatchResults, BatchWord, -} from "./batch-types"; +} from "../batch-types"; const SONIOX_API_HOST = "api.soniox.com"; const POLL_INTERVAL_MS = 3000; diff --git a/apps/api/src/stt/soniox/index.ts b/apps/api/src/stt/soniox/index.ts new file mode 100644 index 0000000000..ce931b6d1f --- /dev/null +++ b/apps/api/src/stt/soniox/index.ts @@ -0,0 +1,2 @@ +export { buildSonioxUrl, createSonioxProxy } from "./live"; +export { transcribeWithSoniox } from "./batch"; diff --git a/apps/api/src/stt/soniox.ts b/apps/api/src/stt/soniox/live.ts similarity index 90% rename from apps/api/src/stt/soniox.ts rename to apps/api/src/stt/soniox/live.ts index 14162deeaf..2fce7ebd46 100644 --- a/apps/api/src/stt/soniox.ts +++ b/apps/api/src/stt/soniox/live.ts @@ -1,5 +1,5 @@ -import { env } from "../env"; -import { WsProxyConnection } from "./connection"; +import { env } from "../../env"; +import { WsProxyConnection } from "../connection"; const CONTROL_MESSAGE_TYPES = new Set(["keepalive", "finalize"]);