From d73f13545d152075991d4e8efe583038bbd142ec Mon Sep 17 00:00:00 2001 From: Brace Sproul Date: Tue, 12 Dec 2023 14:48:59 -0800 Subject: [PATCH] api_refs[major]: Remove script, use custom typedoc plugin (#3630) * api_refs[major]: Remove script, use custom typedoc plugin * cr * cr * rm typedoc dep * force no cache * cr * cr * add custom build:vercel scripts * cr * cr --- docs/api_refs/package.json | 3 +- docs/api_refs/scripts/generate-api-refs.js | 104 ---- docs/api_refs/typedoc.json | 565 +++++++++--------- .../typedoc_plugins/hide_underscore_lc.js | 70 +++ docs/core_docs/package.json | 2 + langchain/scripts/create-entrypoints.js | 2 +- turbo.json | 9 +- 7 files changed, 367 insertions(+), 388 deletions(-) delete mode 100644 docs/api_refs/scripts/generate-api-refs.js create mode 100644 docs/api_refs/typedoc_plugins/hide_underscore_lc.js diff --git a/docs/api_refs/package.json b/docs/api_refs/package.json index b87b7c3a010f..f8f883b22695 100644 --- a/docs/api_refs/package.json +++ b/docs/api_refs/package.json @@ -5,8 +5,9 @@ "scripts": { "dev": "next dev -p 3001", "typedoc": "npx typedoc --options typedoc.json", - "build:scripts": "node ./scripts/generate-api-refs.js && node ./scripts/update-typedoc-css.js", + "build:scripts": "yarn typedoc && node ./scripts/update-typedoc-css.js", "build": "yarn run build:deps && yarn build:scripts && next build", + "build:vercel": "yarn run build:deps --force && yarn build:scripts && next build", "build:deps": "yarn run turbo:command build --filter=@langchain/core --filter=@langchain/anthropic --filter=@langchain/openai --filter=@langchain/community --filter=langchain --concurrency=1", "start": "yarn build && next start -p 3001", "lint": "next lint" diff --git a/docs/api_refs/scripts/generate-api-refs.js b/docs/api_refs/scripts/generate-api-refs.js deleted file mode 100644 index 2532c01ee05b..000000000000 --- a/docs/api_refs/scripts/generate-api-refs.js +++ /dev/null @@ -1,104 +0,0 @@ -const { Project, SyntaxKind } = require("ts-morph"); -const { exec } = require("child_process"); - -async function updateCodeWithIgnoreTags(tsConfigFilePath) { - const project = new Project({ - tsConfigFilePath, - }); - const sourceFiles = project.getSourceFiles(); - /** - * @type {Array>} - */ - let changes = []; - - const syntaxTypes = [ - SyntaxKind.MethodDeclaration, - SyntaxKind.PropertyDeclaration, - SyntaxKind.GetAccessor, - SyntaxKind.SetAccessor, - SyntaxKind.MethodSignature, - SyntaxKind.PropertySignature, - ]; - - sourceFiles.forEach((sourceFile) => { - sourceFile.getClasses().forEach((cls) => { - // Check instance members - cls.getInstanceMembers().forEach((member) => { - checkMember(member); - }); - - // Check static members - cls.getStaticMembers().forEach((member) => { - checkMember(member); - }); - }); - }); - - function checkMember(member) { - if (syntaxTypes.includes(member.getKind())) { - const name = member.getName(); - if (name.startsWith("_") || name.startsWith("lc_")) { - const jsDocs = member.getJsDocs(); - const hasIgnoreTag = jsDocs.some((jsDoc) => - jsDoc.getTags().some((tag) => tag.getTagName() === "ignore") - ); - if (!hasIgnoreTag) { - const jsDocText = `/** @ignore */\n `; - const start = member.getStart(); - changes.push({ - sourceFile: member.getSourceFile(), - start, - jsDocText, - }); - } - } - } - } - - // Sort changes in reverse order by start position so updating - // the source file doesn't mess up the start position of the next change - changes.sort((a, b) => b.start - a.start); - // Apply changes after iterating over the AST - changes.forEach(({ sourceFile, start, jsDocText }) => { - sourceFile.insertText(start, jsDocText); - }); - - await project.save(); -} - -async function copyLangChain(pathToLangChain) { - try { - await execAsync(`rm -rf ./langchain`); - } catch (_) { - // no-op - } - await execAsync(`cp -r ${pathToLangChain} ./langchain`); - return { - rootPath: `${process.cwd()}/langchain`, - tsConfigPath: `${process.cwd()}/langchain/tsconfig.json`, - }; -} - -async function deleteLangChain(pathToLangChain) { - // delete the langchain dir - await execAsync(`rm -rf ${pathToLangChain}`); -} - -const execAsync = async (command, options) => new Promise((resolve, reject) => { - exec(command, options, (err, stdout, stderr) => { - if (err) { - reject(err); - } else { - resolve(stdout); - } - }); -}); - -async function main() { - const pathToLangChain = "../../langchain"; - const { rootPath, tsConfigPath } = await copyLangChain(pathToLangChain); - await updateCodeWithIgnoreTags(tsConfigPath); - await execAsync("yarn typedoc"); - await deleteLangChain(rootPath); -} -main(); diff --git a/docs/api_refs/typedoc.json b/docs/api_refs/typedoc.json index 378c86f4d173..8fa89bf172a8 100644 --- a/docs/api_refs/typedoc.json +++ b/docs/api_refs/typedoc.json @@ -8,7 +8,10 @@ "required-first", "alphabetical" ], - "tsconfig": "./langchain/tsconfig.json", + "plugin": [ + "./typedoc_plugins/hide_underscore_lc.js" + ], + "tsconfig": "../../langchain/tsconfig.json", "readme": "none", "excludePrivate": true, "excludeInternal": true, @@ -18,285 +21,285 @@ "sourceLinkTemplate": "https://github.com/langchain-ai/langchainjs/blob/{gitRevision}/{path}#L{line}", "logLevel": "Error", "entryPoints": [ - "./langchain/src/load/index.ts", - "./langchain/src/load/serializable.ts", - "./langchain/src/agents/index.ts", - "./langchain/src/agents/load.ts", - "./langchain/src/agents/toolkits/index.ts", - "./langchain/src/agents/toolkits/aws_sfn.ts", - "./langchain/src/agents/toolkits/connery/index.ts", - "./langchain/src/agents/toolkits/sql/index.ts", - "./langchain/src/agents/format_scratchpad/openai_functions.ts", - "./langchain/src/agents/format_scratchpad/openai_tools.ts", - "./langchain/src/agents/format_scratchpad/log.ts", - "./langchain/src/agents/format_scratchpad/xml.ts", - "./langchain/src/agents/format_scratchpad/log_to_message.ts", - "./langchain/src/agents/react/output_parser.ts", - "./langchain/src/agents/xml/output_parser.ts", - "./langchain/src/agents/openai/output_parser.ts", - "./langchain/src/base_language/index.ts", - "./langchain/src/tools/index.ts", - "./langchain/src/tools/aws_lambda.ts", - "./langchain/src/tools/aws_sfn.ts", - "./langchain/src/tools/calculator.ts", - "./langchain/src/tools/connery.ts", - "./langchain/src/tools/render.ts", - "./langchain/src/tools/sql.ts", - "./langchain/src/tools/webbrowser.ts", - "./langchain/src/tools/gmail/index.ts", - "./langchain/src/tools/google_calendar/index.ts", - "./langchain/src/tools/google_places.ts", - "./langchain/src/chains/index.ts", - "./langchain/src/chains/combine_documents/reduce.ts", - "./langchain/src/chains/load.ts", - "./langchain/src/chains/openai_functions/index.ts", - "./langchain/src/chains/query_constructor/index.ts", - "./langchain/src/chains/query_constructor/ir.ts", - "./langchain/src/chains/sql_db/index.ts", - "./langchain/src/chains/graph_qa/cypher.ts", - "./langchain/src/embeddings/base.ts", - "./langchain/src/embeddings/bedrock.ts", - "./langchain/src/embeddings/cache_backed.ts", - "./langchain/src/embeddings/cloudflare_workersai.ts", - "./langchain/src/embeddings/fake.ts", - "./langchain/src/embeddings/ollama.ts", - "./langchain/src/embeddings/openai.ts", - "./langchain/src/embeddings/cohere.ts", - "./langchain/src/embeddings/tensorflow.ts", - "./langchain/src/embeddings/hf.ts", - "./langchain/src/embeddings/hf_transformers.ts", - "./langchain/src/embeddings/googlevertexai.ts", - "./langchain/src/embeddings/googlepalm.ts", - "./langchain/src/embeddings/minimax.ts", - "./langchain/src/embeddings/voyage.ts", - "./langchain/src/embeddings/llama_cpp.ts", - "./langchain/src/embeddings/gradient_ai.ts", - "./langchain/src/llms/load.ts", - "./langchain/src/llms/base.ts", - "./langchain/src/llms/openai.ts", - "./langchain/src/llms/ai21.ts", - "./langchain/src/llms/aleph_alpha.ts", - "./langchain/src/llms/cloudflare_workersai.ts", - "./langchain/src/llms/cohere.ts", - "./langchain/src/llms/hf.ts", - "./langchain/src/llms/raycast.ts", - "./langchain/src/llms/ollama.ts", - "./langchain/src/llms/replicate.ts", - "./langchain/src/llms/fireworks.ts", - "./langchain/src/llms/googlevertexai/index.ts", - "./langchain/src/llms/googlevertexai/web.ts", - "./langchain/src/llms/googlepalm.ts", - "./langchain/src/llms/gradient_ai.ts", - "./langchain/src/llms/sagemaker_endpoint.ts", - "./langchain/src/llms/watsonx_ai.ts", - "./langchain/src/llms/bedrock/index.ts", - "./langchain/src/llms/bedrock/web.ts", - "./langchain/src/llms/llama_cpp.ts", - "./langchain/src/llms/writer.ts", - "./langchain/src/llms/portkey.ts", - "./langchain/src/llms/yandex.ts", - "./langchain/src/llms/fake.ts", - "./langchain/src/prompts/index.ts", - "./langchain/src/prompts/load.ts", - "./langchain/src/vectorstores/clickhouse.ts", - "./langchain/src/vectorstores/analyticdb.ts", - "./langchain/src/vectorstores/base.ts", - "./langchain/src/vectorstores/cassandra.ts", - "./langchain/src/vectorstores/convex.ts", - "./langchain/src/vectorstores/elasticsearch.ts", - "./langchain/src/vectorstores/memory.ts", - "./langchain/src/vectorstores/cloudflare_vectorize.ts", - "./langchain/src/vectorstores/closevector/web.ts", - "./langchain/src/vectorstores/closevector/node.ts", - "./langchain/src/vectorstores/chroma.ts", - "./langchain/src/vectorstores/googlevertexai.ts", - "./langchain/src/vectorstores/hnswlib.ts", - "./langchain/src/vectorstores/faiss.ts", - "./langchain/src/vectorstores/weaviate.ts", - "./langchain/src/vectorstores/lancedb.ts", - "./langchain/src/vectorstores/momento_vector_index.ts", - "./langchain/src/vectorstores/mongo.ts", - "./langchain/src/vectorstores/mongodb_atlas.ts", - "./langchain/src/vectorstores/pinecone.ts", - "./langchain/src/vectorstores/qdrant.ts", - "./langchain/src/vectorstores/supabase.ts", - "./langchain/src/vectorstores/opensearch.ts", - "./langchain/src/vectorstores/pgvector.ts", - "./langchain/src/vectorstores/milvus.ts", - "./langchain/src/vectorstores/neo4j_vector.ts", - "./langchain/src/vectorstores/prisma.ts", - "./langchain/src/vectorstores/typeorm.ts", - "./langchain/src/vectorstores/myscale.ts", - "./langchain/src/vectorstores/redis.ts", - "./langchain/src/vectorstores/rockset.ts", - "./langchain/src/vectorstores/typesense.ts", - "./langchain/src/vectorstores/singlestore.ts", - "./langchain/src/vectorstores/tigris.ts", - "./langchain/src/vectorstores/usearch.ts", - "./langchain/src/vectorstores/vectara.ts", - "./langchain/src/vectorstores/vercel_postgres.ts", - "./langchain/src/vectorstores/voy.ts", - "./langchain/src/vectorstores/xata.ts", - "./langchain/src/vectorstores/zep.ts", - "./langchain/src/text_splitter.ts", - "./langchain/src/memory/index.ts", - "./langchain/src/memory/zep.ts", - "./langchain/src/document.ts", - "./langchain/src/document_loaders/base.ts", - "./langchain/src/document_loaders/web/apify_dataset.ts", - "./langchain/src/document_loaders/web/assemblyai.ts", - "./langchain/src/document_loaders/web/azure_blob_storage_container.ts", - "./langchain/src/document_loaders/web/azure_blob_storage_file.ts", - "./langchain/src/document_loaders/web/cheerio.ts", - "./langchain/src/document_loaders/web/puppeteer.ts", - "./langchain/src/document_loaders/web/playwright.ts", - "./langchain/src/document_loaders/web/college_confidential.ts", - "./langchain/src/document_loaders/web/gitbook.ts", - "./langchain/src/document_loaders/web/hn.ts", - "./langchain/src/document_loaders/web/imsdb.ts", - "./langchain/src/document_loaders/web/figma.ts", - "./langchain/src/document_loaders/web/github.ts", - "./langchain/src/document_loaders/web/notiondb.ts", - "./langchain/src/document_loaders/web/notionapi.ts", - "./langchain/src/document_loaders/web/pdf.ts", - "./langchain/src/document_loaders/web/recursive_url.ts", - "./langchain/src/document_loaders/web/s3.ts", - "./langchain/src/document_loaders/web/sonix_audio.ts", - "./langchain/src/document_loaders/web/confluence.ts", - "./langchain/src/document_loaders/web/searchapi.ts", - "./langchain/src/document_loaders/web/serpapi.ts", - "./langchain/src/document_loaders/web/sort_xyz_blockchain.ts", - "./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", - "./langchain/src/document_loaders/fs/pdf.ts", - "./langchain/src/document_loaders/fs/docx.ts", - "./langchain/src/document_loaders/fs/epub.ts", - "./langchain/src/document_loaders/fs/csv.ts", - "./langchain/src/document_loaders/fs/notion.ts", - "./langchain/src/document_loaders/fs/obsidian.ts", - "./langchain/src/document_loaders/fs/unstructured.ts", - "./langchain/src/document_loaders/fs/openai_whisper_audio.ts", - "./langchain/src/document_loaders/fs/pptx.ts", - "./langchain/src/document_transformers/html_to_text.ts", - "./langchain/src/document_transformers/mozilla_readability.ts", - "./langchain/src/document_transformers/openai_functions.ts", - "./langchain/src/chat_models/base.ts", - "./langchain/src/chat_models/openai.ts", - "./langchain/src/chat_models/portkey.ts", - "./langchain/src/chat_models/anthropic.ts", - "./langchain/src/chat_models/bedrock/index.ts", - "./langchain/src/chat_models/bedrock/web.ts", - "./langchain/src/chat_models/cloudflare_workersai.ts", - "./langchain/src/chat_models/googlevertexai/index.ts", - "./langchain/src/chat_models/googlevertexai/web.ts", - "./langchain/src/chat_models/googlepalm.ts", - "./langchain/src/chat_models/fireworks.ts", - "./langchain/src/chat_models/baiduwenxin.ts", - "./langchain/src/chat_models/iflytek_xinghuo/index.ts", - "./langchain/src/chat_models/iflytek_xinghuo/web.ts", - "./langchain/src/chat_models/ollama.ts", - "./langchain/src/chat_models/minimax.ts", - "./langchain/src/chat_models/llama_cpp.ts", - "./langchain/src/chat_models/yandex.ts", - "./langchain/src/chat_models/fake.ts", - "./langchain/src/schema/index.ts", - "./langchain/src/schema/document.ts", - "./langchain/src/schema/output_parser.ts", - "./langchain/src/schema/prompt_template.ts", - "./langchain/src/schema/query_constructor.ts", - "./langchain/src/schema/retriever.ts", - "./langchain/src/schema/runnable/index.ts", - "./langchain/src/schema/storage.ts", - "./langchain/src/sql_db.ts", - "./langchain/src/callbacks/index.ts", - "./langchain/src/callbacks/handlers/llmonitor.ts", - "./langchain/src/output_parsers/index.ts", - "./langchain/src/output_parsers/expression.ts", - "./langchain/src/retrievers/amazon_kendra.ts", - "./langchain/src/retrievers/remote/index.ts", - "./langchain/src/retrievers/supabase.ts", - "./langchain/src/retrievers/zep.ts", - "./langchain/src/retrievers/metal.ts", - "./langchain/src/retrievers/chaindesk.ts", - "./langchain/src/retrievers/databerry.ts", - "./langchain/src/retrievers/contextual_compression.ts", - "./langchain/src/retrievers/document_compressors/index.ts", - "./langchain/src/retrievers/multi_query.ts", - "./langchain/src/retrievers/multi_vector.ts", - "./langchain/src/retrievers/parent_document.ts", - "./langchain/src/retrievers/tavily_search_api.ts", - "./langchain/src/retrievers/time_weighted.ts", - "./langchain/src/retrievers/document_compressors/chain_extract.ts", - "./langchain/src/retrievers/document_compressors/embeddings_filter.ts", - "./langchain/src/retrievers/hyde.ts", - "./langchain/src/retrievers/score_threshold.ts", - "./langchain/src/retrievers/self_query/index.ts", - "./langchain/src/retrievers/self_query/chroma.ts", - "./langchain/src/retrievers/self_query/functional.ts", - "./langchain/src/retrievers/self_query/pinecone.ts", - "./langchain/src/retrievers/self_query/supabase.ts", - "./langchain/src/retrievers/self_query/weaviate.ts", - "./langchain/src/retrievers/self_query/vectara.ts", - "./langchain/src/retrievers/vespa.ts", - "./langchain/src/cache/index.ts", - "./langchain/src/cache/cloudflare_kv.ts", - "./langchain/src/cache/momento.ts", - "./langchain/src/cache/redis.ts", - "./langchain/src/cache/ioredis.ts", - "./langchain/src/cache/file_system.ts", - "./langchain/src/cache/upstash_redis.ts", - "./langchain/src/stores/doc/in_memory.ts", - "./langchain/src/stores/doc/gcs.ts", - "./langchain/src/stores/file/in_memory.ts", - "./langchain/src/stores/file/node.ts", - "./langchain/src/stores/message/cassandra.ts", - "./langchain/src/stores/message/convex.ts", - "./langchain/src/stores/message/cloudflare_d1.ts", - "./langchain/src/stores/message/in_memory.ts", - "./langchain/src/stores/message/dynamodb.ts", - "./langchain/src/stores/message/firestore.ts", - "./langchain/src/stores/message/momento.ts", - "./langchain/src/stores/message/mongodb.ts", - "./langchain/src/stores/message/redis.ts", - "./langchain/src/stores/message/ioredis.ts", - "./langchain/src/stores/message/upstash_redis.ts", - "./langchain/src/stores/message/planetscale.ts", - "./langchain/src/stores/message/xata.ts", - "./langchain/src/storage/convex.ts", - "./langchain/src/storage/encoder_backed.ts", - "./langchain/src/storage/in_memory.ts", - "./langchain/src/storage/ioredis.ts", - "./langchain/src/storage/vercel_kv.ts", - "./langchain/src/storage/upstash_redis.ts", - "./langchain/src/storage/file_system.ts", - "./langchain/src/graphs/neo4j_graph.ts", - "./langchain/src/hub.ts", - "./langchain/src/util/convex.ts", - "./langchain/src/util/document.ts", - "./langchain/src/util/math.ts", - "./langchain/src/util/time.ts", - "./langchain/src/experimental/autogpt/index.ts", - "./langchain/src/experimental/openai_assistant/index.ts", - "./langchain/src/experimental/openai_files/index.ts", - "./langchain/src/experimental/babyagi/index.ts", - "./langchain/src/experimental/generative_agents/index.ts", - "./langchain/src/experimental/plan_and_execute/index.ts", - "./langchain/src/experimental/multimodal_embeddings/googlevertexai.ts", - "./langchain/src/experimental/chat_models/anthropic_functions.ts", - "./langchain/src/experimental/chat_models/bittensor.ts", - "./langchain/src/experimental/chat_models/ollama_functions.ts", - "./langchain/src/experimental/llms/bittensor.ts", - "./langchain/src/experimental/hubs/makersuite/googlemakersuitehub.ts", - "./langchain/src/experimental/chains/violation_of_expectations/index.ts", - "./langchain/src/experimental/masking/index.ts", - "./langchain/src/experimental/tools/pyinterpreter.ts", - "./langchain/src/evaluation/index.ts", - "./langchain/src/runnables/index.ts", - "./langchain/src/runnables/remote.ts" + "../../langchain/src/load/index.ts", + "../../langchain/src/load/serializable.ts", + "../../langchain/src/agents/index.ts", + "../../langchain/src/agents/load.ts", + "../../langchain/src/agents/toolkits/index.ts", + "../../langchain/src/agents/toolkits/aws_sfn.ts", + "../../langchain/src/agents/toolkits/connery/index.ts", + "../../langchain/src/agents/toolkits/sql/index.ts", + "../../langchain/src/agents/format_scratchpad/openai_functions.ts", + "../../langchain/src/agents/format_scratchpad/openai_tools.ts", + "../../langchain/src/agents/format_scratchpad/log.ts", + "../../langchain/src/agents/format_scratchpad/xml.ts", + "../../langchain/src/agents/format_scratchpad/log_to_message.ts", + "../../langchain/src/agents/react/output_parser.ts", + "../../langchain/src/agents/xml/output_parser.ts", + "../../langchain/src/agents/openai/output_parser.ts", + "../../langchain/src/base_language/index.ts", + "../../langchain/src/tools/index.ts", + "../../langchain/src/tools/aws_lambda.ts", + "../../langchain/src/tools/aws_sfn.ts", + "../../langchain/src/tools/calculator.ts", + "../../langchain/src/tools/connery.ts", + "../../langchain/src/tools/render.ts", + "../../langchain/src/tools/sql.ts", + "../../langchain/src/tools/webbrowser.ts", + "../../langchain/src/tools/gmail/index.ts", + "../../langchain/src/tools/google_calendar/index.ts", + "../../langchain/src/tools/google_places.ts", + "../../langchain/src/chains/index.ts", + "../../langchain/src/chains/combine_documents/reduce.ts", + "../../langchain/src/chains/load.ts", + "../../langchain/src/chains/openai_functions/index.ts", + "../../langchain/src/chains/query_constructor/index.ts", + "../../langchain/src/chains/query_constructor/ir.ts", + "../../langchain/src/chains/sql_db/index.ts", + "../../langchain/src/chains/graph_qa/cypher.ts", + "../../langchain/src/embeddings/base.ts", + "../../langchain/src/embeddings/bedrock.ts", + "../../langchain/src/embeddings/cache_backed.ts", + "../../langchain/src/embeddings/cloudflare_workersai.ts", + "../../langchain/src/embeddings/fake.ts", + "../../langchain/src/embeddings/ollama.ts", + "../../langchain/src/embeddings/openai.ts", + "../../langchain/src/embeddings/cohere.ts", + "../../langchain/src/embeddings/tensorflow.ts", + "../../langchain/src/embeddings/hf.ts", + "../../langchain/src/embeddings/hf_transformers.ts", + "../../langchain/src/embeddings/googlevertexai.ts", + "../../langchain/src/embeddings/googlepalm.ts", + "../../langchain/src/embeddings/minimax.ts", + "../../langchain/src/embeddings/voyage.ts", + "../../langchain/src/embeddings/llama_cpp.ts", + "../../langchain/src/embeddings/gradient_ai.ts", + "../../langchain/src/llms/load.ts", + "../../langchain/src/llms/base.ts", + "../../langchain/src/llms/openai.ts", + "../../langchain/src/llms/ai21.ts", + "../../langchain/src/llms/aleph_alpha.ts", + "../../langchain/src/llms/cloudflare_workersai.ts", + "../../langchain/src/llms/cohere.ts", + "../../langchain/src/llms/hf.ts", + "../../langchain/src/llms/raycast.ts", + "../../langchain/src/llms/ollama.ts", + "../../langchain/src/llms/replicate.ts", + "../../langchain/src/llms/fireworks.ts", + "../../langchain/src/llms/googlevertexai/index.ts", + "../../langchain/src/llms/googlevertexai/web.ts", + "../../langchain/src/llms/googlepalm.ts", + "../../langchain/src/llms/gradient_ai.ts", + "../../langchain/src/llms/sagemaker_endpoint.ts", + "../../langchain/src/llms/watsonx_ai.ts", + "../../langchain/src/llms/bedrock/index.ts", + "../../langchain/src/llms/bedrock/web.ts", + "../../langchain/src/llms/llama_cpp.ts", + "../../langchain/src/llms/writer.ts", + "../../langchain/src/llms/portkey.ts", + "../../langchain/src/llms/yandex.ts", + "../../langchain/src/llms/fake.ts", + "../../langchain/src/prompts/index.ts", + "../../langchain/src/prompts/load.ts", + "../../langchain/src/vectorstores/clickhouse.ts", + "../../langchain/src/vectorstores/analyticdb.ts", + "../../langchain/src/vectorstores/base.ts", + "../../langchain/src/vectorstores/cassandra.ts", + "../../langchain/src/vectorstores/convex.ts", + "../../langchain/src/vectorstores/elasticsearch.ts", + "../../langchain/src/vectorstores/memory.ts", + "../../langchain/src/vectorstores/cloudflare_vectorize.ts", + "../../langchain/src/vectorstores/closevector/web.ts", + "../../langchain/src/vectorstores/closevector/node.ts", + "../../langchain/src/vectorstores/chroma.ts", + "../../langchain/src/vectorstores/googlevertexai.ts", + "../../langchain/src/vectorstores/hnswlib.ts", + "../../langchain/src/vectorstores/faiss.ts", + "../../langchain/src/vectorstores/weaviate.ts", + "../../langchain/src/vectorstores/lancedb.ts", + "../../langchain/src/vectorstores/momento_vector_index.ts", + "../../langchain/src/vectorstores/mongo.ts", + "../../langchain/src/vectorstores/mongodb_atlas.ts", + "../../langchain/src/vectorstores/pinecone.ts", + "../../langchain/src/vectorstores/qdrant.ts", + "../../langchain/src/vectorstores/supabase.ts", + "../../langchain/src/vectorstores/opensearch.ts", + "../../langchain/src/vectorstores/pgvector.ts", + "../../langchain/src/vectorstores/milvus.ts", + "../../langchain/src/vectorstores/neo4j_vector.ts", + "../../langchain/src/vectorstores/prisma.ts", + "../../langchain/src/vectorstores/typeorm.ts", + "../../langchain/src/vectorstores/myscale.ts", + "../../langchain/src/vectorstores/redis.ts", + "../../langchain/src/vectorstores/rockset.ts", + "../../langchain/src/vectorstores/typesense.ts", + "../../langchain/src/vectorstores/singlestore.ts", + "../../langchain/src/vectorstores/tigris.ts", + "../../langchain/src/vectorstores/usearch.ts", + "../../langchain/src/vectorstores/vectara.ts", + "../../langchain/src/vectorstores/vercel_postgres.ts", + "../../langchain/src/vectorstores/voy.ts", + "../../langchain/src/vectorstores/xata.ts", + "../../langchain/src/vectorstores/zep.ts", + "../../langchain/src/text_splitter.ts", + "../../langchain/src/memory/index.ts", + "../../langchain/src/memory/zep.ts", + "../../langchain/src/document.ts", + "../../langchain/src/document_loaders/base.ts", + "../../langchain/src/document_loaders/web/apify_dataset.ts", + "../../langchain/src/document_loaders/web/assemblyai.ts", + "../../langchain/src/document_loaders/web/azure_blob_storage_container.ts", + "../../langchain/src/document_loaders/web/azure_blob_storage_file.ts", + "../../langchain/src/document_loaders/web/cheerio.ts", + "../../langchain/src/document_loaders/web/puppeteer.ts", + "../../langchain/src/document_loaders/web/playwright.ts", + "../../langchain/src/document_loaders/web/college_confidential.ts", + "../../langchain/src/document_loaders/web/gitbook.ts", + "../../langchain/src/document_loaders/web/hn.ts", + "../../langchain/src/document_loaders/web/imsdb.ts", + "../../langchain/src/document_loaders/web/figma.ts", + "../../langchain/src/document_loaders/web/github.ts", + "../../langchain/src/document_loaders/web/notiondb.ts", + "../../langchain/src/document_loaders/web/notionapi.ts", + "../../langchain/src/document_loaders/web/pdf.ts", + "../../langchain/src/document_loaders/web/recursive_url.ts", + "../../langchain/src/document_loaders/web/s3.ts", + "../../langchain/src/document_loaders/web/sonix_audio.ts", + "../../langchain/src/document_loaders/web/confluence.ts", + "../../langchain/src/document_loaders/web/searchapi.ts", + "../../langchain/src/document_loaders/web/serpapi.ts", + "../../langchain/src/document_loaders/web/sort_xyz_blockchain.ts", + "../../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", + "../../langchain/src/document_loaders/fs/pdf.ts", + "../../langchain/src/document_loaders/fs/docx.ts", + "../../langchain/src/document_loaders/fs/epub.ts", + "../../langchain/src/document_loaders/fs/csv.ts", + "../../langchain/src/document_loaders/fs/notion.ts", + "../../langchain/src/document_loaders/fs/obsidian.ts", + "../../langchain/src/document_loaders/fs/unstructured.ts", + "../../langchain/src/document_loaders/fs/openai_whisper_audio.ts", + "../../langchain/src/document_loaders/fs/pptx.ts", + "../../langchain/src/document_transformers/html_to_text.ts", + "../../langchain/src/document_transformers/mozilla_readability.ts", + "../../langchain/src/document_transformers/openai_functions.ts", + "../../langchain/src/chat_models/base.ts", + "../../langchain/src/chat_models/openai.ts", + "../../langchain/src/chat_models/portkey.ts", + "../../langchain/src/chat_models/anthropic.ts", + "../../langchain/src/chat_models/bedrock/index.ts", + "../../langchain/src/chat_models/bedrock/web.ts", + "../../langchain/src/chat_models/cloudflare_workersai.ts", + "../../langchain/src/chat_models/googlevertexai/index.ts", + "../../langchain/src/chat_models/googlevertexai/web.ts", + "../../langchain/src/chat_models/googlepalm.ts", + "../../langchain/src/chat_models/fireworks.ts", + "../../langchain/src/chat_models/baiduwenxin.ts", + "../../langchain/src/chat_models/iflytek_xinghuo/index.ts", + "../../langchain/src/chat_models/iflytek_xinghuo/web.ts", + "../../langchain/src/chat_models/ollama.ts", + "../../langchain/src/chat_models/minimax.ts", + "../../langchain/src/chat_models/llama_cpp.ts", + "../../langchain/src/chat_models/yandex.ts", + "../../langchain/src/chat_models/fake.ts", + "../../langchain/src/schema/index.ts", + "../../langchain/src/schema/document.ts", + "../../langchain/src/schema/output_parser.ts", + "../../langchain/src/schema/prompt_template.ts", + "../../langchain/src/schema/query_constructor.ts", + "../../langchain/src/schema/retriever.ts", + "../../langchain/src/schema/runnable/index.ts", + "../../langchain/src/schema/storage.ts", + "../../langchain/src/sql_db.ts", + "../../langchain/src/callbacks/index.ts", + "../../langchain/src/callbacks/handlers/llmonitor.ts", + "../../langchain/src/output_parsers/index.ts", + "../../langchain/src/output_parsers/expression.ts", + "../../langchain/src/retrievers/amazon_kendra.ts", + "../../langchain/src/retrievers/remote/index.ts", + "../../langchain/src/retrievers/supabase.ts", + "../../langchain/src/retrievers/zep.ts", + "../../langchain/src/retrievers/metal.ts", + "../../langchain/src/retrievers/chaindesk.ts", + "../../langchain/src/retrievers/databerry.ts", + "../../langchain/src/retrievers/contextual_compression.ts", + "../../langchain/src/retrievers/document_compressors/index.ts", + "../../langchain/src/retrievers/multi_query.ts", + "../../langchain/src/retrievers/multi_vector.ts", + "../../langchain/src/retrievers/parent_document.ts", + "../../langchain/src/retrievers/tavily_search_api.ts", + "../../langchain/src/retrievers/time_weighted.ts", + "../../langchain/src/retrievers/document_compressors/chain_extract.ts", + "../../langchain/src/retrievers/document_compressors/embeddings_filter.ts", + "../../langchain/src/retrievers/hyde.ts", + "../../langchain/src/retrievers/score_threshold.ts", + "../../langchain/src/retrievers/self_query/index.ts", + "../../langchain/src/retrievers/self_query/chroma.ts", + "../../langchain/src/retrievers/self_query/functional.ts", + "../../langchain/src/retrievers/self_query/pinecone.ts", + "../../langchain/src/retrievers/self_query/supabase.ts", + "../../langchain/src/retrievers/self_query/weaviate.ts", + "../../langchain/src/retrievers/self_query/vectara.ts", + "../../langchain/src/retrievers/vespa.ts", + "../../langchain/src/cache/index.ts", + "../../langchain/src/cache/cloudflare_kv.ts", + "../../langchain/src/cache/momento.ts", + "../../langchain/src/cache/redis.ts", + "../../langchain/src/cache/ioredis.ts", + "../../langchain/src/cache/file_system.ts", + "../../langchain/src/cache/upstash_redis.ts", + "../../langchain/src/stores/doc/in_memory.ts", + "../../langchain/src/stores/doc/gcs.ts", + "../../langchain/src/stores/file/in_memory.ts", + "../../langchain/src/stores/file/node.ts", + "../../langchain/src/stores/message/cassandra.ts", + "../../langchain/src/stores/message/convex.ts", + "../../langchain/src/stores/message/cloudflare_d1.ts", + "../../langchain/src/stores/message/in_memory.ts", + "../../langchain/src/stores/message/dynamodb.ts", + "../../langchain/src/stores/message/firestore.ts", + "../../langchain/src/stores/message/momento.ts", + "../../langchain/src/stores/message/mongodb.ts", + "../../langchain/src/stores/message/redis.ts", + "../../langchain/src/stores/message/ioredis.ts", + "../../langchain/src/stores/message/upstash_redis.ts", + "../../langchain/src/stores/message/planetscale.ts", + "../../langchain/src/stores/message/xata.ts", + "../../langchain/src/storage/convex.ts", + "../../langchain/src/storage/encoder_backed.ts", + "../../langchain/src/storage/in_memory.ts", + "../../langchain/src/storage/ioredis.ts", + "../../langchain/src/storage/vercel_kv.ts", + "../../langchain/src/storage/upstash_redis.ts", + "../../langchain/src/storage/file_system.ts", + "../../langchain/src/graphs/neo4j_graph.ts", + "../../langchain/src/hub.ts", + "../../langchain/src/util/convex.ts", + "../../langchain/src/util/document.ts", + "../../langchain/src/util/math.ts", + "../../langchain/src/util/time.ts", + "../../langchain/src/experimental/autogpt/index.ts", + "../../langchain/src/experimental/openai_assistant/index.ts", + "../../langchain/src/experimental/openai_files/index.ts", + "../../langchain/src/experimental/babyagi/index.ts", + "../../langchain/src/experimental/generative_agents/index.ts", + "../../langchain/src/experimental/plan_and_execute/index.ts", + "../../langchain/src/experimental/multimodal_embeddings/googlevertexai.ts", + "../../langchain/src/experimental/chat_models/anthropic_functions.ts", + "../../langchain/src/experimental/chat_models/bittensor.ts", + "../../langchain/src/experimental/chat_models/ollama_functions.ts", + "../../langchain/src/experimental/llms/bittensor.ts", + "../../langchain/src/experimental/hubs/makersuite/googlemakersuitehub.ts", + "../../langchain/src/experimental/chains/violation_of_expectations/index.ts", + "../../langchain/src/experimental/masking/index.ts", + "../../langchain/src/experimental/tools/pyinterpreter.ts", + "../../langchain/src/evaluation/index.ts", + "../../langchain/src/runnables/index.ts", + "../../langchain/src/runnables/remote.ts" ] } diff --git a/docs/api_refs/typedoc_plugins/hide_underscore_lc.js b/docs/api_refs/typedoc_plugins/hide_underscore_lc.js new file mode 100644 index 000000000000..c8f5e186e6d7 --- /dev/null +++ b/docs/api_refs/typedoc_plugins/hide_underscore_lc.js @@ -0,0 +1,70 @@ +const { + Application, + Converter, + Context, + ReflectionKind, + DeclarationReflection, +} = require("typedoc"); + +/** + * @param {Application} application + * @returns {void} + */ +function load(application) { + /** + * @type {Array} + */ + let reflectionsToHide = []; + + application.converter.on( + Converter.EVENT_CREATE_DECLARATION, + resolveReflection + ); + application.converter.on(Converter.EVENT_RESOLVE_BEGIN, onBeginResolve); + + const reflectionKindsToHide = [ + ReflectionKind.Property, + ReflectionKind.Accessor, + ReflectionKind.Variable, + ReflectionKind.Method, + ReflectionKind.Function, + ReflectionKind.Class, + ReflectionKind.Interface, + ReflectionKind.Enum, + ReflectionKind.TypeAlias, + ]; + + /** + * @param {Context} context + * @returns {void} + */ + function onBeginResolve(context) { + reflectionsToHide.forEach((reflection) => { + const { project } = context; + // Remove the property from documentation + project.removeReflection(reflection); + }); + } + + /** + * @param {Context} _context + * @param {DeclarationReflection} reflection + * @returns {void} + */ + function resolveReflection( + _context, + reflection + ) { + const reflectionKind = reflection.kind; + if (reflectionKindsToHide.includes(reflectionKind)) { + if ( + reflection.name.startsWith("_") || + reflection.name.startsWith("lc_") + ) { + reflectionsToHide.push(reflection); + } + } + } +} + +module.exports = { load }; diff --git a/docs/core_docs/package.json b/docs/core_docs/package.json index 7483f76e2cf1..4ea0d6889864 100644 --- a/docs/core_docs/package.json +++ b/docs/core_docs/package.json @@ -6,7 +6,9 @@ "docusaurus": "docusaurus", "start": "yarn build:typedoc && rimraf ./docs/api && NODE_OPTIONS=--max-old-space-size=7168 docusaurus start", "build": "yarn build:typedoc && rimraf ./build && NODE_OPTIONS=--max-old-space-size=7168 DOCUSAURUS_SSR_CONCURRENCY=4 docusaurus build", + "build:vercel": "yarn build:typedoc:vercel && rimraf ./build && NODE_OPTIONS=--max-old-space-size=7168 DOCUSAURUS_SSR_CONCURRENCY=4 docusaurus build", "build:typedoc": "yarn run turbo:command build --filter=api_refs", + "build:typedoc:vercel": "yarn run turbo:command build:vercel --filter=api_refs", "swizzle": "docusaurus swizzle", "deploy": "docusaurus deploy", "clear": "docusaurus clear", diff --git a/langchain/scripts/create-entrypoints.js b/langchain/scripts/create-entrypoints.js index e5bb0b7c3b2e..cf592165b424 100644 --- a/langchain/scripts/create-entrypoints.js +++ b/langchain/scripts/create-entrypoints.js @@ -578,7 +578,7 @@ const updateConfig = () => { ...json, entryPoints: [...Object.keys(entrypoints)] .filter((key) => !deprecatedNodeOnly.includes(key)) - .map((key) => `./langchain/src/${entrypoints[key]}.ts`), + .map((key) => `../../langchain/src/${entrypoints[key]}.ts`), })); const generatedFiles = generateFiles(); diff --git a/turbo.json b/turbo.json index f69769f2a5c3..b5ef33b86200 100644 --- a/turbo.json +++ b/turbo.json @@ -22,7 +22,11 @@ "inputs": ["src/**", "scripts/**", "package.json", "tsconfig.json"] }, "build": { - "dependsOn": ["@langchain/core#build", "@langchain/community#build", "^build"], + "dependsOn": [ + "@langchain/core#build", + "@langchain/community#build", + "^build" + ], "outputs": ["dist/**", "dist-cjs/**", "*.js", "*.cjs", "*.d.ts"], "inputs": ["src/**", "scripts/**", "package.json", "tsconfig.json"] }, @@ -46,6 +50,9 @@ "precommit": {}, "start": { "cache": false + }, + "build:vercel": { + "dependsOn": ["^build:vercel"] } } }