/** * Optional speech-to-text for inbound Telegram audio (voice / audio / video_note). * The transcriber posts the downloaded bytes to an OpenAI-compatible * `/v1/audio/transcriptions` endpoint (e.g. a local WhisperKit server) and * returns the transcript text, which the download path then inlines into the * attachment's `text` field so a caption-less voice note reaches the model as * words, not just an on-disk file path. */ /** Transcription endpoint + model settings (the full transcriptions-route URL, not a base). */ export interface TelegramTranscriptionConfig { /** Full URL of the OpenAI-compatible transcriptions route (e.g. `http://localhost:50060/v1/audio/transcriptions`). */ readonly endpoint: string; /** Model name sent as the multipart `model` part (required by the server). */ readonly model: string; /** Optional ISO-639 language hint sent as the `language` part. */ readonly language?: string; /** * Bound for one transcription call in milliseconds (default 120s, enforced * by the download path). Independent of `attachments.downloadTimeoutMs`: * download latency scales with file size, transcription latency with audio * duration. */ readonly timeoutMs?: number; } /** A pluggable transcriber. The download path passes a per-call abort signal. */ export interface TelegramTranscriber { transcribe(input: { bytes: Uint8Array; mimeType: string; filename?: string; }, signal: AbortSignal): Promise; } type FetchImpl = typeof fetch; /** * Build a {@link TelegramTranscriber} that POSTs `multipart/form-data` (parts * `file`, `model`, and optional `language`) to an OpenAI-compatible * transcriptions endpoint and reads back `{ text }`. Uses only native `fetch` + * `FormData` + `Blob` (no added dependencies). A non-2xx response, or a body * without a non-empty `text` string, throws so the caller can fall back. */ export declare function createOpenAiTranscriber(config: TelegramTranscriptionConfig, fetchImpl?: FetchImpl): TelegramTranscriber; export {}; //# sourceMappingURL=transcription.d.ts.map