import { n as OpenAIRealtimeModel } from "./models-D-Wcs-FO.mjs"; import { t as OpenAiRegion } from "./region-DNmR5OQo.mjs"; import { Effect, Redacted, Scope } from "effect"; import * as AiError from "@effect-uai/core/AiError"; import { RealtimeSessionHandle } from "@effect-uai/core/RealtimeSession"; import * as Socket from "effect/socket/Socket"; import { CommonSessionRequest } from "@effect-uai/core/Realtime"; //#region src/realtimeSession.d.ts /** `baseUrl` plus `headers` are what make a compatible gateway reachable. */ type Config = { readonly apiKey: Redacted.Redacted; readonly baseUrl?: string; readonly region?: OpenAiRegion; readonly headers?: Record; /** * 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"]; }; /** * OpenAI-typed session request. Everything past `CommonSessionRequest` is * provider-shaped and has no equivalent on other providers. */ type OpenAIRealtimeRequest = Omit & { readonly model: OpenAIRealtimeModel; /** Replaces the plain `turnDetection` switch when you need the knobs. */ readonly turnDetectionConfig?: { readonly type: "server_vad"; readonly threshold?: number; readonly prefixPaddingMs?: number; readonly silenceDurationMs?: number; readonly idleTimeoutMs?: number; readonly createResponse?: boolean; readonly interruptResponse?: boolean; } | { readonly type: "semantic_vad"; readonly eagerness?: "low" | "medium" | "high" | "auto"; readonly createResponse?: boolean; readonly interruptResponse?: boolean; }; readonly noiseReduction?: "near_field" | "far_field"; readonly truncation?: "auto" | "disabled" | { readonly type: "retention_ratio"; readonly retentionRatio: number; }; readonly reasoningEffort?: "minimal" | "low" | "medium" | "high" | "xhigh"; readonly maxOutputTokens?: number | "inf"; readonly speed?: number; /** `"text"` turns the session into a text-only responder. One or the other. */ readonly outputModalities?: "audio" | "text"; readonly transcriptionModel?: string; }; /** * `resume` is a Gemini handle. The typed request omits it, so this only ever * fires for a caller coming through the generic tag, where it would otherwise * be cast away and a session the caller believes it resumed starts blank. */ declare const refuseResume: (request: CommonSessionRequest) => Effect.Effect; /** A query already on `baseUrl`, such as a gateway's API version, is kept. */ declare const buildWsUrl: (cfg: Config, model: string) => string; declare const openSession: (cfg: Config) => (request: OpenAIRealtimeRequest) => Effect.Effect; //#endregion export { refuseResume as a, openSession as i, OpenAIRealtimeRequest as n, buildWsUrl as r, Config as t }; //# sourceMappingURL=realtimeSession-tmd1KX2I.d.mts.map