import { t as OpenAiRegion } from "./region-DNmR5OQo.mjs"; import { Effect, Redacted, Schema, Stream } from "effect"; import * as AiError from "@effect-uai/core/AiError"; import * as Socket from "effect/socket/Socket"; import { CommonStreamTranscribeRequest } from "@effect-uai/core/Transcriber"; import { TranscriptEvent } from "@effect-uai/core/Transcript"; //#region src/realtimeStt.d.ts type Config = { readonly apiKey: Redacted.Redacted; readonly baseUrl?: string; readonly region?: OpenAiRegion; /** * Build the socket yourself, for a proxy or an in-memory transport. The * default attaches the bearer token through the `ws` package. */ readonly webSocket?: Socket.WebSocketConstructor["Service"]; }; declare const ServerEvent: Schema.Union; }>, Schema.Struct<{ readonly type: Schema.Literal<"session.updated">; }>, Schema.Struct<{ readonly type: Schema.Literal<"conversation.item.input_audio_transcription.delta">; readonly delta: Schema.String; }>, Schema.Struct<{ readonly type: Schema.Literal<"conversation.item.input_audio_transcription.completed">; readonly transcript: Schema.String; }>, Schema.Struct<{ readonly type: Schema.Literal<"input_audio_buffer.speech_started">; readonly audio_start_ms: Schema.optional; }>, Schema.Struct<{ readonly type: Schema.Literal<"input_audio_buffer.speech_stopped">; readonly audio_end_ms: Schema.optional; }>, Schema.Struct<{ readonly type: Schema.Literal<"error">; readonly error: Schema.Struct<{ readonly type: Schema.optional; readonly code: Schema.optional>; readonly message: Schema.String; }>; }>]>; declare const wireToEvent: (msg: typeof ServerEvent.Type) => TranscriptEvent | undefined; /** One raw text frame to at most one event; unknown or malformed frames yield `undefined`. */ declare const frameToEvent: (raw: string) => Effect.Effect; declare const streamTranscription: (cfg: Config) => (audioIn: Stream.Stream, request: CommonStreamTranscribeRequest) => Stream.Stream; //#endregion export { Config, frameToEvent, streamTranscription, wireToEvent }; //# sourceMappingURL=realtimeStt.d.mts.map