langchain_community.document_loaders.parsers.audio
.OpenAIWhisperParser¶
- class langchain_community.document_loaders.parsers.audio.OpenAIWhisperParser(api_key: Optional[str] = None, *, chunk_duration_threshold: float = 0.1)[source]¶
Transcribe and parse audio files.
Audio transcription is with OpenAI Whisper model.
- Parameters
api_key (Optional[str]) – OpenAI API key
chunk_duration_threshold (float) – minimum duration of a chunk in seconds NOTE: According to the OpenAI API, the chunk duration should be at least 0.1 seconds. If the chunk duration is less or equal than the threshold, it will be skipped.
Methods
__init__
([api_key, chunk_duration_threshold])lazy_parse
(blob)Lazily parse the blob.
parse
(blob)Eagerly parse the blob into a document or documents.
- __init__(api_key: Optional[str] = None, *, chunk_duration_threshold: float = 0.1)[source]¶
- Parameters
api_key (Optional[str]) –
chunk_duration_threshold (float) –