Skip to main content

Documentation Index

Fetch the complete documentation index at: https://langchain-5e9cc07a-preview-mdrxyo-1777658790-7be347c.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

CompatibilityOnly available on Node.js.
This covers how to load document objects from an audio file using the Open AI Whisper API.

Setup

To run this loader you will need to create an account on the Open AI and obtain an auth key from the https://platform.openai.com/account page.

Usage

Once auth key is configured, you can use the loader to create transcriptions and then convert them into a Document.
import { OpenAIWhisperAudio } from "@langchain/community/document_loaders/fs/openai_whisper_audio";

const filePath = "./src/document_loaders/example_data/test.mp3";

const loader = new OpenAIWhisperAudio(filePath, {
  transcriptionCreateParams: {
    language: "en",
  },
});

const docs = await loader.load();

console.log(docs);