跳转到内容

文档与节点

DocumentNode是LlamaIndexTS中数据的基本构建块。虽然这些对象的API相似,但Document对象代表整个文件,而Node则是原始文档中适合LLM和问答的较小片段。

import { Document } from "llamaindex";
document = new Document({ text: "text", metadata: { key: "val" } });