diff --git a/docs/api_refs/.gitignore b/docs/api_refs/.gitignore index 7e0e84cd6449..a9da50845591 100644 --- a/docs/api_refs/.gitignore +++ b/docs/api_refs/.gitignore @@ -37,3 +37,4 @@ next-env.d.ts # Autogenerated docs /public/* +/langchain \ No newline at end of file diff --git a/docs/api_refs/generate_typedoc.sh b/docs/api_refs/generate_typedoc.sh deleted file mode 100644 index 2d4a1ee287e3..000000000000 --- a/docs/api_refs/generate_typedoc.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -BASE_DIR="../../langchain" - -# Create a directory to temp hold the files in src -# `api_refs_docs_build` is gitignored by default. -mkdir -p "$BASE_DIR/api_refs_docs_build/dist" - -# Copy the contents of src to docs/dist -cp -r "$BASE_DIR/src/." "$BASE_DIR/api_refs_docs_build/dist/" - -# This command will add `@ignore` to JSDoc comments -# for properties which should be ignored. -yarn add-ignore-comments - -# This command will generate the docs -yarn typedoc - -# Remove the current contents of langchain/src -rm -rf "$BASE_DIR/api_refs_docs_build/*" - -# Copy the unedited contents from docs/dist to langchain/src -cp -r "$BASE_DIR/api_refs_docs_build/dist/." "$BASE_DIR/src/" diff --git a/docs/api_refs/package.json b/docs/api_refs/package.json index 0c1e84a88690..8eff082d8a4d 100644 --- a/docs/api_refs/package.json +++ b/docs/api_refs/package.json @@ -3,12 +3,10 @@ "version": "0.1.0", "private": true, "scripts": { - "dev": "next dev", - "typedoc": "npx typedoc --options typedoc.json && yarn update-css", - "build:typedoc": "bash ./generate_typedoc.sh", - "add-ignore-comments": "cd ../../langchain && node scripts/build-for-api-ref-docs.js", - "update-css": "node ./scripts/update-typedoc-css.js", - "build": "yarn build:typedoc && next build", + "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": "yarn build:scripts && next build", "start": "yarn build && next start -p 3001", "lint": "next lint" }, @@ -18,14 +16,17 @@ "react-dom": "^18" }, "devDependencies": { + "@types/fs-extra": "^11", "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", "autoprefixer": "^10.0.1", "eslint": "^8", "eslint-config-next": "14.0.1", + "fs-extra": "^11.1.1", "postcss": "^8", "tailwindcss": "^3.3.0", + "ts-morph": "^20.0.0", "typescript": "^5" } } diff --git a/langchain/scripts/build-for-api-ref-docs.js b/docs/api_refs/scripts/generate-api-refs.js similarity index 62% rename from langchain/scripts/build-for-api-ref-docs.js rename to docs/api_refs/scripts/generate-api-refs.js index 416436a911a9..0782169755c3 100644 --- a/langchain/scripts/build-for-api-ref-docs.js +++ b/docs/api_refs/scripts/generate-api-refs.js @@ -1,8 +1,10 @@ -import { Project, SyntaxKind } from "ts-morph"; +const { Project, SyntaxKind } = require("ts-morph"); +const { exec } = require("child_process"); +const fse = require("fs-extra"); -async function main() { +async function updateCodeWithIgnoreTags(tsConfigFilePath) { const project = new Project({ - tsConfigFilePath: "./tsconfig.json", + tsConfigFilePath, }); const sourceFiles = project.getSourceFiles(); /** @@ -64,4 +66,37 @@ async function main() { await project.save(); } + +async function copyLangChain(pathToLangChain) { + // copy the entire langchain dir to . + + await fse.copy(pathToLangChain, "./langchain", { overwrite: false }); + return { + rootPath: `${process.cwd()}/langchain`, + tsConfigPath: `${process.cwd()}/langchain/tsconfig.json`, + }; +} + +async function deleteLangChain(pathToLangChain) { + // delete the langchain dir + await fse.remove(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 1893a19dd55b..1709b7ea552f 100644 --- a/docs/api_refs/typedoc.json +++ b/docs/api_refs/typedoc.json @@ -8,7 +8,7 @@ "required-first", "alphabetical" ], - "tsconfig": "../../langchain/tsconfig.json", + "tsconfig": "./langchain/tsconfig.json", "readme": "none", "excludePrivate": true, "excludeInternal": true, @@ -18,267 +18,267 @@ "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/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/render.ts", - "../../langchain/src/tools/sql.ts", - "../../langchain/src/tools/webbrowser.ts", - "../../langchain/src/tools/google_calendar/index.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/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/googlevertexai/index.ts", - "../../langchain/src/llms/googlevertexai/web.ts", - "../../langchain/src/llms/googlepalm.ts", - "../../langchain/src/llms/fireworks.ts", - "../../langchain/src/llms/sagemaker_endpoint.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/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/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/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/unstructured.ts", - "../../langchain/src/document_loaders/fs/openai_whisper_audio.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/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/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/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/evaluation/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/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/render.ts", + "./langchain/src/tools/sql.ts", + "./langchain/src/tools/webbrowser.ts", + "./langchain/src/tools/google_calendar/index.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/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/googlevertexai/index.ts", + "./langchain/src/llms/googlevertexai/web.ts", + "./langchain/src/llms/googlepalm.ts", + "./langchain/src/llms/fireworks.ts", + "./langchain/src/llms/sagemaker_endpoint.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/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/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/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/unstructured.ts", + "./langchain/src/document_loaders/fs/openai_whisper_audio.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/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/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/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/evaluation/index.ts", + "./langchain/src/runnables/remote.ts" ] } diff --git a/docs/core_docs/package.json b/docs/core_docs/package.json index 99fa2e24a9af..ea690f08c985 100644 --- a/docs/core_docs/package.json +++ b/docs/core_docs/package.json @@ -4,9 +4,9 @@ "private": true, "scripts": { "docusaurus": "docusaurus", - "start": "yarn build:typedoc && rimraf ./docs/api && NODE_OPTIONS=--max-old-space-size=7168 docusaurus start", + "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:typedoc": "cd ../api_refs && yarn build:typedoc", + "build:typedoc": "cd ../api_refs && yarn build", "swizzle": "docusaurus swizzle", "deploy": "docusaurus deploy", "clear": "docusaurus clear", diff --git a/langchain/package.json b/langchain/package.json index 5afa57be94bd..8eb486274fee 100644 --- a/langchain/package.json +++ b/langchain/package.json @@ -810,7 +810,6 @@ "build:cjs": "NODE_OPTIONS=--max-old-space-size=4096 tsc --outDir dist-cjs/ -p tsconfig.cjs.json && node scripts/move-cjs-to-dist.js && rimraf dist-cjs", "build:watch": "node scripts/create-entrypoints.js && tsc --outDir dist/ --watch", "build:scripts": "node scripts/create-entrypoints.js && node scripts/check-tree-shaking.js", - "conditional:api_refs": "bash scripts/build-api-refs.sh", "lint": "NODE_OPTIONS=--max-old-space-size=4096 eslint src && dpdm --exit-code circular:1 --no-warning --no-tree src/*.ts src/**/*.ts", "lint:fix": "yarn lint --fix", "precommit": "lint-staged", @@ -954,7 +953,6 @@ "sqlite3": "^5.1.4", "srt-parser-2": "^1.2.2", "ts-jest": "^29.1.0", - "ts-morph": "^20.0.0", "typeorm": "^0.3.12", "typescript": "^5.0.0", "typesense": "^1.5.3", diff --git a/langchain/scripts/build-api-refs.sh b/langchain/scripts/build-api-refs.sh deleted file mode 100644 index 42603aa3b66f..000000000000 --- a/langchain/scripts/build-api-refs.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -if [ "$SKIP_API_DOCS" != "true" ]; then - cd ../docs/api_refs && yarn build:typedoc -fi diff --git a/langchain/scripts/create-entrypoints.js b/langchain/scripts/create-entrypoints.js index d02bc22c85c2..8d680b5097c4 100644 --- a/langchain/scripts/create-entrypoints.js +++ b/langchain/scripts/create-entrypoints.js @@ -547,7 +547,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/package.json b/package.json index 2e24de19cb68..e2348d41c103 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,6 @@ "packageManager": "yarn@3.4.1", "scripts": { "build": "turbo run build --filter=\"!test-exports-*\" --concurrency 1", - "build:api_refs": "cd ./docs/api_refs && yarn build:typedoc", "format": "turbo run format", "format:check": "turbo run format:check", "lint": "turbo run lint --concurrency 1", diff --git a/yarn.lock b/yarn.lock index 24c10b2d4477..18b11bb3586b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11122,6 +11122,16 @@ __metadata: languageName: node linkType: hard +"@types/fs-extra@npm:^11": + version: 11.0.4 + resolution: "@types/fs-extra@npm:11.0.4" + dependencies: + "@types/jsonfile": "*" + "@types/node": "*" + checksum: 242cb84157631f057f76495c8220707541882c00a00195b603d937fb55e471afecebcb089bab50233ed3a59c69fd68bf65c1f69dd7fafe2347e139cc15b9b0e5 + languageName: node + linkType: hard + "@types/fs-extra@npm:^11.0.1": version: 11.0.1 resolution: "@types/fs-extra@npm:11.0.1" @@ -12856,17 +12866,20 @@ __metadata: version: 0.0.0-use.local resolution: "api_refs@workspace:docs/api_refs" dependencies: + "@types/fs-extra": ^11 "@types/node": ^20 "@types/react": ^18 "@types/react-dom": ^18 autoprefixer: ^10.0.1 eslint: ^8 eslint-config-next: 14.0.1 + fs-extra: ^11.1.1 next: 14.0.1 postcss: ^8 react: ^18 react-dom: ^18 tailwindcss: ^3.3.0 + ts-morph: ^20.0.0 typescript: ^5 languageName: unknown linkType: soft @@ -22326,7 +22339,6 @@ __metadata: sqlite3: ^5.1.4 srt-parser-2: ^1.2.2 ts-jest: ^29.1.0 - ts-morph: ^20.0.0 typeorm: ^0.3.12 typescript: ^5.0.0 typesense: ^1.5.3