import { a as OpenAIVoiceId, i as OpenAITtsModel } from "./models-D-Wcs-FO.mjs"; import { t as OpenAiRegion } from "./region-DNmR5OQo.mjs"; import { Context, Effect, Layer, Redacted, Stream } from "effect"; import { HttpClient } from "effect/http"; import * as AiError from "@effect-uai/core/AiError"; import { CommonStreamSynthesizeRequest, CommonSynthesizeRequest, SpeechSynthesizer, SpeechSynthesizerService } from "@effect-uai/core/SpeechSynthesizer"; import { AudioBlob, AudioChunk } from "@effect-uai/core/Audio"; declare namespace OpenAISynthesizer_d_exports { export { Config, OpenAISynthesizeRequest, OpenAISynthesizer, OpenAISynthesizerService, layer, make }; } /** * OpenAI-typed synthesize request. `model` narrows to `OpenAITtsModel`; * `voiceId` narrows to the stock-only `OpenAIVoiceId` union (no * `(string & {})` escape — OpenAI has no custom-voice path). * * `instructions` is honoured only by `gpt-4o-mini-tts`; it's silently * ignored on `tts-1` / `tts-1-hd`. */ type OpenAISynthesizeRequest = Omit & { readonly model: OpenAITtsModel; readonly voiceId: OpenAIVoiceId; readonly instructions?: string; }; type OpenAISynthesizerService = { readonly synthesize: (request: OpenAISynthesizeRequest) => Effect.Effect; readonly streamSynthesis: (request: OpenAISynthesizeRequest) => Stream.Stream; readonly streamSynthesisFrom: (textIn: Stream.Stream, request: CommonStreamSynthesizeRequest) => Stream.Stream; readonly synthesizeDialogue: SpeechSynthesizerService["synthesizeDialogue"]; readonly streamSynthesizeDialogue: SpeechSynthesizerService["streamSynthesizeDialogue"]; }; declare const OpenAISynthesizer_base: Context.ServiceClass; declare class OpenAISynthesizer extends OpenAISynthesizer_base {} type Config = { readonly apiKey: Redacted.Redacted; readonly baseUrl?: string; readonly region?: OpenAiRegion; }; declare const make: (cfg: Config) => Effect.Effect; /** * Layer that registers both `OpenAISynthesizer` and the generic * `SpeechSynthesizer` tag. * * Does NOT register the `TtsIncrementalText` capability marker — * OpenAI has no incremental-text-in TTS at the wire level. Code calling * `SpeechSynthesizer.streamSynthesisFrom` will fail to typecheck * against this Layer alone, which is the intended UX. */ declare const layer: (cfg: Config) => Layer.Layer; //#endregion export { Config, OpenAISynthesizeRequest, OpenAISynthesizer, OpenAISynthesizerService, layer, make, OpenAISynthesizer_d_exports as t }; //# sourceMappingURL=OpenAISynthesizer.d.mts.map