Documentation Index
Fetch the complete documentation index at: https://langchain-zh.cn/llms.txt
Use this file to discover all available pages before exploring further.
本示例将介绍如何从 Figma 文件中加载数据。
你需要一个 Figma 访问令牌才能开始。
import { FigmaFileLoader } from "@langchain/community/document_loaders/web/figma";
const loader = new FigmaFileLoader({
accessToken: "FIGMA_ACCESS_TOKEN", // 或从 process.env.FIGMA_ACCESS_TOKEN 加载
nodeIds: ["id1", "id2", "id3"],
fileKey: "key",
});
const docs = await loader.load();
console.log({ docs });
你可以在浏览器中打开 Figma 文件,并从 URL 中提取文件密钥和节点 ID:
https://www.figma.com/file/<你的文件密钥>/LangChainJS-Test?type=whiteboard&node-id=<你的节点ID>&t=e6lqWkKecuYQRyRg-0