diff --git a/docs/core_docs/.gitignore b/docs/core_docs/.gitignore index b1e7aab4a4a5..c2737d8dfe94 100644 --- a/docs/core_docs/.gitignore +++ b/docs/core_docs/.gitignore @@ -348,17 +348,6 @@ docs/integrations/retrievers/self_query/hnswlib.md docs/integrations/retrievers/self_query/hnswlib.mdx docs/integrations/retrievers/self_query/chroma.md docs/integrations/retrievers/self_query/chroma.mdx -docs/integrations/document_loaders/file_loaders/unstructured.md -docs/integrations/document_loaders/file_loaders/unstructured.mdx -docs/integrations/document_loaders/file_loaders/text.md -docs/integrations/document_loaders/file_loaders/text.mdx -docs/integrations/document_loaders/file_loaders/pdf.md -docs/integrations/document_loaders/file_loaders/pdf.mdx -docs/integrations/document_loaders/file_loaders/directory.md -docs/integrations/document_loaders/file_loaders/directory.mdx -docs/integrations/document_loaders/file_loaders/csv.md -docs/integrations/document_loaders/file_loaders/csv.mdx -.vercel docs/integrations/document_loaders/web_loaders/web_puppeteer.md docs/integrations/document_loaders/web_loaders/web_puppeteer.mdx docs/integrations/document_loaders/web_loaders/web_cheerio.md @@ -369,3 +358,13 @@ docs/integrations/document_loaders/web_loaders/pdf.md docs/integrations/document_loaders/web_loaders/pdf.mdx docs/integrations/document_loaders/web_loaders/firecrawl.md docs/integrations/document_loaders/web_loaders/firecrawl.mdx +docs/integrations/document_loaders/file_loaders/unstructured.md +docs/integrations/document_loaders/file_loaders/unstructured.mdx +docs/integrations/document_loaders/file_loaders/text.md +docs/integrations/document_loaders/file_loaders/text.mdx +docs/integrations/document_loaders/file_loaders/pdf.md +docs/integrations/document_loaders/file_loaders/pdf.mdx +docs/integrations/document_loaders/file_loaders/directory.md +docs/integrations/document_loaders/file_loaders/directory.mdx +docs/integrations/document_loaders/file_loaders/csv.md +docs/integrations/document_loaders/file_loaders/csv.mdx \ No newline at end of file diff --git a/docs/core_docs/docs/concepts.mdx b/docs/core_docs/docs/concepts.mdx index 5a42901e8a08..f363cf44fd46 100644 --- a/docs/core_docs/docs/concepts.mdx +++ b/docs/core_docs/docs/concepts.mdx @@ -22,7 +22,7 @@ import useBaseUrl from "@docusaurus/useBaseUrl"; ### `@langchain/core` This package contains base abstractions of different components and ways to compose them together. -The interfaces for core components like LLMs, vectorstores, retrievers and more are defined here. +The interfaces for core components like LLMs, vector stores, retrievers and more are defined here. No third party integrations are defined here. The dependencies are kept purposefully very lightweight. @@ -30,7 +30,7 @@ The dependencies are kept purposefully very lightweight. This package contains third party integrations that are maintained by the LangChain community. Key partner packages are separated out (see below). -This contains all integrations for various components (LLMs, vectorstores, retrievers). +This contains all integrations for various components (LLMs, vector stores, retrievers). All dependencies in this package are optional to keep the package as lightweight as possible. ### Partner packages @@ -143,7 +143,7 @@ Some components LangChain implements, some components we rely on third-party int Language models that use a sequence of messages as inputs and return chat messages as outputs (as opposed to using plain text). -These are traditionally newer models (older models are generally `LLMs`, see below). +These are generally newer models (older models are generally `LLMs`, see below). Chat models support the assignment of distinct roles to conversation messages, helping to distinguish messages from the AI, users, and instructions such as system messages. Although the underlying models are messages in, message out, the LangChain wrappers also allow these models to take a string as input. @@ -480,7 +480,7 @@ The base Embeddings class in LangChain provides two methods: one for embedding d For specifics on how to use embedding models, see the [relevant how-to guides here](/docs/how_to/#embedding-models). -### Vectorstores +### Vector stores {#vectorstore} diff --git a/docs/core_docs/docs/integrations/chat/azure.ipynb b/docs/core_docs/docs/integrations/chat/azure.ipynb index a4e19b4ddc4c..20bfaf9957d1 100644 --- a/docs/core_docs/docs/integrations/chat/azure.ipynb +++ b/docs/core_docs/docs/integrations/chat/azure.ipynb @@ -21,7 +21,7 @@ "source": [ "# AzureChatOpenAI\n", "\n", - "[Azure OpenAI](https://learn.microsoft.com/en-us/azure/ai-services/openai/) is a Microsoft Azure service that provides powerful language models from OpenAI.\n", + "Azure OpenAI is a Microsoft Azure service that provides powerful language models from OpenAI.\n", "\n", "This will help you getting started with AzureChatOpenAI [chat models](/docs/concepts/#chat-models). For detailed documentation of all AzureChatOpenAI features and configurations head to the [API reference](https://api.js.langchain.com/classes/langchain_openai.AzureChatOpenAI.html).\n", "\n", diff --git a/docs/core_docs/docs/integrations/chat/index.mdx b/docs/core_docs/docs/integrations/chat/index.mdx index 23c81a22933c..0b4fa43125a5 100644 --- a/docs/core_docs/docs/integrations/chat/index.mdx +++ b/docs/core_docs/docs/integrations/chat/index.mdx @@ -6,40 +6,32 @@ hide_table_of_contents: true # Chat models -## Features (natively supported) - -All ChatModels implement the Runnable interface, which comes with default implementations of all methods, ie. `invoke`, `batch`, `stream`. This gives all ChatModels basic support for invoking, streaming and batching, which by default is implemented as below: - -- _Streaming_ support defaults to returning an `AsyncIterator` of a single value, the final result returned by the underlying ChatModel provider. This obviously doesn't give you token-by-token streaming, which requires native support from the ChatModel provider, but ensures your code that expects an iterator of tokens can work for any of our ChatModel integrations. -- _Batch_ support defaults to calling the underlying ChatModel in parallel for each input. The concurrency can be controlled with the `maxConcurrency` key in `RunnableConfig`. - -Each ChatModel integration can optionally provide native implementations to truly enable invoke, streaming or batching requests. - -Additionally, some chat models support additional ways of guaranteeing structure in their outputs by allowing you to pass in a defined schema. -[Tool calling](/docs/how_to/tool_calling) (tool calling) is one capability, and allows you to use the chat model as the LLM in certain types of agents. -Some models in LangChain have also implemented a `withStructuredOutput()` method that unifies many of these different ways of constraining output to a schema. - -The table shows, for each integration, which features have been implemented with native support. Yellow circles (🟡) indicates partial support - for example, if the model supports tool calling but not tool messages for agents. - -| Model | Stream | JSON mode | [Tool Calling](/docs/how_to/tool_calling/) | [`withStructuredOutput()`](/docs/how_to/structured_output/#the-.withstructuredoutput-method) | [Multimodal](/docs/how_to/multimodal_inputs/) | -| :---------------------- | :----: | :-------: | :----------------------------------------: | :------------------------------------------------------------------------------------------: | :-------------------------------------------: | -| BedrockChat | ✅ | ❌ | 🟡 (Bedrock Anthropic only) | 🟡 (Bedrock Anthropic only) | 🟡 (Bedrock Anthropic only) | -| ChatBedrockConverse | ✅ | ❌ | ✅ | ✅ | ✅ | -| ChatAlibabaTongyi | ❌ | ❌ | ❌ | ❌ | ❌ | -| ChatAnthropic | ✅ | ❌ | ✅ | ✅ | ✅ | -| ChatBaiduWenxin | ❌ | ❌ | ❌ | ❌ | ❌ | -| ChatCloudflareWorkersAI | ✅ | ❌ | ❌ | ❌ | ❌ | -| ChatCohere | ✅ | ❌ | ✅ | ✅ | ✅ | -| ChatFireworks | ✅ | ✅ | ✅ | ✅ | ✅ | -| ChatGoogleGenerativeAI | ✅ | ❌ | ✅ | ✅ | ✅ | -| ChatVertexAI | ✅ | ❌ | ✅ | ✅ | ✅ | -| ChatGroq | ✅ | ✅ | ✅ | ✅ | ✅ | -| ChatLlamaCpp | ✅ | ❌ | ❌ | ❌ | ❌ | -| ChatMinimax | ❌ | ❌ | ❌ | ❌ | ❌ | -| ChatMistralAI | ❌ | ✅ | ✅ | ✅ | ✅ | -| ChatOllama | ✅ | ✅ | ✅ | ✅ | ✅ | -| ChatOpenAI | ✅ | ✅ | ✅ | ✅ | ✅ | -| ChatTencentHunyuan | ✅ | ❌ | ❌ | ❌ | ❌ | -| ChatTogetherAI | ✅ | ✅ | ✅ | ✅ | ✅ | -| ChatYandexGPT | ❌ | ❌ | ❌ | ❌ | ❌ | -| ChatZhipuAI | ❌ | ❌ | ❌ | ❌ | ❌ | +[Chat models](/docs/concepts/#chat-models) are language models that use a sequence of [messages](/docs/concepts/#messages) as inputs and return messages as outputs (as opposed to using plain text). These are generally newer models. + +:::info +If you'd like to write your own chat model, see [this how-to](/docs/how_to/custom_chat). If you'd like to contribute an integration, see [Contributing integrations](/docs/contributing). +::: + +## Featured providers + +| Model | Stream | JSON mode | [Tool Calling](/docs/how_to/tool_calling/) | [`withStructuredOutput()`](/docs/how_to/structured_output/#the-.withstructuredoutput-method) | [Multimodal](/docs/how_to/multimodal_inputs/) | +| :----------------------------------------------------------------------- | :----: | :-------: | :----------------------------------------: | :------------------------------------------------------------------------------------------: | :-------------------------------------------: | +| [BedrockChat](/docs/integrations/chat/bedrock/) | ✅ | ❌ | 🟡 (Bedrock Anthropic only) | 🟡 (Bedrock Anthropic only) | 🟡 (Bedrock Anthropic only) | +| [ChatBedrockConverse](/docs/integrations/chat/bedrock_converse/) | ✅ | ❌ | ✅ | ✅ | ✅ | +| [ChatAnthropic](/docs/integrations/chat/anthropic/) | ✅ | ❌ | ✅ | ✅ | ✅ | +| [ChatCloudflareWorkersAI](/docs/integrations/chat/cloudflare_workersai/) | ✅ | ❌ | ❌ | ❌ | ❌ | +| [ChatCohere](/docs/integrations/chat/cohere/) | ✅ | ❌ | ✅ | ✅ | ✅ | +| [ChatFireworks](/docs/integrations/chat/fireworks/) | ✅ | ✅ | ✅ | ✅ | ✅ | +| [ChatGoogleGenerativeAI](/docs/integrations/chat/google_generativeai/) | ✅ | ❌ | ✅ | ✅ | ✅ | +| [ChatVertexAI](/docs/integrations/chat/google_vertex_ai/) | ✅ | ❌ | ✅ | ✅ | ✅ | +| [ChatGroq](/docs/integrations/chat/groq/) | ✅ | ✅ | ✅ | ✅ | ✅ | +| [ChatMistralAI](/docs/integrations/chat/mistral/) | ✅ | ✅ | ✅ | ✅ | ✅ | +| [ChatOllama](/docs/integrations/chat/ollama/) | ✅ | ✅ | ✅ | ✅ | ✅ | +| [ChatOpenAI](/docs/integrations/chat/openai/) | ✅ | ✅ | ✅ | ✅ | ✅ | +| [ChatTogetherAI](/docs/integrations/chat/togetherai/) | ✅ | ✅ | ✅ | ✅ | ✅ | + +## All chat models + +import { IndexTable } from "@theme/FeatureTables"; + + diff --git a/docs/core_docs/docs/integrations/document_loaders/file_loaders/index.mdx b/docs/core_docs/docs/integrations/document_loaders/file_loaders/index.mdx index 5eb2b241d08c..8006032b0374 100644 --- a/docs/core_docs/docs/integrations/document_loaders/file_loaders/index.mdx +++ b/docs/core_docs/docs/integrations/document_loaders/file_loaders/index.mdx @@ -12,6 +12,12 @@ Only available on Node.js. These loaders are used to load files given a filesystem path or a Blob object. -import DocCardList from "@theme/DocCardList"; +:::info +If you'd like to write your own document loader, see [this how-to](/docs/how_to/document_loader_custom/). If you'd like to contribute an integration, see [Contributing integrations](/docs/contributing). +::: + +import { CategoryTable, IndexTable } from "@theme/FeatureTables"; + +## All document loaders - + diff --git a/docs/core_docs/docs/integrations/document_loaders/index.mdx b/docs/core_docs/docs/integrations/document_loaders/index.mdx new file mode 100644 index 000000000000..44770ad5b1ad --- /dev/null +++ b/docs/core_docs/docs/integrations/document_loaders/index.mdx @@ -0,0 +1,18 @@ +--- +sidebar_position: 0 +--- + +# Document loaders + +[Document loaders](/docs/concepts#document-loaders) load data into LangChain's expected format for use-cases such as [retrieval-augmented generation (RAG)](/docs/tutorials/rag). + +LangChain.js categorizes document loaders in two different ways: + +- [File loaders](/docs/integrations/document_loaders/file_loaders/), which load data into LangChain formats from your local filesystem. +- [Web loaders](/docs/integrations/document_loaders/web_loaders/), which load data from remote sources. + +See the individual pages for more on each category. + +:::info +If you'd like to write your own document loader, see [this how-to](/docs/how_to/document_loader_custom/). If you'd like to contribute an integration, see [Contributing integrations](/docs/contributing). +::: diff --git a/docs/core_docs/docs/integrations/document_loaders/web_loaders/index.mdx b/docs/core_docs/docs/integrations/document_loaders/web_loaders/index.mdx index e86f3f70a99b..e9978359f156 100644 --- a/docs/core_docs/docs/integrations/document_loaders/web_loaders/index.mdx +++ b/docs/core_docs/docs/integrations/document_loaders/web_loaders/index.mdx @@ -5,8 +5,14 @@ hide_table_of_contents: true # Web Loaders -These loaders are used to load web resources. +These loaders are used to load web resources. They do not involve the local file system. -import DocCardList from "@theme/DocCardList"; +import { CategoryTable, IndexTable } from "@theme/FeatureTables"; - +:::info +If you'd like to write your own document loader, see [this how-to](/docs/how_to/document_loader_custom/). If you'd like to contribute an integration, see [Contributing integrations](/docs/contributing). +::: + +## All web loaders + + diff --git a/docs/core_docs/docs/integrations/llms/index.mdx b/docs/core_docs/docs/integrations/llms/index.mdx index c12a1441245c..b50ac95938b2 100644 --- a/docs/core_docs/docs/integrations/llms/index.mdx +++ b/docs/core_docs/docs/integrations/llms/index.mdx @@ -5,35 +5,20 @@ sidebar_class_name: hidden # LLMs - - - -## Features (natively supported) - -All LLMs implement the Runnable interface, which comes with default implementations of all methods, ie. `invoke`, `batch`, `stream`, `map`. This gives all LLMs basic support for invoking, streaming, batching and mapping requests, which by default is implemented as below: - -- _Streaming_ support defaults to returning an `AsyncIterator` of a single value, the final result returned by the underlying LLM provider. This obviously doesn't give you token-by-token streaming, which requires native support from the LLM provider, but ensures your code that expects an iterator of tokens can work for any of our LLM integrations. -- _Batch_ support defaults to calling the underlying LLM in parallel for each input. The concurrency can be controlled with the `maxConcurrency` key in `RunnableConfig`. -- _Map_ support defaults to calling `.invoke` across all instances of the array which it was called on. - -Each LLM integration can optionally provide native implementations for invoke, streaming or batch, which, for providers that support it, can be more efficient. The table shows, for each integration, which features have been implemented with native support. - -| Model | Invoke | Stream | Batch | -| :------------------- | :----: | :----: | :---: | -| AI21 | ✅ | ❌ | ✅ | -| AlephAlpha | ✅ | ❌ | ✅ | -| AzureOpenAI | ✅ | ✅ | ✅ | -| CloudflareWorkersAI | ✅ | ✅ | ✅ | -| Cohere | ✅ | ❌ | ✅ | -| Fireworks | ✅ | ✅ | ✅ | -| GooglePaLM | ✅ | ❌ | ✅ | -| HuggingFaceInference | ✅ | ❌ | ✅ | -| LlamaCpp | ✅ | ✅ | ✅ | -| Ollama | ✅ | ✅ | ✅ | -| OpenAI | ✅ | ✅ | ✅ | -| OpenAIChat | ✅ | ✅ | ✅ | -| Portkey | ✅ | ✅ | ✅ | -| Replicate | ✅ | ❌ | ✅ | -| SageMakerEndpoint | ✅ | ✅ | ✅ | -| Writer | ✅ | ❌ | ✅ | -| YandexGPT | ✅ | ❌ | ✅ | +:::caution +You are currently on a page documenting the use of [text completion models](/docs/concepts/#llms). Many of the latest and most popular models are [chat completion models](/docs/concepts/#chat-models). + +Unless you are specifically using more advanced prompting techniques, you are probably looking for [this page instead](/docs/integrations/chat/). +::: + +[LLMs](docs/concepts/#llms) are Language models that takes a string as input and returns a string. These are generally older models (newer models generally are chat models, see above). + +:::info +If you'd like to write your own LLM, see [this how-to](/docs/how_to/custom_llm). If you'd like to contribute an integration, see [Contributing integrations](/docs/contributing). +::: + +## All LLMs + +import { IndexTable } from "@theme/FeatureTables"; + + diff --git a/docs/core_docs/docs/integrations/retrievers/chatgpt-retriever-plugin.mdx b/docs/core_docs/docs/integrations/retrievers/chatgpt-retriever-plugin.mdx index 42a535462bdd..e9766ddbe0eb 100644 --- a/docs/core_docs/docs/integrations/retrievers/chatgpt-retriever-plugin.mdx +++ b/docs/core_docs/docs/integrations/retrievers/chatgpt-retriever-plugin.mdx @@ -1,5 +1,6 @@ --- hide_table_of_contents: true +sidebar_class_name: hidden --- # ChatGPT Plugin Retriever diff --git a/docs/core_docs/docs/integrations/retrievers/index.mdx b/docs/core_docs/docs/integrations/retrievers/index.mdx new file mode 100644 index 000000000000..72fd489c13ae --- /dev/null +++ b/docs/core_docs/docs/integrations/retrievers/index.mdx @@ -0,0 +1,27 @@ +--- +sidebar_position: 0 +sidebar_class_name: hidden +--- + +import { CategoryTable, IndexTable } from "@theme/FeatureTables"; + +# Retrievers + +A [retriever](/docs/concepts/#retrievers) is an interface that returns documents given an unstructured query. +It is more general than a vector store. +A retriever does not need to be able to store documents, only to return (or retrieve) them. + +Retrievers accept a string query as input and return a list of Documents. + +For specifics on how to use retrievers, see the [relevant how-to guides here](/docs/how_to/#retrievers). + +Note that all [vector stores](/docs/concepts/#vectorstores) can be [cast to retrievers](/docs/how_to/vectorstore_retriever/). +Refer to the vector store [integration docs](/docs/integrations/vectorstores/) for available vector store retrievers. + +:::info +If you'd like to write your own retriever, see [this how-to](/docs/how_to/custom_retriever/). If you'd like to contribute an integration, see [Contributing integrations](/docs/contributing). +::: + +## All retrievers + + diff --git a/docs/core_docs/docs/integrations/stores/index.mdx b/docs/core_docs/docs/integrations/stores/index.mdx index 60dbfd7414d8..c5782bb1c919 100644 --- a/docs/core_docs/docs/integrations/stores/index.mdx +++ b/docs/core_docs/docs/integrations/stores/index.mdx @@ -4,8 +4,10 @@ sidebar_class_name: hidden # Key-value stores +import { CategoryTable, IndexTable } from "@theme/FeatureTables"; + [Key-value stores](/docs/concepts/#key-value-stores) are used by other LangChain components to store and retrieve data. -import DocCardList from "@theme/DocCardList"; +## All key-value stores - + diff --git a/docs/core_docs/docs/integrations/text_embedding/google_generativeai.ipynb b/docs/core_docs/docs/integrations/text_embedding/google_generativeai.ipynb index 038614cfe1ff..d1a8e0069711 100644 --- a/docs/core_docs/docs/integrations/text_embedding/google_generativeai.ipynb +++ b/docs/core_docs/docs/integrations/text_embedding/google_generativeai.ipynb @@ -21,8 +21,6 @@ "source": [ "# GoogleGenerativeAIEmbeddings\n", "\n", - "- [ ] TODO: Make sure API reference link is correct\n", - "\n", "This will help you get started with Google Generative AI [embedding models](/docs/concepts#embedding-models) using LangChain. For detailed documentation on `GoogleGenerativeAIEmbeddings` features and configuration options, please refer to the [API reference](https://api.js.langchain.com/classes/langchain_google_genai.GoogleGenerativeAIEmbeddings.html).\n", "\n", "## Overview\n", diff --git a/docs/core_docs/docs/integrations/text_embedding/index.mdx b/docs/core_docs/docs/integrations/text_embedding/index.mdx new file mode 100644 index 000000000000..2e5b612041aa --- /dev/null +++ b/docs/core_docs/docs/integrations/text_embedding/index.mdx @@ -0,0 +1,14 @@ +--- +sidebar_position: 0 +sidebar_class_name: hidden +--- + +# Embeddings + +[Embedding models](/docs/concepts#embedding-models) create a vector representation of a piece of text. + +This page documents integrations with various model providers that allow you to use embeddings in LangChain. + +import { CategoryTable, IndexTable } from "@theme/FeatureTables"; + + diff --git a/docs/core_docs/docs/integrations/toolkits/index.mdx b/docs/core_docs/docs/integrations/toolkits/index.mdx new file mode 100644 index 000000000000..c80d2816b3ff --- /dev/null +++ b/docs/core_docs/docs/integrations/toolkits/index.mdx @@ -0,0 +1,14 @@ +--- +sidebar_position: 0 +sidebar_class_name: hidden +--- + +# Toolkits + +import { CategoryTable, IndexTable } from "@theme/FeatureTables"; + +Also see [Tools page](/docs/integrations/tools/). + +## All Toolkits + + diff --git a/docs/core_docs/docs/integrations/tools/index.mdx b/docs/core_docs/docs/integrations/tools/index.mdx new file mode 100644 index 000000000000..b1ea32d458b2 --- /dev/null +++ b/docs/core_docs/docs/integrations/tools/index.mdx @@ -0,0 +1,20 @@ +--- +sidebar_position: 0 +sidebar_class_name: hidden +--- + +# Tools and Toolkits + +import { CategoryTable, IndexTable } from "@theme/FeatureTables"; + +[Tools](/docs/concepts/#tools) are utilities designed to be called by a model: their inputs are designed to be generated by models, and their outputs are designed to be passed back to models. + +A [toolkit](/docs/concepts#toolkits) is a collection of tools meant to be used together. For a list of toolkit integrations, see [this page](/docs/integrations/toolkits/). + +:::info +If you'd like to write your own tool, see [this how-to](/docs/how_to/custom_tools/). If you'd like to contribute an integration, see [Contributing integrations](/docs/contributing). +::: + +## All Tools + + diff --git a/docs/core_docs/docs/integrations/vectorstores/index.mdx b/docs/core_docs/docs/integrations/vectorstores/index.mdx new file mode 100644 index 000000000000..a335c0aa3cbb --- /dev/null +++ b/docs/core_docs/docs/integrations/vectorstores/index.mdx @@ -0,0 +1,14 @@ +--- +sidebar_position: 0 +sidebar_class_name: hidden +--- + +# Vector stores + +A [vector store](/docs/concepts/#vectorstores) stores [embedded](/docs/concepts/#embedding-models) data and performing similarity search. + +LangChain.js integrates with a variety of vector stores. You can check out a full list below: + +import { CategoryTable, IndexTable } from "@theme/FeatureTables"; + + diff --git a/docs/core_docs/sidebars.js b/docs/core_docs/sidebars.js index 0f2dc6dbc4f6..e4297b057712 100644 --- a/docs/core_docs/sidebars.js +++ b/docs/core_docs/sidebars.js @@ -119,11 +119,12 @@ module.exports = { { type: "category", label: "Chat models", - collapsed: true, + collapsible: false, items: [ { type: "autogenerated", dirName: "integrations/chat", + className: "hidden", }, ], link: { @@ -134,11 +135,12 @@ module.exports = { { type: "category", label: "LLMs", - collapsed: true, + collapsible: false, items: [ { type: "autogenerated", dirName: "integrations/llms", + className: "hidden", }, ], link: { @@ -149,16 +151,17 @@ module.exports = { { type: "category", label: "Embedding models", - collapsed: true, + collapsible: false, items: [ { type: "autogenerated", dirName: "integrations/text_embedding", + className: "hidden", }, ], link: { - type: "generated-index", - slug: "integrations/text_embedding", + type: "doc", + id: "integrations/text_embedding/index", }, }, { @@ -167,183 +170,226 @@ module.exports = { collapsed: true, items: [ { - type: "autogenerated", - dirName: "integrations/document_loaders", + type: "category", + label: "File loaders", + collapsible: false, + items: [ + { + type: "autogenerated", + dirName: "integrations/document_loaders/file_loaders", + className: "hidden", + }, + ], + link: { + type: "doc", + id: "integrations/document_loaders/file_loaders/index", + }, }, - ], - link: { - type: "generated-index", - slug: "integrations/document_loaders", - }, - }, - { - type: "category", - label: "Document transformers", - collapsed: true, - items: [ { - type: "autogenerated", - dirName: "integrations/document_transformers", - }, - { - type: "autogenerated", - dirName: "integrations/document_compressors", + type: "category", + label: "Web loaders", + collapsible: false, + items: [ + { + type: "autogenerated", + dirName: "integrations/document_loaders/web_loaders", + className: "hidden", + }, + ], + link: { + type: "doc", + id: "integrations/document_loaders/web_loaders/index", + }, }, ], link: { - type: "generated-index", - slug: "integrations/document_transformers", + type: "doc", + id: "integrations/document_loaders/index", }, }, { type: "category", label: "Vector stores", - collapsed: true, + collapsible: false, items: [ { type: "autogenerated", dirName: "integrations/vectorstores", + className: "hidden", }, ], link: { - type: "generated-index", - slug: "integrations/vectorstores", + type: "doc", + id: "integrations/vectorstores/index", }, }, { type: "category", label: "Retrievers", - collapsed: true, + collapsible: false, items: [ { type: "autogenerated", dirName: "integrations/retrievers", + className: "hidden", }, ], link: { - type: "generated-index", - slug: "integrations/retrievers", + type: "doc", + id: "integrations/retrievers/index", }, }, { type: "category", - label: "Tools", - collapsed: true, + label: "Tools/Toolkits", + collapsible: false, items: [ { type: "autogenerated", dirName: "integrations/tools", + className: "hidden", }, ], link: { - type: "generated-index", - slug: "integrations/tools", + type: "doc", + id: "integrations/tools/index", }, }, { type: "category", label: "Toolkits", - collapsed: true, + collapsible: false, + className: "hidden", items: [ { type: "autogenerated", dirName: "integrations/toolkits", + className: "hidden", }, ], link: { - type: "generated-index", - slug: "integrations/toolkits", + type: "doc", + id: "integrations/tools/index", }, }, { type: "category", - label: "Memory", - collapsed: true, + label: "Key-value stores", + collapsible: false, items: [ { type: "autogenerated", - dirName: "integrations/memory", + dirName: "integrations/stores", + className: "hidden", }, ], link: { - type: "generated-index", - slug: "integrations/memory", + type: "doc", + id: "integrations/stores/index", }, }, { type: "category", - label: "Graphs", + label: "Other", collapsed: true, items: [ { - type: "autogenerated", - dirName: "integrations/graphs", + type: "category", + label: "Document transformers", + collapsible: false, + items: [ + { + type: "autogenerated", + dirName: "integrations/document_transformers", + className: "hidden", + }, + ], + link: { + type: "generated-index", + slug: "integrations/document_transformers", + }, }, - ], - link: { - type: "generated-index", - slug: "integrations/graphs", - }, - }, - { - type: "category", - label: "Callbacks", - collapsed: true, - items: [ { - type: "autogenerated", - dirName: "integrations/callbacks", + type: "category", + label: "Graphs", + collapsible: false, + items: [ + { + type: "autogenerated", + dirName: "integrations/graphs", + className: "hidden", + }, + ], + link: { + type: "generated-index", + slug: "integrations/graphs", + }, }, - ], - link: { - type: "generated-index", - slug: "integrations/callbacks", - }, - }, - { - type: "category", - label: "Chat loaders", - collapsed: true, - items: [ { - type: "autogenerated", - dirName: "integrations/chat_loaders", + type: "category", + label: "Memory", + collapsible: false, + items: [ + { + type: "autogenerated", + dirName: "integrations/memory", + className: "hidden", + }, + ], + link: { + type: "generated-index", + slug: "integrations/memory", + }, }, - ], - link: { - type: "generated-index", - slug: "integrations/chat_loaders", - }, - }, - { - type: "category", - label: "Adapters", - collapsed: true, - items: [ { - type: "autogenerated", - dirName: "integrations/adapters", + type: "category", + label: "Callbacks", + collapsible: false, + items: [ + { + type: "autogenerated", + dirName: "integrations/callbacks", + className: "hidden", + }, + ], + link: { + type: "generated-index", + slug: "integrations/callbacks", + }, }, - ], - link: { - type: "generated-index", - slug: "integrations/adapters", - }, - }, - { - type: "category", - label: "Key-value stores", - collapsed: true, - items: [ { - type: "autogenerated", - dirName: "integrations/stores", + type: "category", + label: "Chat loaders", + collapsible: false, + items: [ + { + type: "autogenerated", + dirName: "integrations/chat_loaders", + className: "hidden", + }, + ], + link: { + type: "generated-index", + slug: "integrations/chat_loaders", + }, + }, + { + type: "category", + label: "Adapters", + collapsible: false, + items: [ + { + type: "autogenerated", + dirName: "integrations/adapters", + className: "hidden", + }, + ], + link: { + type: "generated-index", + slug: "integrations/adapters", + }, }, ], - link: { - type: "doc", - id: "integrations/stores/index", - }, }, ], link: { diff --git a/docs/core_docs/src/theme/FeatureTables.js b/docs/core_docs/src/theme/FeatureTables.js new file mode 100644 index 000000000000..a1c66228b238 --- /dev/null +++ b/docs/core_docs/src/theme/FeatureTables.js @@ -0,0 +1,832 @@ +/* eslint-disable import/no-extraneous-dependencies */ +/* eslint-disable prefer-template */ +import React from "react"; +import { useCurrentSidebarCategory } from "@docusaurus/theme-common"; +import { useDocById } from "@docusaurus/theme-common/internal"; + +const FEATURE_TABLES = { + chat: { + link: "/docs/integrations/chat", + columns: [ + { + title: "Provider", + formatter: (item) => {item.name}, + }, + { + title: Tool calling, + formatter: (item) => (item.tool_calling ? "✅" : "❌"), + }, + { + title: Structured output, + formatter: (item) => (item.structured_output ? "✅" : "❌"), + }, + { + title: "JSON mode", + formatter: (item) => (item.json_mode ? "✅" : "❌"), + }, + { title: "Local", formatter: (item) => (item.local ? "✅" : "❌") }, + { + title: Multimodal, + formatter: (item) => (item.multimodal ? "✅" : "❌"), + }, + { + title: "Package", + formatter: (item) => {item.package}, + }, + ], + items: [ + { + name: "ChatAnthropic", + package: "langchain-anthropic", + link: "anthropic/", + structured_output: true, + tool_calling: true, + json_mode: false, + multimodal: true, + local: false, + apiLink: + "https://api.python.langchain.com/en/latest/chat_models/langchain_anthropic.chat_models.ChatAnthropic.html#langchain_anthropic.chat_models.ChatAnthropic", + }, + { + name: "ChatMistralAI", + package: "langchain-mistralai", + link: "mistralai/", + structured_output: true, + tool_calling: true, + json_mode: false, + multimodal: false, + local: false, + apiLink: + "https://api.python.langchain.com/en/latest/chat_models/langchain_mistralai.chat_models.ChatMistralAI.html#langchain_mistralai.chat_models.ChatMistralAI", + }, + { + name: "ChatFireworks", + package: "langchain-fireworks", + link: "fireworks/", + structured_output: true, + tool_calling: true, + json_mode: true, + multimodal: false, + local: false, + apiLink: + "https://api.python.langchain.com/en/latest/chat_models/langchain_fireworks.chat_models.ChatFireworks.html#langchain_fireworks.chat_models.ChatFireworks", + }, + { + name: "AzureChatOpenAI", + package: "langchain-openai", + link: "azure_chat_openai/", + structured_output: true, + tool_calling: true, + json_mode: true, + multimodal: true, + local: false, + apiLink: + "https://api.python.langchain.com/en/latest/chat_models/langchain_openai.chat_models.azure.AzureChatOpenAI.html#langchain_openai.chat_models.azure.AzureChatOpenAI", + }, + { + name: "ChatOpenAI", + package: "langchain-openai", + link: "openai/", + structured_output: true, + tool_calling: true, + json_mode: true, + multimodal: true, + local: false, + apiLink: + "https://api.python.langchain.com/en/latest/chat_models/langchain_openai.chat_models.base.ChatOpenAI.html#langchain_openai.chat_models.base.ChatOpenAI", + }, + { + name: "ChatTogether", + package: "langchain-together", + link: "together/", + structured_output: true, + tool_calling: true, + json_mode: true, + multimodal: false, + local: false, + apiLink: + "https://api.python.langchain.com/en/latest/chat_models/langchain_together.chat_models.ChatTogether.html#langchain_together.chat_models.ChatTogether", + }, + { + name: "ChatVertexAI", + package: "langchain-google-vertexai", + link: "google_vertex_ai_palm/", + structured_output: true, + tool_calling: true, + json_mode: false, + multimodal: true, + local: false, + apiLink: + "https://api.python.langchain.com/en/latest/chat_models/langchain_google_vertexai.chat_models.ChatVertexAI.html#langchain_google_vertexai.chat_models.ChatVertexAI", + }, + { + name: "ChatGoogleGenerativeAI", + package: "langchain-google-genai", + link: "google_generative_ai/", + structured_output: true, + tool_calling: true, + json_mode: false, + multimodal: true, + local: false, + apiLink: + "https://api.python.langchain.com/en/latest/chat_models/langchain_google_genai.chat_models.ChatGoogleGenerativeAI.html#langchain_google_genai.chat_models.ChatGoogleGenerativeAI", + }, + { + name: "ChatGroq", + package: "langchain-groq", + link: "groq/", + structured_output: true, + tool_calling: true, + json_mode: true, + multimodal: false, + local: false, + apiLink: + "https://api.python.langchain.com/en/latest/chat_models/langchain_groq.chat_models.ChatGroq.html#langchain_groq.chat_models.ChatGroq", + }, + { + name: "ChatCohere", + package: "langchain-cohere", + link: "cohere/", + structured_output: true, + tool_calling: true, + json_mode: false, + multimodal: false, + local: false, + apiLink: + "https://api.python.langchain.com/en/latest/chat_models/langchain_cohere.chat_models.ChatCohere.html#langchain_cohere.chat_models.ChatCohere", + }, + { + name: "ChatBedrock", + package: "langchain-aws", + link: "bedrock/", + structured_output: true, + tool_calling: true, + json_mode: false, + multimodal: false, + local: false, + apiLink: + "https://api.python.langchain.com/en/latest/chat_models/langchain_aws.chat_models.bedrock.ChatBedrock.html#langchain_aws.chat_models.bedrock.ChatBedrock", + }, + { + name: "ChatHuggingFace", + package: "langchain-huggingface", + link: "huggingface/", + structured_output: true, + tool_calling: true, + json_mode: false, + multimodal: false, + local: true, + apiLink: + "https://api.python.langchain.com/en/latest/chat_models/langchain_huggingface.chat_models.huggingface.ChatHuggingFace.html#langchain_huggingface.chat_models.huggingface.ChatHuggingFace", + }, + { + name: "ChatNVIDIA", + package: "langchain-nvidia-ai-endpoints", + link: "nvidia_ai_endpoints/", + structured_output: true, + tool_calling: true, + json_mode: false, + multimodal: false, + local: true, + apiLink: + "https://api.python.langchain.com/en/latest/chat_models/langchain_nvidia_ai_endpoints.chat_models.ChatNVIDIA.html#langchain_nvidia_ai_endpoints.chat_models.ChatNVIDIA", + }, + { + name: "ChatOllama", + package: "langchain-ollama", + link: "ollama/", + structured_output: true, + tool_calling: true, + json_mode: true, + multimodal: false, + local: true, + apiLink: + "https://api.python.langchain.com/en/latest/chat_models/langchain_ollama.chat_models.ChatOllama.html#langchain_ollama.chat_models.ChatOllama", + }, + { + name: "ChatLlamaCpp", + package: "langchain-community", + link: "llamacpp", + structured_output: true, + tool_calling: true, + json_mode: false, + multimodal: false, + local: true, + apiLink: + "https://api.python.langchain.com/en/latest/chat_models/langchain_community.chat_models.llamacpp.ChatLlamaCpp.html#langchain_community.chat_models.llamacpp.ChatLlamaCpp", + }, + { + name: "ChatAI21", + package: "langchain-ai21", + link: "ai21", + structured_output: true, + tool_calling: true, + json_mode: false, + multimodal: false, + local: false, + apiLink: + "https://api.python.langchain.com/en/latest/chat_models/langchain_ai21.chat_models.ChatAI21.html#langchain_ai21.chat_models.ChatAI21", + }, + { + name: "ChatUpstage", + package: "langchain-upstage", + link: "upstage", + structured_output: true, + tool_calling: true, + json_mode: false, + multimodal: false, + local: false, + apiLink: + "https://api.python.langchain.com/en/latest/chat_models/langchain_upstage.chat_models.ChatUpstage.html#langchain_upstage.chat_models.ChatUpstage", + }, + ], + }, + llms: { + link: "/docs/integrations/llms", + columns: [ + { + title: "Provider", + formatter: (item) => {item.name}, + }, + { + title: "Package", + formatter: (item) => {item.package}, + }, + ], + items: [ + { + name: "AI21LLM", + link: "ai21", + package: "langchain-ai21", + apiLink: + "https://api.python.langchain.com/en/latest/llms/langchain_ai21.llms.AI21LLM.html#langchain_ai21.llms.AI21LLM", + }, + { + name: "AnthropicLLM", + link: "anthropic", + package: "langchain-anthropic", + apiLink: + "https://api.python.langchain.com/en/latest/llms/langchain_anthropic.llms.AnthropicLLM.html#langchain_anthropic.llms.AnthropicLLM", + }, + { + name: "AzureOpenAI", + link: "azure_openai", + package: "langchain-openai", + apiLink: + "https://api.python.langchain.com/en/latest/llms/langchain_openai.llms.azure.AzureOpenAI.html#langchain_openai.llms.azure.AzureOpenAI", + }, + { + name: "BedrockLLM", + link: "bedrock", + package: "langchain-aws", + apiLink: + "https://api.python.langchain.com/en/latest/llms/langchain_aws.llms.bedrock.BedrockLLM.html#langchain_aws.llms.bedrock.BedrockLLM", + }, + { + name: "CohereLLM", + link: "cohere", + package: "langchain-cohere", + apiLink: + "https://api.python.langchain.com/en/latest/llms/langchain_cohere.llms.Cohere.html#langchain_cohere.llms.Cohere", + }, + { + name: "FireworksLLM", + link: "fireworks", + package: "langchain-fireworks", + apiLink: + "https://api.python.langchain.com/en/latest/llms/langchain_fireworks.llms.Fireworks.html#langchain_fireworks.llms.Fireworks", + }, + { + name: "OllamaLLM", + link: "ollama", + package: "langchain-ollama", + apiLink: + "https://api.python.langchain.com/en/latest/llms/langchain_ollama.llms.OllamaLLM.html#langchain_ollama.llms.OllamaLLM", + }, + { + name: "OpenAILLM", + link: "openai", + package: "langchain-openai", + apiLink: + "https://api.python.langchain.com/en/latest/llms/langchain_openai.llms.base.OpenAI.html#langchain_openai.llms.base.OpenAI", + }, + { + name: "TogetherLLM", + link: "together", + package: "langchain-together", + apiLink: + "https://api.python.langchain.com/en/latest/llms/langchain_together.llms.Together.html#langchain_together.llms.Together", + }, + { + name: "VertexAILLM", + link: "google_vertexai", + package: "langchain-google_vertexai", + apiLink: + "https://api.python.langchain.com/en/latest/llms/langchain_google_vertexai.llms.VertexAI.html#langchain_google_vertexai.llms.VertexAI", + }, + ], + }, + text_embedding: { + link: "/docs/integrations/text_embedding", + columns: [ + { + title: "Provider", + formatter: (item) => {item.name}, + }, + { + title: "Package", + formatter: (item) => {item.package}, + }, + ], + items: [ + { + name: "AzureOpenAI", + link: "azureopenai", + package: "langchain-openai", + apiLink: + "https://api.python.langchain.com/en/latest/embeddings/langchain_openai.embeddings.azure.AzureOpenAIEmbeddings.html#langchain_openai.embeddings.azure.AzureOpenAIEmbeddings", + }, + { + name: "Ollama", + link: "ollama", + package: "langchain-ollama", + apiLink: + "https://api.python.langchain.com/en/latest/embeddings/langchain_ollama.embeddings.OllamaEmbeddings.html#langchain_ollama.embeddings.OllamaEmbeddings", + }, + { + name: "AI21", + link: "ai21", + package: "langchain-ai21", + apiLink: + "https://api.python.langchain.com/en/latest/embeddings/langchain_ai21.embeddings.AI21Embeddings.html#langchain_ai21.embeddings.AI21Embeddings", + }, + { + name: "Fake", + link: "fake", + package: "langchain-core", + apiLink: + "https://api.python.langchain.com/en/latest/embeddings/langchain_core.embeddings.fake.FakeEmbeddings.html#langchain_core.embeddings.fake.FakeEmbeddings", + }, + { + name: "OpenAI", + link: "openai", + package: "langchain-openai", + apiLink: + "https://api.python.langchain.com/en/latest/chat_models/langchain_openai.chat_models.base.ChatOpenAI.html#langchain_openai.chat_models.base.ChatOpenAI", + }, + { + name: "Together", + link: "together", + package: "langchain-together", + apiLink: + "https://api.python.langchain.com/en/latest/embeddings/langchain_together.embeddings.TogetherEmbeddings.html#langchain_together.embeddings.TogetherEmbeddings", + }, + { + name: "Fireworks", + link: "fireworks", + package: "langchain-fireworks", + apiLink: + "https://api.python.langchain.com/en/latest/embeddings/langchain_fireworks.embeddings.FireworksEmbeddings.html#langchain_fireworks.embeddings.FireworksEmbeddings", + }, + { + name: "MistralAI", + link: "mistralai", + package: "langchain-mistralai", + apiLink: + "https://api.python.langchain.com/en/latest/embeddings/langchain_mistralai.embeddings.MistralAIEmbeddings.html#langchain_mistralai.embeddings.MistralAIEmbeddings", + }, + { + name: "Cohere", + link: "cohere", + package: "langchain-cohere", + apiLink: + "https://api.python.langchain.com/en/latest/embeddings/langchain_cohere.embeddings.CohereEmbeddings.html#langchain_cohere.embeddings.CohereEmbeddings", + }, + ], + }, + document_retrievers: { + link: "docs/integrations/retrievers", + columns: [ + { + title: "Retriever", + formatter: (item) => {item.name}, + }, + { + title: "Self-host", + formatter: (item) => (item.selfHost ? "✅" : "❌"), + }, + { + title: "Cloud offering", + formatter: (item) => (item.cloudOffering ? "✅" : "❌"), + }, + { + title: "Package", + formatter: (item) => {item.package}, + }, + ], + items: [ + { + name: "AmazonKnowledgeBasesRetriever", + link: "bedrock", + selfHost: false, + cloudOffering: true, + apiLink: + "https://api.python.langchain.com/en/latest/retrievers/langchain_aws.retrievers.bedrock.AmazonKnowledgeBasesRetriever.html", + package: "langchain_aws", + }, + { + name: "AzureAISearchRetriever", + link: "azure_ai_search", + selfHost: false, + cloudOffering: true, + apiLink: + "https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.azure_ai_search.AzureAISearchRetriever.html", + package: "langchain_community", + }, + { + name: "ElasticsearchRetriever", + link: "elasticsearch_retriever", + selfHost: true, + cloudOffering: true, + apiLink: + "https://api.python.langchain.com/en/latest/retrievers/langchain_elasticsearch.retrievers.ElasticsearchRetriever.html", + package: "langchain_elasticsearch", + }, + { + name: "MilvusCollectionHybridSearchRetriever", + link: "milvus_hybrid_search", + selfHost: true, + cloudOffering: false, + apiLink: + "https://api.python.langchain.com/en/latest/retrievers/langchain_milvus.retrievers.milvus_hybrid_search.MilvusCollectionHybridSearchRetriever.html", + package: "langchain_milvus", + }, + { + name: "VertexAISearchRetriever", + link: "google_vertex_ai_search", + selfHost: false, + cloudOffering: true, + apiLink: + "https://api.python.langchain.com/en/latest/vertex_ai_search/langchain_google_community.vertex_ai_search.VertexAISearchRetriever.html", + package: "langchain_google_community", + }, + ], + }, + external_retrievers: { + link: "docs/integrations/retrievers", + columns: [ + { + title: "Retriever", + formatter: (item) => {item.name}, + }, + { title: "Source", formatter: (item) => item.source }, + { + title: "Package", + formatter: (item) => {item.package}, + }, + ], + items: [ + { + name: "ArxivRetriever", + link: "arxiv", + source: ( + <> + Scholarly articles on arxiv.org + + ), + apiLink: + "https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.arxiv.ArxivRetriever.html", + package: "langchain_community", + }, + { + name: "TavilySearchAPIRetriever", + link: "tavily", + source: "Internet search", + apiLink: + "https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.tavily_search_api.TavilySearchAPIRetriever.html", + package: "langchain_community", + }, + { + name: "WikipediaRetriever", + link: "wikipedia", + source: ( + <> + Wikipedia articles + + ), + apiLink: + "https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.wikipedia.WikipediaRetriever.html", + package: "langchain_community", + }, + ], + }, + document_loaders: { + link: "docs/integrations/loaders", + columns: [], + items: [], + }, + vectorstores: { + link: "docs/integrations/vectorstores", + columns: [ + { + title: "Vectorstore", + formatter: (item) => {item.name}, + }, + { + title: "Delete by ID", + formatter: (item) => (item.deleteById ? "✅" : "❌"), + }, + { + title: "Filtering", + formatter: (item) => (item.filtering ? "✅" : "❌"), + }, + { + title: "Search by Vector", + formatter: (item) => (item.searchByVector ? "✅" : "❌"), + }, + { + title: "Search with score", + formatter: (item) => (item.searchWithScore ? "✅" : "❌"), + }, + { title: "Async", formatter: (item) => (item.async ? "✅" : "❌") }, + { + title: "Passes Standard Tests", + formatter: (item) => (item.passesStandardTests ? "✅" : "❌"), + }, + { + title: "Multi Tenancy", + formatter: (item) => (item.multiTenancy ? "✅" : "❌"), + }, + { + title: "IDs in add Documents", + formatter: (item) => (item.idsInAddDocuments ? "✅" : "❌"), + }, + { + title: "Local/Cloud", + formatter: (item) => (item.local ? "Local" : "Cloud"), + }, + ], + items: [ + { + name: "AstraDBVectorStore", + link: "astradb", + deleteById: true, + filtering: true, + searchByVector: true, + searchWithScore: true, + async: true, + passesStandardTests: false, + multiTenancy: false, + local: true, + idsInAddDocuments: false, + }, + { + name: "Chroma", + link: "chroma", + deleteById: true, + filtering: true, + searchByVector: true, + searchWithScore: true, + async: true, + passesStandardTests: false, + multiTenancy: false, + local: true, + idsInAddDocuments: false, + }, + { + name: "Clickhouse", + link: "clickhouse", + deleteById: true, + filtering: true, + searchByVector: false, + searchWithScore: true, + async: false, + passesStandardTests: false, + multiTenancy: false, + local: true, + idsInAddDocuments: false, + }, + { + name: "CouchbaseVectorStore", + link: "couchbase", + deleteById: true, + filtering: true, + searchByVector: false, + searchWithScore: true, + async: true, + passesStandardTests: false, + multiTenancy: false, + local: true, + idsInAddDocuments: false, + }, + { + name: "ElasticsearchStore", + link: "elasticsearch", + deleteById: true, + filtering: true, + searchByVector: true, + searchWithScore: false, + async: true, + passesStandardTests: false, + multiTenancy: false, + local: true, + idsInAddDocuments: false, + }, + { + name: "FAISS", + link: "faiss", + deleteById: true, + filtering: true, + searchByVector: true, + searchWithScore: true, + async: true, + passesStandardTests: false, + multiTenancy: false, + local: true, + idsInAddDocuments: false, + }, + { + name: "InMemoryVectorStore", + link: "in_memory", + deleteById: true, + filtering: true, + searchByVector: false, + searchWithScore: true, + async: true, + passesStandardTests: false, + multiTenancy: false, + local: true, + idsInAddDocuments: false, + }, + { + name: "Milvus", + link: "milvus", + deleteById: true, + filtering: true, + searchByVector: false, + searchWithScore: true, + async: true, + passesStandardTests: false, + multiTenancy: false, + local: true, + idsInAddDocuments: false, + }, + { + name: "MongoDBAtlasVectorSearch", + link: "mongodb_atlas", + deleteById: true, + filtering: true, + searchByVector: false, + searchWithScore: false, + async: true, + passesStandardTests: false, + multiTenancy: false, + local: true, + idsInAddDocuments: false, + }, + { + name: "PGVector", + link: "pg_vector", + deleteById: true, + filtering: true, + searchByVector: true, + searchWithScore: true, + async: true, + passesStandardTests: false, + multiTenancy: false, + local: true, + idsInAddDocuments: false, + }, + { + name: "PineconeVectorStore", + link: "pinecone", + deleteById: true, + filtering: true, + searchByVector: true, + searchWithScore: false, + async: true, + passesStandardTests: false, + multiTenancy: false, + local: true, + idsInAddDocuments: false, + }, + { + name: "QdrantVectorStore", + link: "qdrant", + deleteById: true, + filtering: true, + searchByVector: true, + searchWithScore: true, + async: true, + passesStandardTests: false, + multiTenancy: false, + local: true, + idsInAddDocuments: false, + }, + { + name: "Redis", + link: "redis", + deleteById: true, + filtering: true, + searchByVector: true, + searchWithScore: true, + async: true, + passesStandardTests: false, + multiTenancy: false, + local: true, + idsInAddDocuments: false, + }, + ], + }, +}; + +const DEPRECATED_DOC_IDS = [ + "integrations/chat/anthropic_tools", + "integrations/chat/baidu_wenxin", + "integrations/chat/google_palm", + "integrations/chat/ni_bittensor", + "integrations/llms/google_palm", + "integrations/llms/ni_bittensor", + "integrations/llms/prompt_layer_openai", + "integrations/text_embedding/google_palm", + "integrations/retrievers/chatgpt-retriever-plugin", + "integrations/tools/aiplugin-tool", + "integrations/tools/zapier_agent", +]; + +function toTable(columns, items) { + const headers = columns.map((col) => col.title); + return ( + + + + {headers.map((header, i) => ( + // eslint-disable-next-line react/no-array-index-key + + ))} + + + + {items.map((item, i) => ( + // eslint-disable-next-line react/no-array-index-key + + {columns.map((col, j) => ( + // eslint-disable-next-line react/no-array-index-key + + ))} + + ))} + +
{header}
{col.formatter(item)}
+ ); +} + +export function CategoryTable({ category }) { + const cat = FEATURE_TABLES[category]; + const rtn = toTable(cat.columns, cat.items); + return rtn; +} + +export function ItemTable({ category, item }) { + const cat = FEATURE_TABLES[category]; + const row = cat.items.find((i) => i.name === item); + if (!row) { + throw new Error(`Item ${item} not found in category ${category}`); + } + const rtn = toTable(cat.columns, [row]); + return rtn; +} + +function truncate(str, n) { + return str.length > n ? str.substring(0, n - 1) + "..." : str; +} + +export function IndexTable() { + const { items } = useCurrentSidebarCategory(); + + const rows = items + .filter( + (item) => + !item.docId?.endsWith?.("/index") && + !DEPRECATED_DOC_IDS.includes(item.docId) + ) + .map((item) => ({ + ...item, + // eslint-disable-next-line react-hooks/rules-of-hooks + description: useDocById(item.docId ?? undefined)?.description, + })); + const rtn = toTable( + [ + { + title: "Name", + formatter: (item) => {item.label}, + }, + { + title: "Description", + formatter: (item) => truncate(item.description ?? "", 70), + }, + ], + rows + ); + return rtn; +}