Open AI Whisper 音频
¥Open AI Whisper Audio
Compatibility
仅在 Node.js 上可用。
¥Only available on Node.js.
本概述如何使用 Open AI Whisper API 从音频文件加载文档对象。
¥This covers how to load document objects from an audio file using the Open AI Whisper API.
设置
¥Setup
要运行此加载器,你需要在 Open AI 上创建一个账户,并从 https://platform.openai.com/account 页面获取授权密钥。
¥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);
API Reference:
- OpenAIWhisperAudio from
@langchain/community/document_loaders/fs/openai_whisper_audio