Join us May 13th & May 14th at Interrupt, the Agent Conference by LangChain. Buy tickets >
TypeScript
使用 LangChain JavaScript 与 Jsonlines 文件 - 文档加载器进行集成。
{"html": "This is a sentence."} {"html": "This is another sentence."}
import { JSONLinesLoader } from "@langchain/classic/document_loaders/fs/json"; const loader = new JSONLinesLoader( "src/document_loaders/example_data/example.jsonl", "/html" ); const docs = await loader.load(); /* [ Document { "metadata": { "blobType": "application/jsonl+json", "line": 1, "source": "blob", }, "pageContent": "This is a sentence.", }, Document { "metadata": { "blobType": "application/jsonl+json", "line": 2, "source": "blob", }, "pageContent": "This is another sentence.", }, ] */