跳到主要内容

ChatGPT 文件

本示例介绍如何从您的 ChatGPT 数据导出文件夹加载 conversations.json 文件。您可以通过电子邮件获取数据导出,方法是:ChatGPT ->(个人资料)- 设置 -> 导出数据 -> 确认导出 -> 检查电子邮件。

用法,提取所有日志

示例代码

import { ChatGPTLoader } from "@langchain/community/document_loaders/fs/chatgpt";

const loader = new ChatGPTLoader("./example_data/example_conversations.json");

const docs = await loader.load();

console.log(docs);

用法,提取单个日志

示例代码

import { ChatGPTLoader } from "@langchain/community/document_loaders/fs/chatgpt";

const loader = new ChatGPTLoader(
"./example_data/example_conversations.json",
1
);

const docs = await loader.load();

console.log(docs);

此页对您有帮助吗?


您也可以留下详细的反馈 在 GitHub 上.

© . This site is unofficial and not affiliated with LangChain, Inc.
这些文档随着 LangChain v1.0 在 2025 年 10 月的发布而弃用,并且不再维护。 请访问 v1.0 文档