Figma
此示例介绍如何从 Figma 文件加载数据。您需要一个 Figma 访问令牌才能开始。
import { FigmaFileLoader } from "@langchain/community/document_loaders/web/figma";
const loader = new FigmaFileLoader({
accessToken: "FIGMA_ACCESS_TOKEN", // or load it from process.env.FIGMA_ACCESS_TOKEN
nodeIds: ["id1", "id2", "id3"],
fileKey: "key",
});
const docs = await loader.load();
console.log({ docs });
API 参考
- FigmaFileLoader 来自
@langchain/community/document_loaders/web/figma
您可以在浏览器中打开文件并从 URL 中提取它们,找到 Figma 文件的键和节点 ID。
https://www.figma.com/file/<YOUR FILE KEY HERE>/LangChainJS-Test?type=whiteboard&node-id=<YOUR NODE ID HERE>&t=e6lqWkKecuYQRyRg-0