Skip to main content

Documentation Index

Fetch the complete documentation index at: https://langchain-5e9cc07a-preview-mdrxyo-1777658790-7be347c.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

This example goes over how to load conversations.json from your ChatGPT data export folder. You can get your data export by email by going to: ChatGPT -> (Profile) - Settings -> Export data -> Confirm export -> Check email.

Usage, extracting all logs

Example code:
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);

Usage, extracting a single log

Example code:
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);