From 8fabfde8a453bb5895a9e289bd787efc8aa4458d Mon Sep 17 00:00:00 2001 From: jacoblee93 Date: Thu, 30 Nov 2023 15:27:54 -0800 Subject: [PATCH 1/2] Add missing entrypoint --- docs/api_refs/typedoc.json | 1 + environment_tests/test-exports-bun/src/entrypoints.js | 1 + environment_tests/test-exports-cf/src/entrypoints.js | 1 + environment_tests/test-exports-cjs/src/entrypoints.js | 1 + .../test-exports-esbuild/src/entrypoints.js | 1 + environment_tests/test-exports-esm/src/entrypoints.js | 1 + .../test-exports-vercel/src/entrypoints.js | 1 + .../test-exports-vite/src/entrypoints.js | 1 + langchain/.gitignore | 6 +++--- langchain/package.json | 11 ++++++++--- langchain/scripts/create-entrypoints.js | 1 + langchain/src/load/import_map.ts | 1 + 12 files changed, 21 insertions(+), 6 deletions(-) diff --git a/docs/api_refs/typedoc.json b/docs/api_refs/typedoc.json index d38c21326e44..7ff44c31fe65 100644 --- a/docs/api_refs/typedoc.json +++ b/docs/api_refs/typedoc.json @@ -165,6 +165,7 @@ "./langchain/src/document_loaders/web/youtube.ts", "./langchain/src/document_loaders/fs/directory.ts", "./langchain/src/document_loaders/fs/buffer.ts", + "./langchain/src/document_loaders/fs/chatgpt.ts", "./langchain/src/document_loaders/fs/text.ts", "./langchain/src/document_loaders/fs/json.ts", "./langchain/src/document_loaders/fs/srt.ts", diff --git a/environment_tests/test-exports-bun/src/entrypoints.js b/environment_tests/test-exports-bun/src/entrypoints.js index 61b2f0553453..382e30f931c0 100644 --- a/environment_tests/test-exports-bun/src/entrypoints.js +++ b/environment_tests/test-exports-bun/src/entrypoints.js @@ -46,6 +46,7 @@ export * from "langchain/document_loaders/base"; export * from "langchain/document_loaders/web/searchapi"; export * from "langchain/document_loaders/web/serpapi"; export * from "langchain/document_loaders/web/sort_xyz_blockchain"; +export * from "langchain/document_loaders/fs/chatgpt"; export * from "langchain/document_transformers/openai_functions"; export * from "langchain/chat_models/base"; export * from "langchain/chat_models/openai"; diff --git a/environment_tests/test-exports-cf/src/entrypoints.js b/environment_tests/test-exports-cf/src/entrypoints.js index 61b2f0553453..382e30f931c0 100644 --- a/environment_tests/test-exports-cf/src/entrypoints.js +++ b/environment_tests/test-exports-cf/src/entrypoints.js @@ -46,6 +46,7 @@ export * from "langchain/document_loaders/base"; export * from "langchain/document_loaders/web/searchapi"; export * from "langchain/document_loaders/web/serpapi"; export * from "langchain/document_loaders/web/sort_xyz_blockchain"; +export * from "langchain/document_loaders/fs/chatgpt"; export * from "langchain/document_transformers/openai_functions"; export * from "langchain/chat_models/base"; export * from "langchain/chat_models/openai"; diff --git a/environment_tests/test-exports-cjs/src/entrypoints.js b/environment_tests/test-exports-cjs/src/entrypoints.js index 725b9cd0477c..6d65af164f27 100644 --- a/environment_tests/test-exports-cjs/src/entrypoints.js +++ b/environment_tests/test-exports-cjs/src/entrypoints.js @@ -46,6 +46,7 @@ const document_loaders_base = require("langchain/document_loaders/base"); const document_loaders_web_searchapi = require("langchain/document_loaders/web/searchapi"); const document_loaders_web_serpapi = require("langchain/document_loaders/web/serpapi"); const document_loaders_web_sort_xyz_blockchain = require("langchain/document_loaders/web/sort_xyz_blockchain"); +const document_loaders_fs_chatgpt = require("langchain/document_loaders/fs/chatgpt"); const document_transformers_openai_functions = require("langchain/document_transformers/openai_functions"); const chat_models_base = require("langchain/chat_models/base"); const chat_models_openai = require("langchain/chat_models/openai"); diff --git a/environment_tests/test-exports-esbuild/src/entrypoints.js b/environment_tests/test-exports-esbuild/src/entrypoints.js index 9c4a916789c5..24c9ef06c9aa 100644 --- a/environment_tests/test-exports-esbuild/src/entrypoints.js +++ b/environment_tests/test-exports-esbuild/src/entrypoints.js @@ -46,6 +46,7 @@ import * as document_loaders_base from "langchain/document_loaders/base"; import * as document_loaders_web_searchapi from "langchain/document_loaders/web/searchapi"; import * as document_loaders_web_serpapi from "langchain/document_loaders/web/serpapi"; import * as document_loaders_web_sort_xyz_blockchain from "langchain/document_loaders/web/sort_xyz_blockchain"; +import * as document_loaders_fs_chatgpt from "langchain/document_loaders/fs/chatgpt"; import * as document_transformers_openai_functions from "langchain/document_transformers/openai_functions"; import * as chat_models_base from "langchain/chat_models/base"; import * as chat_models_openai from "langchain/chat_models/openai"; diff --git a/environment_tests/test-exports-esm/src/entrypoints.js b/environment_tests/test-exports-esm/src/entrypoints.js index 9c4a916789c5..24c9ef06c9aa 100644 --- a/environment_tests/test-exports-esm/src/entrypoints.js +++ b/environment_tests/test-exports-esm/src/entrypoints.js @@ -46,6 +46,7 @@ import * as document_loaders_base from "langchain/document_loaders/base"; import * as document_loaders_web_searchapi from "langchain/document_loaders/web/searchapi"; import * as document_loaders_web_serpapi from "langchain/document_loaders/web/serpapi"; import * as document_loaders_web_sort_xyz_blockchain from "langchain/document_loaders/web/sort_xyz_blockchain"; +import * as document_loaders_fs_chatgpt from "langchain/document_loaders/fs/chatgpt"; import * as document_transformers_openai_functions from "langchain/document_transformers/openai_functions"; import * as chat_models_base from "langchain/chat_models/base"; import * as chat_models_openai from "langchain/chat_models/openai"; diff --git a/environment_tests/test-exports-vercel/src/entrypoints.js b/environment_tests/test-exports-vercel/src/entrypoints.js index 61b2f0553453..382e30f931c0 100644 --- a/environment_tests/test-exports-vercel/src/entrypoints.js +++ b/environment_tests/test-exports-vercel/src/entrypoints.js @@ -46,6 +46,7 @@ export * from "langchain/document_loaders/base"; export * from "langchain/document_loaders/web/searchapi"; export * from "langchain/document_loaders/web/serpapi"; export * from "langchain/document_loaders/web/sort_xyz_blockchain"; +export * from "langchain/document_loaders/fs/chatgpt"; export * from "langchain/document_transformers/openai_functions"; export * from "langchain/chat_models/base"; export * from "langchain/chat_models/openai"; diff --git a/environment_tests/test-exports-vite/src/entrypoints.js b/environment_tests/test-exports-vite/src/entrypoints.js index 61b2f0553453..382e30f931c0 100644 --- a/environment_tests/test-exports-vite/src/entrypoints.js +++ b/environment_tests/test-exports-vite/src/entrypoints.js @@ -46,6 +46,7 @@ export * from "langchain/document_loaders/base"; export * from "langchain/document_loaders/web/searchapi"; export * from "langchain/document_loaders/web/serpapi"; export * from "langchain/document_loaders/web/sort_xyz_blockchain"; +export * from "langchain/document_loaders/fs/chatgpt"; export * from "langchain/document_transformers/openai_functions"; export * from "langchain/chat_models/base"; export * from "langchain/chat_models/openai"; diff --git a/langchain/.gitignore b/langchain/.gitignore index 456353930f6a..886cf43390bd 100644 --- a/langchain/.gitignore +++ b/langchain/.gitignore @@ -439,6 +439,9 @@ document_loaders/fs/directory.d.ts document_loaders/fs/buffer.cjs document_loaders/fs/buffer.js document_loaders/fs/buffer.d.ts +document_loaders/fs/chatgpt.cjs +document_loaders/fs/chatgpt.js +document_loaders/fs/chatgpt.d.ts document_loaders/fs/text.cjs document_loaders/fs/text.js document_loaders/fs/text.d.ts @@ -472,9 +475,6 @@ document_loaders/fs/openai_whisper_audio.d.ts document_loaders/fs/pptx.cjs document_loaders/fs/pptx.js document_loaders/fs/pptx.d.ts -document_loaders/fs/chatgpt.cjs -document_loaders/fs/chatgpt.js -document_loaders/fs/chatgpt.d.ts document_transformers/html_to_text.cjs document_transformers/html_to_text.js document_transformers/html_to_text.d.ts diff --git a/langchain/package.json b/langchain/package.json index c6fea4ffb0ef..29a988433e79 100644 --- a/langchain/package.json +++ b/langchain/package.json @@ -451,6 +451,9 @@ "document_loaders/fs/buffer.cjs", "document_loaders/fs/buffer.js", "document_loaders/fs/buffer.d.ts", + "document_loaders/fs/chatgpt.cjs", + "document_loaders/fs/chatgpt.js", + "document_loaders/fs/chatgpt.d.ts", "document_loaders/fs/text.cjs", "document_loaders/fs/text.js", "document_loaders/fs/text.d.ts", @@ -484,9 +487,6 @@ "document_loaders/fs/pptx.cjs", "document_loaders/fs/pptx.js", "document_loaders/fs/pptx.d.ts", - "document_loaders/fs/chatgpt.cjs", - "document_loaders/fs/chatgpt.js", - "document_loaders/fs/chatgpt.d.ts", "document_transformers/html_to_text.cjs", "document_transformers/html_to_text.js", "document_transformers/html_to_text.d.ts", @@ -2188,6 +2188,11 @@ "import": "./document_loaders/fs/buffer.js", "require": "./document_loaders/fs/buffer.cjs" }, + "./document_loaders/fs/chatgpt": { + "types": "./document_loaders/fs/chatgpt.d.ts", + "import": "./document_loaders/fs/chatgpt.js", + "require": "./document_loaders/fs/chatgpt.cjs" + }, "./document_loaders/fs/text": { "types": "./document_loaders/fs/text.d.ts", "import": "./document_loaders/fs/text.js", diff --git a/langchain/scripts/create-entrypoints.js b/langchain/scripts/create-entrypoints.js index fbf5dd1e92bb..cb7ae075aae3 100644 --- a/langchain/scripts/create-entrypoints.js +++ b/langchain/scripts/create-entrypoints.js @@ -172,6 +172,7 @@ const entrypoints = { "document_loaders/web/youtube": "document_loaders/web/youtube", "document_loaders/fs/directory": "document_loaders/fs/directory", "document_loaders/fs/buffer": "document_loaders/fs/buffer", + "document_loaders/fs/chatgpt": "document_loaders/fs/chatgpt", "document_loaders/fs/text": "document_loaders/fs/text", "document_loaders/fs/json": "document_loaders/fs/json", "document_loaders/fs/srt": "document_loaders/fs/srt", diff --git a/langchain/src/load/import_map.ts b/langchain/src/load/import_map.ts index a1d511062784..66ccfb46477c 100644 --- a/langchain/src/load/import_map.ts +++ b/langchain/src/load/import_map.ts @@ -47,6 +47,7 @@ export * as document_loaders__base from "../document_loaders/base.js"; export * as document_loaders__web__searchapi from "../document_loaders/web/searchapi.js"; export * as document_loaders__web__serpapi from "../document_loaders/web/serpapi.js"; export * as document_loaders__web__sort_xyz_blockchain from "../document_loaders/web/sort_xyz_blockchain.js"; +export * as document_loaders__fs__chatgpt from "../document_loaders/fs/chatgpt.js"; export * as document_transformers__openai_functions from "../document_transformers/openai_functions.js"; export * as chat_models__base from "../chat_models/base.js"; export * as chat_models__openai from "../chat_models/openai.js"; From a32ccb794a9f43938e2d906c5bfa0047205a3045 Mon Sep 17 00:00:00 2001 From: jacoblee93 Date: Thu, 30 Nov 2023 15:40:59 -0800 Subject: [PATCH 2/2] Mark as optional --- environment_tests/test-exports-bun/src/entrypoints.js | 1 - environment_tests/test-exports-cf/src/entrypoints.js | 1 - environment_tests/test-exports-cjs/src/entrypoints.js | 1 - environment_tests/test-exports-esbuild/src/entrypoints.js | 1 - environment_tests/test-exports-esm/src/entrypoints.js | 1 - environment_tests/test-exports-vercel/src/entrypoints.js | 1 - environment_tests/test-exports-vite/src/entrypoints.js | 1 - langchain/scripts/create-entrypoints.js | 1 + langchain/src/load/import_constants.ts | 1 + langchain/src/load/import_map.ts | 1 - langchain/src/load/import_type.d.ts | 3 +++ 11 files changed, 5 insertions(+), 8 deletions(-) diff --git a/environment_tests/test-exports-bun/src/entrypoints.js b/environment_tests/test-exports-bun/src/entrypoints.js index 382e30f931c0..61b2f0553453 100644 --- a/environment_tests/test-exports-bun/src/entrypoints.js +++ b/environment_tests/test-exports-bun/src/entrypoints.js @@ -46,7 +46,6 @@ export * from "langchain/document_loaders/base"; export * from "langchain/document_loaders/web/searchapi"; export * from "langchain/document_loaders/web/serpapi"; export * from "langchain/document_loaders/web/sort_xyz_blockchain"; -export * from "langchain/document_loaders/fs/chatgpt"; export * from "langchain/document_transformers/openai_functions"; export * from "langchain/chat_models/base"; export * from "langchain/chat_models/openai"; diff --git a/environment_tests/test-exports-cf/src/entrypoints.js b/environment_tests/test-exports-cf/src/entrypoints.js index 382e30f931c0..61b2f0553453 100644 --- a/environment_tests/test-exports-cf/src/entrypoints.js +++ b/environment_tests/test-exports-cf/src/entrypoints.js @@ -46,7 +46,6 @@ export * from "langchain/document_loaders/base"; export * from "langchain/document_loaders/web/searchapi"; export * from "langchain/document_loaders/web/serpapi"; export * from "langchain/document_loaders/web/sort_xyz_blockchain"; -export * from "langchain/document_loaders/fs/chatgpt"; export * from "langchain/document_transformers/openai_functions"; export * from "langchain/chat_models/base"; export * from "langchain/chat_models/openai"; diff --git a/environment_tests/test-exports-cjs/src/entrypoints.js b/environment_tests/test-exports-cjs/src/entrypoints.js index 6d65af164f27..725b9cd0477c 100644 --- a/environment_tests/test-exports-cjs/src/entrypoints.js +++ b/environment_tests/test-exports-cjs/src/entrypoints.js @@ -46,7 +46,6 @@ const document_loaders_base = require("langchain/document_loaders/base"); const document_loaders_web_searchapi = require("langchain/document_loaders/web/searchapi"); const document_loaders_web_serpapi = require("langchain/document_loaders/web/serpapi"); const document_loaders_web_sort_xyz_blockchain = require("langchain/document_loaders/web/sort_xyz_blockchain"); -const document_loaders_fs_chatgpt = require("langchain/document_loaders/fs/chatgpt"); const document_transformers_openai_functions = require("langchain/document_transformers/openai_functions"); const chat_models_base = require("langchain/chat_models/base"); const chat_models_openai = require("langchain/chat_models/openai"); diff --git a/environment_tests/test-exports-esbuild/src/entrypoints.js b/environment_tests/test-exports-esbuild/src/entrypoints.js index 24c9ef06c9aa..9c4a916789c5 100644 --- a/environment_tests/test-exports-esbuild/src/entrypoints.js +++ b/environment_tests/test-exports-esbuild/src/entrypoints.js @@ -46,7 +46,6 @@ import * as document_loaders_base from "langchain/document_loaders/base"; import * as document_loaders_web_searchapi from "langchain/document_loaders/web/searchapi"; import * as document_loaders_web_serpapi from "langchain/document_loaders/web/serpapi"; import * as document_loaders_web_sort_xyz_blockchain from "langchain/document_loaders/web/sort_xyz_blockchain"; -import * as document_loaders_fs_chatgpt from "langchain/document_loaders/fs/chatgpt"; import * as document_transformers_openai_functions from "langchain/document_transformers/openai_functions"; import * as chat_models_base from "langchain/chat_models/base"; import * as chat_models_openai from "langchain/chat_models/openai"; diff --git a/environment_tests/test-exports-esm/src/entrypoints.js b/environment_tests/test-exports-esm/src/entrypoints.js index 24c9ef06c9aa..9c4a916789c5 100644 --- a/environment_tests/test-exports-esm/src/entrypoints.js +++ b/environment_tests/test-exports-esm/src/entrypoints.js @@ -46,7 +46,6 @@ import * as document_loaders_base from "langchain/document_loaders/base"; import * as document_loaders_web_searchapi from "langchain/document_loaders/web/searchapi"; import * as document_loaders_web_serpapi from "langchain/document_loaders/web/serpapi"; import * as document_loaders_web_sort_xyz_blockchain from "langchain/document_loaders/web/sort_xyz_blockchain"; -import * as document_loaders_fs_chatgpt from "langchain/document_loaders/fs/chatgpt"; import * as document_transformers_openai_functions from "langchain/document_transformers/openai_functions"; import * as chat_models_base from "langchain/chat_models/base"; import * as chat_models_openai from "langchain/chat_models/openai"; diff --git a/environment_tests/test-exports-vercel/src/entrypoints.js b/environment_tests/test-exports-vercel/src/entrypoints.js index 382e30f931c0..61b2f0553453 100644 --- a/environment_tests/test-exports-vercel/src/entrypoints.js +++ b/environment_tests/test-exports-vercel/src/entrypoints.js @@ -46,7 +46,6 @@ export * from "langchain/document_loaders/base"; export * from "langchain/document_loaders/web/searchapi"; export * from "langchain/document_loaders/web/serpapi"; export * from "langchain/document_loaders/web/sort_xyz_blockchain"; -export * from "langchain/document_loaders/fs/chatgpt"; export * from "langchain/document_transformers/openai_functions"; export * from "langchain/chat_models/base"; export * from "langchain/chat_models/openai"; diff --git a/environment_tests/test-exports-vite/src/entrypoints.js b/environment_tests/test-exports-vite/src/entrypoints.js index 382e30f931c0..61b2f0553453 100644 --- a/environment_tests/test-exports-vite/src/entrypoints.js +++ b/environment_tests/test-exports-vite/src/entrypoints.js @@ -46,7 +46,6 @@ export * from "langchain/document_loaders/base"; export * from "langchain/document_loaders/web/searchapi"; export * from "langchain/document_loaders/web/serpapi"; export * from "langchain/document_loaders/web/sort_xyz_blockchain"; -export * from "langchain/document_loaders/fs/chatgpt"; export * from "langchain/document_transformers/openai_functions"; export * from "langchain/chat_models/base"; export * from "langchain/chat_models/openai"; diff --git a/langchain/scripts/create-entrypoints.js b/langchain/scripts/create-entrypoints.js index cb7ae075aae3..446eaac7856b 100644 --- a/langchain/scripts/create-entrypoints.js +++ b/langchain/scripts/create-entrypoints.js @@ -440,6 +440,7 @@ const requiresOptionalDependency = [ "document_loaders/web/youtube", "document_loaders/fs/directory", "document_loaders/fs/buffer", + "document_loaders/fs/chatgpt", "document_loaders/fs/text", "document_loaders/fs/json", "document_loaders/fs/srt", diff --git a/langchain/src/load/import_constants.ts b/langchain/src/load/import_constants.ts index 08fcbd39d5d2..a7d4a74ee1f8 100644 --- a/langchain/src/load/import_constants.ts +++ b/langchain/src/load/import_constants.ts @@ -100,6 +100,7 @@ export const optionalImportEntrypoints = [ "langchain/document_loaders/web/youtube", "langchain/document_loaders/fs/directory", "langchain/document_loaders/fs/buffer", + "langchain/document_loaders/fs/chatgpt", "langchain/document_loaders/fs/text", "langchain/document_loaders/fs/json", "langchain/document_loaders/fs/srt", diff --git a/langchain/src/load/import_map.ts b/langchain/src/load/import_map.ts index 66ccfb46477c..a1d511062784 100644 --- a/langchain/src/load/import_map.ts +++ b/langchain/src/load/import_map.ts @@ -47,7 +47,6 @@ export * as document_loaders__base from "../document_loaders/base.js"; export * as document_loaders__web__searchapi from "../document_loaders/web/searchapi.js"; export * as document_loaders__web__serpapi from "../document_loaders/web/serpapi.js"; export * as document_loaders__web__sort_xyz_blockchain from "../document_loaders/web/sort_xyz_blockchain.js"; -export * as document_loaders__fs__chatgpt from "../document_loaders/fs/chatgpt.js"; export * as document_transformers__openai_functions from "../document_transformers/openai_functions.js"; export * as chat_models__base from "../chat_models/base.js"; export * as chat_models__openai from "../chat_models/openai.js"; diff --git a/langchain/src/load/import_type.d.ts b/langchain/src/load/import_type.d.ts index a6190f9f01eb..00fb99f9d953 100644 --- a/langchain/src/load/import_type.d.ts +++ b/langchain/src/load/import_type.d.ts @@ -298,6 +298,9 @@ export interface OptionalImportMap { "langchain/document_loaders/fs/buffer"?: | typeof import("../document_loaders/fs/buffer.js") | Promise; + "langchain/document_loaders/fs/chatgpt"?: + | typeof import("../document_loaders/fs/chatgpt.js") + | Promise; "langchain/document_loaders/fs/text"?: | typeof import("../document_loaders/fs/text.js") | Promise;