UNPKG

@juspay/neurolink

Version:

The pipe layer of an AI nervous system: one interface connecting provider neurons to your application, across three inference types — generate, stream and decide. `decide` returns typed, calibrated judgements from a non-generative model (~400ms, ~$0.00002

42 lines (41 loc) • 1.39 kB
/** * OpenAI Whisper Speech-to-Text Handler * * Implementation of STT using OpenAI's Whisper model. * * @module voice/providers/OpenAISTT */ import type { TTSAudioFormat, STTHandler, STTLanguage, STTOptions, STTResult } from "../../types/index.js"; /** * OpenAI Whisper Speech-to-Text Handler * * Supports transcription and translation using OpenAI's Whisper model. * * @see https://platform.openai.com/docs/api-reference/audio */ export declare class OpenAISTT implements STTHandler { private readonly apiKey; private readonly baseUrl; /** * Maximum audio duration in seconds (25 minutes) */ readonly maxAudioDuration: number; /** * Whisper does not support streaming */ readonly supportsStreaming = false; constructor(apiKey?: string); isConfigured(): boolean; getSupportedFormats(): TTSAudioFormat[]; getSupportedLanguages(): Promise<STTLanguage[]>; transcribe(audio: Buffer | ArrayBuffer, options?: STTOptions): Promise<STTResult>; /** * Get MIME type for audio format. Whisper auto-detects from headers, but * sending a correct MIME helps providers / proxies that sniff Content-Type. * Must stay aligned with `getSupportedFormats()`. */ private getMimeType; } export { OpenAISTT as WhisperSTT }; export { OpenAISTT as WhisperSTTHandler }; export { OpenAISTT as OpenAISTTHandler };