diff --git a/docs/Makefile b/docs/Makefile index adc664d37cf..2b90623fe86 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -41,12 +41,8 @@ generate-files: cp -r $(SOURCE_DIR)/* $(INTERMEDIATE_DIR) mkdir -p $(INTERMEDIATE_DIR)/templates - $(PYTHON) scripts/model_feat_table.py $(INTERMEDIATE_DIR) - $(PYTHON) scripts/tool_feat_table.py $(INTERMEDIATE_DIR) - $(PYTHON) scripts/document_loader_feat_table.py $(INTERMEDIATE_DIR) - $(PYTHON) scripts/kv_store_feat_table.py $(INTERMEDIATE_DIR) $(PYTHON) scripts/partner_pkg_table.py $(INTERMEDIATE_DIR) @@ -86,7 +82,7 @@ vercel-build: install-vercel-deps build generate-references rm -rf docs mv $(OUTPUT_NEW_DOCS_DIR) docs rm -rf build - yarn run docusaurus build + NODE_OPTIONS="--max-old-space-size=5000" yarn run docusaurus build mv build v0.2 mkdir build mv v0.2 build diff --git a/docs/docs/integrations/chat/index.mdx b/docs/docs/integrations/chat/index.mdx new file mode 100644 index 00000000000..c30c33207a5 --- /dev/null +++ b/docs/docs/integrations/chat/index.mdx @@ -0,0 +1,30 @@ +--- +sidebar_position: 0 +sidebar_class_name: hidden +keywords: [compatibility] +--- + +# Chat models + +:::info + +If you'd like to write your own chat model, see [this how-to](/docs/how_to/custom_chat_model/). +If you'd like to contribute an integration, see [Contributing integrations](/docs/contributing/integrations/). + +::: + +## Featured Providers + +:::info +While all these LangChain classes support the indicated advanced feature, you may have +to open the provider-specific documentation to learn which hosted models or backends support +the feature. +::: + +import { CategoryTable, IndexTable } from "@theme/FeatureTables"; + + + +## All chat models + + \ No newline at end of file diff --git a/docs/docs/integrations/document_loaders/index.mdx b/docs/docs/integrations/document_loaders/index.mdx new file mode 100644 index 00000000000..32bb8e4f74e --- /dev/null +++ b/docs/docs/integrations/document_loaders/index.mdx @@ -0,0 +1,12 @@ +--- +sidebar_position: 0 +sidebar_class_name: hidden +--- + +# Document loaders + +import { CategoryTable, IndexTable } from "@theme/FeatureTables"; + +## All document loaders + + diff --git a/docs/docs/integrations/llms/index.mdx b/docs/docs/integrations/llms/index.mdx new file mode 100644 index 00000000000..3d8869f235f --- /dev/null +++ b/docs/docs/integrations/llms/index.mdx @@ -0,0 +1,30 @@ +--- +sidebar_position: 0 +sidebar_class_name: hidden +keywords: [compatibility] +--- + +# LLMs + +:::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/integrations/). + +::: + +## Features (natively supported) +All LLMs implement the Runnable interface, which comes with default implementations of all methods, ie. `ainvoke`, `batch`, `abatch`, `stream`, `astream`. This gives all LLMs basic support for async, streaming and batch, which by default is implemented as below: +- *Async* support defaults to calling the respective sync method in asyncio's default thread pool executor. This lets other async functions in your application make progress while the LLM is being executed, by moving this call to a background thread. +- *Streaming* support defaults to returning an `Iterator` (or `AsyncIterator` in the case of async streaming) 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 by making use of a thread pool executor (in the sync batch case) or `asyncio.gather` (in the async batch case). The concurrency can be controlled with the `max_concurrency` key in `RunnableConfig`. + +Each LLM integration can optionally provide native implementations for async, 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. + +import { CategoryTable, IndexTable } from "@theme/FeatureTables"; + + + +## All LLMs + + diff --git a/docs/docs/integrations/retrievers/arxiv.ipynb b/docs/docs/integrations/retrievers/arxiv.ipynb index 5e56ce2a418..9fb9271ed90 100644 --- a/docs/docs/integrations/retrievers/arxiv.ipynb +++ b/docs/docs/integrations/retrievers/arxiv.ipynb @@ -1,7 +1,7 @@ { "cells": [ { - "cell_type": "markdown", + "cell_type": "raw", "id": "00a924a0-57e2-43fa-95dc-3ea48a56d3a5", "metadata": {}, "source": [ @@ -17,8 +17,6 @@ "source": [ "# ArxivRetriever\n", "\n", - "## Overview\n", - "\n", ">[arXiv](https://arxiv.org/) is an open-access archive for 2 million scholarly articles in the fields of physics, mathematics, computer science, quantitative biology, quantitative finance, statistics, electrical engineering and systems science, and economics.\n", "\n", "This notebook shows how to retrieve scientific articles from Arxiv.org into the [Document](https://api.python.langchain.com/en/latest/documents/langchain_core.documents.base.Document.html) format that is used downstream.\n", @@ -27,9 +25,9 @@ "\n", "### Integration details\n", "\n", - "| Retriever | Source | Package |\n", - "| :--- | :--- | :---: |\n", - "[ArxivRetriever](https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.arxiv.ArxivRetriever.html) | Scholarly articles on [arxiv.org](https://arxiv.org/) | langchain_community |\n", + "import {ItemTable} from \"@theme/FeatureTables\";\n", + "\n", + "\n", "\n", "## Setup\n", "\n", diff --git a/docs/docs/integrations/retrievers/azure_ai_search.ipynb b/docs/docs/integrations/retrievers/azure_ai_search.ipynb index 29f933c7148..c564884edb8 100644 --- a/docs/docs/integrations/retrievers/azure_ai_search.ipynb +++ b/docs/docs/integrations/retrievers/azure_ai_search.ipynb @@ -1,7 +1,7 @@ { "cells": [ { - "cell_type": "markdown", + "cell_type": "raw", "id": "f9a62e19-b00b-4f6c-a700-1e500e4c290a", "metadata": {}, "source": [ @@ -17,7 +17,6 @@ "source": [ "# AzureAISearchRetriever\n", "\n", - "## Overview\n", "[Azure AI Search](https://learn.microsoft.com/azure/search/search-what-is-azure-search) (formerly known as `Azure Cognitive Search`) is a Microsoft cloud search service that gives developers infrastructure, APIs, and tools for information retrieval of vector, keyword, and hybrid queries at scale.\n", "\n", "`AzureAISearchRetriever` is an integration module that returns documents from an unstructured query. It's based on the BaseRetriever class and it targets the 2023-11-01 stable REST API version of Azure AI Search, which means it supports vector indexing and queries.\n", @@ -28,9 +27,9 @@ "\n", "### Integration details\n", "\n", - "| Retriever | Self-host | Cloud offering | Package |\n", - "| :--- | :--- | :---: | :---: |\n", - "[AzureAISearchRetriever](https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.azure_ai_search.AzureAISearchRetriever.html) | ❌ | ✅ | langchain_community |\n", + "import {ItemTable} from \"@theme/FeatureTables\";\n", + "\n", + "\n", "\n", "\n", "## Setup\n", diff --git a/docs/docs/integrations/retrievers/bedrock.ipynb b/docs/docs/integrations/retrievers/bedrock.ipynb index b5ad52bc42e..d7a5099193c 100644 --- a/docs/docs/integrations/retrievers/bedrock.ipynb +++ b/docs/docs/integrations/retrievers/bedrock.ipynb @@ -1,7 +1,7 @@ { "cells": [ { - "cell_type": "markdown", + "cell_type": "raw", "id": "b0872249-1af5-4d54-b816-1babad7a8c9e", "metadata": {}, "source": [ @@ -17,8 +17,6 @@ "source": [ "# Bedrock (Knowledge Bases) Retriever\n", "\n", - "## Overview\n", - "\n", "This guide will help you getting started with the AWS Knowledge Bases [retriever](/docs/concepts/#retrievers).\n", "\n", "[Knowledge Bases for Amazon Bedrock](https://aws.amazon.com/bedrock/knowledge-bases/) is an Amazon Web Services (AWS) offering which lets you quickly build RAG applications by using your private data to customize FM response.\n", @@ -29,9 +27,9 @@ "\n", "### Integration details\n", "\n", - "| Retriever | Self-host | Cloud offering | Package |\n", - "| :--- | :--- | :---: | :---: |\n", - "[AmazonKnowledgeBasesRetriever](https://api.python.langchain.com/en/latest/retrievers/langchain_aws.retrievers.bedrock.AmazonKnowledgeBasesRetriever.html) | ❌ | ✅ | langchain_aws |\n" + "import {ItemTable} from \"@theme/FeatureTables\";\n", + "\n", + "\n" ] }, { diff --git a/docs/docs/integrations/retrievers/elasticsearch_retriever.ipynb b/docs/docs/integrations/retrievers/elasticsearch_retriever.ipynb index b7e6b755508..282360b7b9a 100644 --- a/docs/docs/integrations/retrievers/elasticsearch_retriever.ipynb +++ b/docs/docs/integrations/retrievers/elasticsearch_retriever.ipynb @@ -1,7 +1,7 @@ { "cells": [ { - "cell_type": "markdown", + "cell_type": "raw", "id": "41ccce84-f6d9-4ba0-8281-22cbf29f20d3", "metadata": {}, "source": [ @@ -17,7 +17,6 @@ "source": [ "# ElasticsearchRetriever\n", "\n", - "## Overview\n", ">[Elasticsearch](https://www.elastic.co/elasticsearch/) is a distributed, RESTful search and analytics engine. It provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents. It supports keyword search, vector search, hybrid search and complex filtering.\n", "\n", "The `ElasticsearchRetriever` is a generic wrapper to enable flexible access to all `Elasticsearch` features through the [Query DSL](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html). For most use cases the other classes (`ElasticsearchStore`, `ElasticsearchEmbeddings`, etc.) should suffice, but if they don't you can use `ElasticsearchRetriever`.\n", @@ -26,9 +25,9 @@ "\n", "### Integration details\n", "\n", - "| Retriever | Self-host | Cloud offering | Package |\n", - "| :--- | :--- | :---: | :---: |\n", - "[ElasticsearchRetriever](https://api.python.langchain.com/en/latest/retrievers/langchain_elasticsearch.retrievers.ElasticsearchRetriever.html) | ✅ | ✅ | langchain_elasticsearch |\n", + "import {ItemTable} from \"@theme/FeatureTables\";\n", + "\n", + "\n", "\n", "\n", "## Setup\n", diff --git a/docs/docs/integrations/retrievers/google_vertex_ai_search.ipynb b/docs/docs/integrations/retrievers/google_vertex_ai_search.ipynb index 8a254a1a85a..7f16b66499c 100644 --- a/docs/docs/integrations/retrievers/google_vertex_ai_search.ipynb +++ b/docs/docs/integrations/retrievers/google_vertex_ai_search.ipynb @@ -1,7 +1,7 @@ { "cells": [ { - "cell_type": "markdown", + "cell_type": "raw", "metadata": {}, "source": [ "---\n", @@ -15,8 +15,6 @@ "source": [ "# Google Vertex AI Search\n", "\n", - "## Overview\n", - "\n", ">[Google Vertex AI Search](https://cloud.google.com/enterprise-search) (formerly known as `Enterprise Search` on `Generative AI App Builder`) is a part of the [Vertex AI](https://cloud.google.com/vertex-ai) machine learning platform offered by `Google Cloud`.\n", ">\n", ">`Vertex AI Search` lets organizations quickly build generative AI-powered search engines for customers and employees. It's underpinned by a variety of `Google Search` technologies, including semantic search, which helps deliver more relevant results than traditional keyword-based search techniques by using natural language processing and machine learning techniques to infer relationships within the content and intent from the user’s query input. Vertex AI Search also benefits from Google’s expertise in understanding how users search and factors in content relevance to order displayed results.\n", @@ -29,9 +27,9 @@ "\n", "### Integration details\n", "\n", - "| Retriever | Self-host | Cloud offering | Package |\n", - "| :--- | :--- | :---: | :---: |\n", - "[VertexAISearchRetriever](https://api.python.langchain.com/en/latest/vertex_ai_search/langchain_google_community.vertex_ai_search.VertexAISearchRetriever.html) | ❌ | ✅ | langchain_google_community |\n", + "import {ItemTable} from \"@theme/FeatureTables\";\n", + "\n", + "\n", "\n", "\n", "## Setup\n", diff --git a/docs/docs/integrations/retrievers/index.mdx b/docs/docs/integrations/retrievers/index.mdx index df29551331f..39d65f936eb 100644 --- a/docs/docs/integrations/retrievers/index.mdx +++ b/docs/docs/integrations/retrievers/index.mdx @@ -3,6 +3,8 @@ 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. @@ -22,20 +24,14 @@ This page lists custom retrievers, implemented via subclassing [BaseRetriever](/ The below retrievers allow you to index and search a custom corpus of documents. -| Retriever | Self-host | Cloud offering | Package | -|-----------|-----------|----------------|---------| -| [AmazonKnowledgeBasesRetriever](/docs/integrations/retrievers/bedrock) | ❌ | ✅ | [langchain_aws](https://api.python.langchain.com/en/latest/retrievers/langchain_aws.retrievers.bedrock.AmazonKnowledgeBasesRetriever.html) | -| [AzureAISearchRetriever](/docs/integrations/retrievers/azure_ai_search) | ❌ | ✅ | [langchain_community](https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.azure_ai_search.AzureAISearchRetriever.html) | -| [ElasticsearchRetriever](/docs/integrations/retrievers/elasticsearch_retriever) | ✅ | ✅ | [langchain_elasticsearch](https://api.python.langchain.com/en/latest/retrievers/langchain_elasticsearch.retrievers.ElasticsearchRetriever.html) | -| [MilvusCollectionHybridSearchRetriever](/docs/integrations/retrievers/milvus_hybrid_search) | ✅ | ❌ | [langchain_milvus](https://api.python.langchain.com/en/latest/retrievers/langchain_milvus.retrievers.milvus_hybrid_search.MilvusCollectionHybridSearchRetriever.html) | -| [VertexAISearchRetriever](/docs/integrations/retrievers/google_vertex_ai_search) | ❌ | ✅ | [langchain_google_community](https://api.python.langchain.com/en/latest/vertex_ai_search/langchain_google_community.vertex_ai_search.VertexAISearchRetriever.html) | + ## External index The below retrievers will search over an external index (e.g., constructed from Internet data or similar). -| Retriever | Source | Package | -|-----------|--------|---------| -| [ArxivRetriever](/docs/integrations/retrievers/arxiv) | Scholarly articles on [arxiv.org](https://arxiv.org/) | [langchain_community](https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.arxiv.ArxivRetriever.html) | -| [TavilySearchAPIRetriever](/docs/integrations/retrievers/tavily) | Internet search | [langchain_community](https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.tavily_search_api.TavilySearchAPIRetriever.html) | -| [WikipediaRetriever](/docs/integrations/retrievers/wikipedia) | [Wikipedia](https://www.wikipedia.org/) articles | [langchain_community](https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.wikipedia.WikipediaRetriever.html) | + + +## All retrievers + + diff --git a/docs/docs/integrations/retrievers/milvus_hybrid_search.ipynb b/docs/docs/integrations/retrievers/milvus_hybrid_search.ipynb index dcd4c8cc7bc..ecbffde9887 100644 --- a/docs/docs/integrations/retrievers/milvus_hybrid_search.ipynb +++ b/docs/docs/integrations/retrievers/milvus_hybrid_search.ipynb @@ -1,7 +1,7 @@ { "cells": [ { - "cell_type": "markdown", + "cell_type": "raw", "metadata": {}, "source": [ "---\n", @@ -15,8 +15,6 @@ "source": [ "# Milvus Hybrid Search Retriever\n", "\n", - "## Overview\n", - "\n", "> [Milvus](https://milvus.io/docs) is an open-source vector database built to power embedding similarity search and AI applications. Milvus makes unstructured data search more accessible, and provides a consistent user experience regardless of the deployment environment.\n", "\n", "This will help you getting started with the Milvus Hybrid Search [retriever](/docs/concepts/#retrievers), which combines the strengths of both dense and sparse vector search. For detailed documentation of all `MilvusCollectionHybridSearchRetriever` features and configurations head to the [API reference](https://api.python.langchain.com/en/latest/retrievers/langchain_milvus.retrievers.milvus_hybrid_search.MilvusCollectionHybridSearchRetriever.html).\n", @@ -25,11 +23,9 @@ "\n", "### Integration details\n", "\n", - "| Retriever | Self-host | Cloud offering | Package |\n", - "| :--- | :--- | :---: | :---: |\n", - "[MilvusCollectionHybridSearchRetriever](https://api.python.langchain.com/en/latest/retrievers/langchain_milvus.retrievers.milvus_hybrid_search.MilvusCollectionHybridSearchRetriever.html) | ✅ | ❌ | langchain_milvus |\n", - "\n", + "import {ItemTable} from \"@theme/FeatureTables\";\n", "\n", + "\n", "\n", "## Setup\n", "\n", diff --git a/docs/docs/integrations/retrievers/tavily.ipynb b/docs/docs/integrations/retrievers/tavily.ipynb index 604caff33ef..b74ae5d0b00 100644 --- a/docs/docs/integrations/retrievers/tavily.ipynb +++ b/docs/docs/integrations/retrievers/tavily.ipynb @@ -1,7 +1,7 @@ { "cells": [ { - "cell_type": "markdown", + "cell_type": "raw", "metadata": {}, "source": [ "---\n", @@ -15,16 +15,15 @@ "source": [ "# TavilySearchAPIRetriever\n", "\n", - "## Overview\n", ">[Tavily's Search API](https://tavily.com) is a search engine built specifically for AI agents (LLMs), delivering real-time, accurate, and factual results at speed.\n", "\n", "We can use this as a [retriever](/docs/how_to#retrievers). It will show functionality specific to this integration. After going through, it may be useful to explore [relevant use-case pages](/docs/how_to#qa-with-rag) to learn how to use this vectorstore as part of a larger chain.\n", "\n", "### Integration details\n", "\n", - "| Retriever | Source | Package |\n", - "| :--- | :--- | :---: |\n", - "[TavilySearchAPIRetriever](https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.tavily_search_api.TavilySearchAPIRetriever.html) | Internet search | langchain_community |\n", + "import {ItemTable} from \"@theme/FeatureTables\";\n", + "\n", + "\n", "\n", "## Setup" ] diff --git a/docs/docs/integrations/retrievers/wikipedia.ipynb b/docs/docs/integrations/retrievers/wikipedia.ipynb index 27b66a87007..ef0372af788 100644 --- a/docs/docs/integrations/retrievers/wikipedia.ipynb +++ b/docs/docs/integrations/retrievers/wikipedia.ipynb @@ -1,7 +1,7 @@ { "cells": [ { - "cell_type": "markdown", + "cell_type": "raw", "id": "62727aaa-bcff-4087-891c-e539f824ee1f", "metadata": {}, "source": [ @@ -24,9 +24,9 @@ "\n", "### Integration details\n", "\n", - "| Retriever | Source | Package |\n", - "| :--- | :--- | :---: |\n", - "[WikipediaRetriever](https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.wikipedia.WikipediaRetriever.html) | [Wikipedia](https://www.wikipedia.org/) articles | langchain_community |" + "import {ItemTable} from \"@theme/FeatureTables\";\n", + "\n", + "" ] }, { diff --git a/docs/docs/integrations/text_embedding/index.mdx b/docs/docs/integrations/text_embedding/index.mdx index e4e191aa88e..2b10fd3605b 100644 --- a/docs/docs/integrations/text_embedding/index.mdx +++ b/docs/docs/integrations/text_embedding/index.mdx @@ -5,110 +5,10 @@ sidebar_class_name: hidden # Embedding models -**Embedding model** classes are implemented by inheriting the [Embeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_core.embeddings.Embeddings.html) class. +import { CategoryTable, IndexTable } from "@theme/FeatureTables"; -This table lists all 100 derived classes. + +## All embedding models -| Namespace 🔻 | Class | -|------------|---------| -| langchain.chains.hyde.base | [HypotheticalDocumentEmbedder](https://api.python.langchain.com/en/latest/chains/langchain.chains.hyde.base.HypotheticalDocumentEmbedder.html) | -| langchain.embeddings.cache | [CacheBackedEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.cache.CacheBackedEmbeddings.html) | -| langchain_ai21.embeddings | [AI21Embeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_ai21.embeddings.AI21Embeddings.html) | -| langchain_aws.embeddings.bedrock | [BedrockEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_aws.embeddings.bedrock.BedrockEmbeddings.html) | -| langchain_cohere.embeddings | [CohereEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_cohere.embeddings.CohereEmbeddings.html) | -| langchain_community.embeddings.aleph_alpha | [AlephAlphaAsymmetricSemanticEmbedding](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.aleph_alpha.AlephAlphaAsymmetricSemanticEmbedding.html) | -| langchain_community.embeddings.aleph_alpha | [AlephAlphaSymmetricSemanticEmbedding](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.aleph_alpha.AlephAlphaSymmetricSemanticEmbedding.html) | -| langchain_community.embeddings.anyscale | [AnyscaleEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.anyscale.AnyscaleEmbeddings.html) | -| langchain_community.embeddings.awa | [AwaEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.awa.AwaEmbeddings.html) | -| langchain_community.embeddings.azure_openai | [AzureOpenAIEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.azure_openai.AzureOpenAIEmbeddings.html) | -| langchain_community.embeddings.baichuan | [BaichuanTextEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.baichuan.BaichuanTextEmbeddings.html) | -| langchain_community.embeddings.baidu_qianfan_endpoint | [QianfanEmbeddingsEndpoint](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.baidu_qianfan_endpoint.QianfanEmbeddingsEndpoint.html) | -| langchain_community.embeddings.bedrock | [BedrockEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.bedrock.BedrockEmbeddings.html) | -| langchain_community.embeddings.bookend | [BookendEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.bookend.BookendEmbeddings.html) | -| langchain_community.embeddings.clarifai | [ClarifaiEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.clarifai.ClarifaiEmbeddings.html) | -| langchain_community.embeddings.cloudflare_workersai | [CloudflareWorkersAIEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.cloudflare_workersai.CloudflareWorkersAIEmbeddings.html) | -| langchain_community.embeddings.clova | [ClovaEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.clova.ClovaEmbeddings.html) | -| langchain_community.embeddings.cohere | [CohereEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.cohere.CohereEmbeddings.html) | -| langchain_community.embeddings.dashscope | [DashScopeEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.dashscope.DashScopeEmbeddings.html) | -| langchain_community.embeddings.databricks | [DatabricksEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.databricks.DatabricksEmbeddings.html) | -| langchain_community.embeddings.deepinfra | [DeepInfraEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.deepinfra.DeepInfraEmbeddings.html) | -| langchain_community.embeddings.edenai | [EdenAiEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.edenai.EdenAiEmbeddings.html) | -| langchain_community.embeddings.elasticsearch | [ElasticsearchEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.elasticsearch.ElasticsearchEmbeddings.html) | -| langchain_community.embeddings.embaas | [EmbaasEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.embaas.EmbaasEmbeddings.html) | -| langchain_community.embeddings.ernie | [ErnieEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.ernie.ErnieEmbeddings.html) | -| langchain_community.embeddings.fake | [DeterministicFakeEmbedding](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.fake.DeterministicFakeEmbedding.html) | -| langchain_community.embeddings.fake | [FakeEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.fake.FakeEmbeddings.html) | -| langchain_community.embeddings.fastembed | [FastEmbedEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.fastembed.FastEmbedEmbeddings.html) | -| langchain_community.embeddings.gigachat | [GigaChatEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.gigachat.GigaChatEmbeddings.html) | -| langchain_community.embeddings.google_palm | [GooglePalmEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.google_palm.GooglePalmEmbeddings.html) | -| langchain_community.embeddings.gpt4all | [GPT4AllEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.gpt4all.GPT4AllEmbeddings.html) | -| langchain_community.embeddings.gradient_ai | [GradientEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.gradient_ai.GradientEmbeddings.html) | -| langchain_community.embeddings.huggingface | [HuggingFaceBgeEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.huggingface.HuggingFaceBgeEmbeddings.html) | -| langchain_community.embeddings.huggingface | [HuggingFaceEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.huggingface.HuggingFaceEmbeddings.html) | -| langchain_community.embeddings.huggingface | [HuggingFaceInferenceAPIEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.huggingface.HuggingFaceInferenceAPIEmbeddings.html) | -| langchain_community.embeddings.huggingface | [HuggingFaceInstructEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.huggingface.HuggingFaceInstructEmbeddings.html) | -| langchain_community.embeddings.huggingface_hub | [HuggingFaceHubEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.huggingface_hub.HuggingFaceHubEmbeddings.html) | -| langchain_community.embeddings.infinity | [InfinityEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.infinity.InfinityEmbeddings.html) | -| langchain_community.embeddings.infinity_local | [InfinityEmbeddingsLocal](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.infinity_local.InfinityEmbeddingsLocal.html) | -| langchain_community.embeddings.ipex_llm | [IpexLLMBgeEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.ipex_llm.IpexLLMBgeEmbeddings.html) | -| langchain_community.embeddings.itrex | [QuantizedBgeEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.itrex.QuantizedBgeEmbeddings.html) | -| langchain_community.embeddings.javelin_ai_gateway | [JavelinAIGatewayEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.javelin_ai_gateway.JavelinAIGatewayEmbeddings.html) | -| langchain_community.embeddings.jina | [JinaEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.jina.JinaEmbeddings.html) | -| langchain_community.embeddings.johnsnowlabs | [JohnSnowLabsEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.johnsnowlabs.JohnSnowLabsEmbeddings.html) | -| langchain_community.embeddings.laser | [LaserEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.laser.LaserEmbeddings.html) | -| langchain_community.embeddings.llamacpp | [LlamaCppEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.llamacpp.LlamaCppEmbeddings.html) | -| langchain_community.embeddings.llamafile | [LlamafileEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.llamafile.LlamafileEmbeddings.html) | -| langchain_community.embeddings.llm_rails | [LLMRailsEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.llm_rails.LLMRailsEmbeddings.html) | -| langchain_community.embeddings.localai | [LocalAIEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.localai.LocalAIEmbeddings.html) | -| langchain_community.embeddings.minimax | [MiniMaxEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.minimax.MiniMaxEmbeddings.html) | -| langchain_community.embeddings.mlflow | [MlflowCohereEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.mlflow.MlflowCohereEmbeddings.html) | -| langchain_community.embeddings.mlflow | [MlflowEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.mlflow.MlflowEmbeddings.html) | -| langchain_community.embeddings.mlflow_gateway | [MlflowAIGatewayEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.mlflow_gateway.MlflowAIGatewayEmbeddings.html) | -| langchain_community.embeddings.modelscope_hub | [ModelScopeEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.modelscope_hub.ModelScopeEmbeddings.html) | -| langchain_community.embeddings.mosaicml | [MosaicMLInstructorEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.mosaicml.MosaicMLInstructorEmbeddings.html) | -| langchain_community.embeddings.nemo | [NeMoEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.nemo.NeMoEmbeddings.html) | -| langchain_community.embeddings.nlpcloud | [NLPCloudEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.nlpcloud.NLPCloudEmbeddings.html) | -| langchain_community.embeddings.oci_generative_ai | [OCIGenAIEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.oci_generative_ai.OCIGenAIEmbeddings.html) | -| langchain_community.embeddings.octoai_embeddings | [OctoAIEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.octoai_embeddings.OctoAIEmbeddings.html) | -| langchain_community.embeddings.ollama | [OllamaEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.ollama.OllamaEmbeddings.html) | -| langchain_community.embeddings.openai | [OpenAIEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.openai.OpenAIEmbeddings.html) | -| langchain_community.embeddings.openvino | [OpenVINOBgeEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.openvino.OpenVINOBgeEmbeddings.html) | -| langchain_community.embeddings.openvino | [OpenVINOEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.openvino.OpenVINOEmbeddings.html) | -| langchain_community.embeddings.optimum_intel | [QuantizedBiEncoderEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.optimum_intel.QuantizedBiEncoderEmbeddings.html) | -| langchain_community.embeddings.oracleai | [OracleEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.oracleai.OracleEmbeddings.html) | -| langchain_community.embeddings.ovhcloud | [OVHCloudEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.ovhcloud.OVHCloudEmbeddings.html) | -| langchain_community.embeddings.premai | [PremAIEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.premai.PremAIEmbeddings.html) | -| langchain_community.embeddings.sagemaker_endpoint | [SagemakerEndpointEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.sagemaker_endpoint.SagemakerEndpointEmbeddings.html) | -| langchain_community.embeddings.sambanova | [SambaStudioEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.sambanova.SambaStudioEmbeddings.html) | -| langchain_community.embeddings.self_hosted | [SelfHostedEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.self_hosted.SelfHostedEmbeddings.html) | -| langchain_community.embeddings.self_hosted_hugging_face | [SelfHostedHuggingFaceEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.self_hosted_hugging_face.SelfHostedHuggingFaceEmbeddings.html) | -| langchain_community.embeddings.self_hosted_hugging_face | [SelfHostedHuggingFaceInstructEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.self_hosted_hugging_face.SelfHostedHuggingFaceInstructEmbeddings.html) | -| langchain_community.embeddings.solar | [SolarEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.solar.SolarEmbeddings.html) | -| langchain_community.embeddings.spacy_embeddings | [SpacyEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.spacy_embeddings.SpacyEmbeddings.html) | -| langchain_community.embeddings.sparkllm | [SparkLLMTextEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.sparkllm.SparkLLMTextEmbeddings.html) | -| langchain_community.embeddings.tensorflow_hub | [TensorflowHubEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.tensorflow_hub.TensorflowHubEmbeddings.html) | -| langchain_community.embeddings.text2vec | [Text2vecEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.text2vec.Text2vecEmbeddings.html) | -| langchain_community.embeddings.titan_takeoff | [TitanTakeoffEmbed](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.titan_takeoff.TitanTakeoffEmbed.html) | -| langchain_community.embeddings.vertexai | [VertexAIEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.vertexai.VertexAIEmbeddings.html) | -| langchain_community.embeddings.volcengine | [VolcanoEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.volcengine.VolcanoEmbeddings.html) | -| langchain_community.embeddings.voyageai | [VoyageEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.voyageai.VoyageEmbeddings.html) | -| langchain_community.embeddings.xinference | [XinferenceEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.xinference.XinferenceEmbeddings.html) | -| langchain_community.embeddings.yandex | [YandexGPTEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.yandex.YandexGPTEmbeddings.html) | -| langchain_community.embeddings.zhipuai | [ZhipuAIEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_community.embeddings.zhipuai.ZhipuAIEmbeddings.html) | -| langchain_core.embeddings.fake | [DeterministicFakeEmbedding](https://api.python.langchain.com/en/latest/embeddings/langchain_core.embeddings.fake.DeterministicFakeEmbedding.html) | -| langchain_core.embeddings.fake | [FakeEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_core.embeddings.fake.FakeEmbeddings.html) | -| langchain_elasticsearch.embeddings | [ElasticsearchEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_elasticsearch.embeddings.ElasticsearchEmbeddings.html) | -| langchain_fireworks.embeddings | [FireworksEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_fireworks.embeddings.FireworksEmbeddings.html) | -| langchain_google_genai.embeddings | [GoogleGenerativeAIEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_google_genai.embeddings.GoogleGenerativeAIEmbeddings.html) | -| langchain_google_genai.google_vector_store | [ServerSideEmbedding](https://api.python.langchain.com/en/latest/google_vector_store/langchain_google_genai.google_vector_store.ServerSideEmbedding.html) | -| langchain_google_vertexai.embeddings | [VertexAIEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_google_vertexai.embeddings.VertexAIEmbeddings.html) | -| langchain_huggingface.embeddings.huggingface | [HuggingFaceEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_huggingface.embeddings.huggingface.HuggingFaceEmbeddings.html) | -| langchain_huggingface.embeddings.huggingface_endpoint | [HuggingFaceEndpointEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_huggingface.embeddings.huggingface_endpoint.HuggingFaceEndpointEmbeddings.html) | -| langchain_ibm.embeddings | [WatsonxEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_ibm.embeddings.WatsonxEmbeddings.html) | -| langchain_mistralai.embeddings | [MistralAIEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_mistralai.embeddings.MistralAIEmbeddings.html) | -| langchain_nomic.embeddings | [NomicEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_nomic.embeddings.NomicEmbeddings.html) | -| langchain_nvidia_ai_endpoints.embeddings | [NVIDIAEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_nvidia_ai_endpoints.embeddings.NVIDIAEmbeddings.html) | -| langchain_together.embeddings | [TogetherEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_together.embeddings.TogetherEmbeddings.html) | -| langchain_upstage.embeddings | [UpstageEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_upstage.embeddings.UpstageEmbeddings.html) | -| langchain_voyageai.embeddings | [VoyageAIEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain_voyageai.embeddings.VoyageAIEmbeddings.html) | + diff --git a/docs/docs/integrations/vectorstores/index.mdx b/docs/docs/integrations/vectorstores/index.mdx index fb35683b644..02622072a55 100644 --- a/docs/docs/integrations/vectorstores/index.mdx +++ b/docs/docs/integrations/vectorstores/index.mdx @@ -1,29 +1,15 @@ --- sidebar_position: 0 sidebar_class_name: hidden -keywords: [compatibility] -custom_edit_url: --- # Vectorstores -## Features +import { CategoryTable, IndexTable } from "@theme/FeatureTables"; -The table below lists the features for some of our most popular vector stores. + -Vectorstore|Delete by ID|Filtering|Search by Vector|Search with score|Async|Passes Standard Tests|Multi Tenancy|Local/Cloud|IDs in add Documents -:-|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-: -AstraDBVectorStore|✅|✅|✅|✅|✅|❌|❌|❌|Local|✅ -Chroma|✅|✅|✅|✅|✅|❌|❌|❌|Local|✅ -Clickhouse|✅|✅|❌|✅|❌|❌|❌|❌|Local|✅ -CouchbaseVectorStore|✅|✅|❌|✅|✅|❌|❌|❌|Local|✅ -ElasticsearchStore|✅|✅|✅|❌|✅|❌|❌|❌|Local|✅ -FAISS|✅|✅|✅|✅|✅|❌|❌|❌|Local|✅ -InMemoryVectorStore|✅|✅|❌|✅|✅|❌|❌|❌|Local|✅ -Milvus|✅|✅|❌|✅|✅|❌|❌|❌|Local|✅ -MongoDBAtlasVectorSearch|✅|✅|❌|❌|✅|❌|❌|❌|Local|✅ -PGVector|✅|✅|✅|✅|✅|❌|❌|❌|Local|✅ -PineconeVectorStore|✅|✅|✅|❌|✅|❌|❌|❌|Local|✅ -QdrantVectorStore|✅|✅|✅|✅|✅|❌|❌|❌|Local|✅ -Redis|✅|✅|✅|✅|✅|❌|❌|❌|Local|✅ +## All Vectorstores + + diff --git a/docs/scripts/model_feat_table.py b/docs/scripts/model_feat_table.py deleted file mode 100644 index b57f5068f73..00000000000 --- a/docs/scripts/model_feat_table.py +++ /dev/null @@ -1,312 +0,0 @@ -import sys -from pathlib import Path - -from langchain_community import llms -from langchain_core.language_models.llms import LLM, BaseLLM - -LLM_IGNORE = ("FakeListLLM", "OpenAIChat", "PromptLayerOpenAIChat") -LLM_FEAT_TABLE_CORRECTION = { - "TextGen": {"_astream": False, "_agenerate": False}, - "Ollama": { - "_stream": False, - }, - "PromptLayerOpenAI": {"batch_generate": False, "batch_agenerate": False}, -} -CHAT_MODEL_IGNORE = ("FakeListChatModel", "HumanInputChatModel") - -CHAT_MODEL_FEAT_TABLE = { - "ChatAnthropic": { - "tool_calling": True, - "multimodal": True, - "package": "langchain-anthropic", - "link": "/docs/integrations/chat/anthropic/", - }, - "ChatMistralAI": { - "tool_calling": True, - "json_model": True, - "package": "langchain-mistralai", - "link": "/docs/integrations/chat/mistralai/", - }, - "ChatFireworks": { - "tool_calling": True, - "json_mode": True, - "package": "langchain-fireworks", - "link": "/docs/integrations/chat/fireworks/", - }, - "AzureChatOpenAI": { - "tool_calling": True, - "json_mode": True, - "multimodal": True, - "package": "langchain-openai", - "link": "/docs/integrations/chat/azure_chat_openai/", - }, - "ChatOpenAI": { - "tool_calling": True, - "json_mode": True, - "multimodal": True, - "package": "langchain-openai", - "link": "/docs/integrations/chat/openai/", - }, - "ChatTogether": { - "tool_calling": True, - "json_mode": True, - "package": "langchain-together", - "link": "/docs/integrations/chat/together/", - }, - "ChatVertexAI": { - "tool_calling": True, - "multimodal": True, - "package": "langchain-google-vertexai", - "link": "/docs/integrations/chat/google_vertex_ai_palm/", - }, - "ChatGoogleGenerativeAI": { - "tool_calling": True, - "multimodal": True, - "package": "langchain-google-genai", - "link": "/docs/integrations/chat/google_generative_ai/", - }, - "ChatGroq": { - "tool_calling": True, - "json_mode": True, - "package": "langchain-groq", - "link": "/docs/integrations/chat/groq/", - }, - "ChatCohere": { - "tool_calling": True, - "package": "langchain-cohere", - "link": "/docs/integrations/chat/cohere/", - }, - "ChatBedrock": { - "tool_calling": True, - "package": "langchain-aws", - "link": "/docs/integrations/chat/bedrock/", - }, - "ChatHuggingFace": { - "tool_calling": True, - "local": True, - "package": "langchain-huggingface", - "link": "/docs/integrations/chat/huggingface/", - }, - "ChatNVIDIA": { - "tool_calling": True, - "json_mode": False, - "local": True, - "multimodal": False, - "package": "langchain-nvidia-ai-endpoints", - "link": "/docs/integrations/chat/nvidia_ai_endpoints/", - }, - "ChatOllama": { - "tool_calling": True, - "local": True, - "json_mode": True, - "package": "langchain-ollama", - "link": "/docs/integrations/chat/ollama/", - }, - "vLLM Chat (via ChatOpenAI)": { - "local": True, - "package": "langchain-openai", - "link": "/docs/integrations/chat/vllm/", - }, - "ChatLlamaCpp": { - "tool_calling": True, - "local": True, - "package": "langchain-community", - "link": "/docs/integrations/chat/llamacpp", - }, - "ChatAI21": { - "tool_calling": True, - "package": "langchain-ai21", - "link": "/docs/integrations/chat/ai21", - }, - "ChatWatsonx": { - "tool_calling": True, - "package": "langchain-ibm", - "link": "/docs/integrations/chat/ibm_watsonx", - }, - "ChatUpstage": { - "tool_calling": True, - "package": "langchain-upstage", - "link": "/docs/integrations/chat/upstage", - }, -} - -for feats in CHAT_MODEL_FEAT_TABLE.values(): - feats["structured_output"] = feats.get("tool_calling", False) - - -LLM_TEMPLATE = """\ ---- -sidebar_position: 1 -sidebar_class_name: hidden -keywords: [compatibility] -custom_edit_url: ---- - -# LLMs - -:::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/integrations/). - -::: - -## Features (natively supported) -All LLMs implement the Runnable interface, which comes with default implementations of all methods, ie. `ainvoke`, `batch`, `abatch`, `stream`, `astream`. This gives all LLMs basic support for async, streaming and batch, which by default is implemented as below: -- *Async* support defaults to calling the respective sync method in asyncio's default thread pool executor. This lets other async functions in your application make progress while the LLM is being executed, by moving this call to a background thread. -- *Streaming* support defaults to returning an `Iterator` (or `AsyncIterator` in the case of async streaming) 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 by making use of a thread pool executor (in the sync batch case) or `asyncio.gather` (in the async batch case). The concurrency can be controlled with the `max_concurrency` key in `RunnableConfig`. - -Each LLM integration can optionally provide native implementations for async, 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. - -{table} - -""" - -CHAT_MODEL_TEMPLATE = """\ ---- -sidebar_position: 0 -sidebar_class_name: hidden -keywords: [compatibility] -custom_edit_url: -hide_table_of_contents: true ---- - -# Chat models - -:::info - -If you'd like to write your own chat model, see [this how-to](/docs/how_to/custom_chat_model/). -If you'd like to contribute an integration, see [Contributing integrations](/docs/contributing/integrations/). - -::: - -## Advanced features - -The following table shows all the chat model classes that support one or more advanced features. - -:::info -While all these LangChain classes support the indicated advanced feature, you may have -to open the provider-specific documentation to learn which hosted models or backends support -the feature. -::: - -{table} - -""" - - -def get_llm_table(): - llm_feat_table = {} - for cm in llms.__all__: - llm_feat_table[cm] = {} - cls = getattr(llms, cm) - if issubclass(cls, LLM): - for feat in ("_stream", "_astream", ("_acall", "_agenerate")): - if isinstance(feat, tuple): - feat, name = feat - else: - feat, name = feat, feat - llm_feat_table[cm][name] = getattr(cls, feat) != getattr(LLM, feat) - else: - for feat in [ - "_stream", - "_astream", - ("_generate", "batch_generate"), - "_agenerate", - ("_agenerate", "batch_agenerate"), - ]: - if isinstance(feat, tuple): - feat, name = feat - else: - feat, name = feat, feat - llm_feat_table[cm][name] = getattr(cls, feat) != getattr(BaseLLM, feat) - final_feats = { - k: v - for k, v in {**llm_feat_table, **LLM_FEAT_TABLE_CORRECTION}.items() - if k not in LLM_IGNORE - } - - header = [ - "model", - "_agenerate", - "_stream", - "_astream", - "batch_generate", - "batch_agenerate", - ] - title = [ - "Model", - "Invoke", - "Async invoke", - "Stream", - "Async stream", - "Batch", - "Async batch", - ] - rows = [title, [":-"] + [":-:"] * (len(title) - 1)] - for llm, feats in sorted(final_feats.items()): - rows += [[llm, "✅"] + ["✅" if feats.get(h) else "❌" for h in header[1:]]] - return "\n".join(["|".join(row) for row in rows]) - - -def get_chat_model_table() -> str: - """Get the table of chat models.""" - header = [ - "model", - "tool_calling", - "structured_output", - "json_mode", - "local", - "multimodal", - "package", - ] - title = [ - "Model", - "[Tool calling](/docs/how_to/tool_calling)", - "[Structured output](/docs/how_to/structured_output/)", - "JSON mode", - "Local", - "[Multimodal](/docs/how_to/multimodal_inputs/)", - "Package", - ] - rows = [title, [":-"] + [":-:"] * (len(title) - 1)] - for llm, feats in sorted(CHAT_MODEL_FEAT_TABLE.items()): - # Fields are in the order of the header - row = [ - f"[{llm}]({feats['link']})", - ] - for h in header[1:]: - value = feats.get(h) - if h == "package": - value = value or "langchain-community" - name = value[len("langchain-") :] - link = f"https://api.python.langchain.com/en/latest/{name}_api_reference.html" - value = f"[{value}]({link})" - row.append(value) - else: - if value == "partial": - row.append("🟡") - elif value is True: - row.append("✅") - else: - row.append("❌") - rows.append(row) - return "\n".join(["|".join(row) for row in rows]) - - -if __name__ == "__main__": - output_dir = Path(sys.argv[1]) - output_integrations_dir = output_dir / "integrations" - output_integrations_dir_llms = output_integrations_dir / "llms" - output_integrations_dir_chat = output_integrations_dir / "chat" - output_integrations_dir_llms.mkdir(parents=True, exist_ok=True) - output_integrations_dir_chat.mkdir(parents=True, exist_ok=True) - - llm_page = LLM_TEMPLATE.format(table=get_llm_table()) - - with open(output_integrations_dir / "llms" / "index.mdx", "w") as f: - f.write(llm_page) - chat_model_page = CHAT_MODEL_TEMPLATE.format(table=get_chat_model_table()) - with open(output_integrations_dir / "chat" / "index.mdx", "w") as f: - f.write(chat_model_page) diff --git a/docs/sidebars.js b/docs/sidebars.js index 670768d07cd..71a085c4a8a 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -146,11 +146,12 @@ module.exports = { { type: "category", label: "Chat models", - collapsed: true, + collapsible: false, items: [ { type: "autogenerated", dirName: "integrations/chat", + className: "hidden", }, ], link: { @@ -161,11 +162,12 @@ module.exports = { { type: "category", label: "LLMs", - collapsed: true, + collapsible: false, items: [ { type: "autogenerated", dirName: "integrations/llms", + className: "hidden", }, ], link: { @@ -176,11 +178,12 @@ module.exports = { { type: "category", label: "Embedding models", - collapsed: true, + collapsible: false, items: [ { type: "autogenerated", dirName: "integrations/text_embedding", + className: "hidden", }, ], link: { @@ -191,11 +194,12 @@ module.exports = { { type: "category", label: "Document loaders", - collapsed: true, + collapsible: false, items: [ { type: "autogenerated", dirName: "integrations/document_loaders", + className: "hidden", }, ], link: { @@ -203,44 +207,31 @@ module.exports = { id: "integrations/document_loaders/index", }, }, - { - type: "category", - label: "Document transformers", - collapsed: true, - items: [ - { - type: "autogenerated", - dirName: "integrations/document_transformers", - }, - ], - link: { - type: "generated-index", - slug: "integrations/document_transformers", - }, - }, { 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: { @@ -251,11 +242,12 @@ module.exports = { { type: "category", label: "Tools/Toolkits", - collapsed: true, + collapsible: false, items: [ { type: "autogenerated", dirName: "integrations/tools", + className: "hidden", }, ], link: { @@ -266,11 +258,12 @@ module.exports = { { type: "category", label: "Key-value stores", - collapsed: true, + collapsible: false, items: [ { type: "autogenerated", dirName: "integrations/stores", + className: "hidden", }, ], link: { @@ -278,82 +271,115 @@ module.exports = { id: "integrations/stores/index", }, }, - "integrations/llm_caching", { 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: "Memory", - collapsed: true, - items: [ + "integrations/llm_caching", { - type: "autogenerated", - dirName: "integrations/memory", + 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/memory", - }, - }, - { - type: "category", - label: "Callbacks", - collapsed: true, - items: [ { - type: "autogenerated", - dirName: "integrations/callbacks", + 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/callbacks", - }, - }, - { - type: "category", - label: "Chat loaders", - collapsed: true, - items: [ { - type: "autogenerated", - dirName: "integrations/chat_loaders", + 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/chat_loaders", - }, - }, - { - type: "category", - label: "Adapters", - collapsed: true, - items: [ { - type: "autogenerated", - dirName: "integrations/adapters", + 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: "generated-index", - slug: "integrations/adapters", - }, + // link: { + // type: "generated-index", + // slug: "integrations/providers", + // }, }, + ], link: { type: "generated-index", diff --git a/docs/src/theme/FeatureTables.js b/docs/src/theme/FeatureTables.js new file mode 100644 index 00000000000..bfd6428138e --- /dev/null +++ b/docs/src/theme/FeatureTables.js @@ -0,0 +1,682 @@ +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, + } + ], + } +}; + +function toTable(columns, items) { + const headers = columns.map((col) => col.title); + return ( + + + + {headers.map((header, i) => )} + + + + {items.map((item, i) => ( + + {columns.map((col, j) => )} + + ))} + +
{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')).map(item => ({ + ...item, + description: useDocById(item.docId ?? undefined)?.description, + })); + const rtn = toTable( + [ + { title: "Label", formatter: (item) => {item.label} }, + { title: "Description", formatter: (item) => truncate(item.description ?? "", 70) }, + ], + rows, + ); + return rtn; +} diff --git a/docs/src/theme/FeatureTables.tsx b/docs/src/theme/FeatureTables.tsx deleted file mode 100644 index 80d20ff558f..00000000000 --- a/docs/src/theme/FeatureTables.tsx +++ /dev/null @@ -1,76 +0,0 @@ -import React from "react"; - -interface Column { - title: string | React.ReactNode; - formatter: (item: any) => React.ReactNode; -} -interface Category { - link: string; - columns: Column[]; - items: any[]; -} - -const FeatureTables: Record = { - llms: { - link: "/docs/integrations/llms", - columns: [ - {title: "Provider", formatter: (item) => {item.name}}, - {title: "Package", formatter: (item) => {item.package}}, - ], - items:[ - { - name: "Anthropic", - link: "anthropic.ipynb", - package: "langchain-anthropic", - } - ] - }, - text_embedding: { - link: "/docs/integrations/text_embedding", - columns: [ - {title: "Provider", formatter: (item) => {item.name}}, - {title: "Package", formatter: (item) => {item.package}}, - ], - items:[ - { - name: "Cohere", - link: "cohere.ipynb", - package: "langchain-cohere", - } - ] - }, -}; - -function toTable(columns: Column[], items: any[]) { - const headers = columns.map((col) => col.title); - return ( - - - - {headers.map((header) => )} - - - - {items.map((item) => ( - - {columns.map((col) => )} - - ))} - -
{header}
{col.formatter(item)}
- ); -} - -export function CategoryTable({category}: {category: string}) { - const cat = FeatureTables[category]; - return toTable(cat.columns, cat.items); -} - -export function ItemTable({category, item}: {category: string, item: string}) { - const cat = FeatureTables[category]; - const row = cat.items.find((i) => i.name === item); - if (!row) { - throw new Error(`Item ${item} not found in category ${category}`); - } - return toTable(cat.columns, [row]); -} diff --git a/libs/cli/langchain_cli/integration_template/docs/retrievers.ipynb b/libs/cli/langchain_cli/integration_template/docs/retrievers.ipynb index d63bf60817b..78f779301b1 100644 --- a/libs/cli/langchain_cli/integration_template/docs/retrievers.ipynb +++ b/libs/cli/langchain_cli/integration_template/docs/retrievers.ipynb @@ -17,7 +17,6 @@ "source": [ "# __ModuleName__Retriever\n", "\n", - "## Overview\n", "- TODO: Make sure API reference link is correct.\n", "\n", "This will help you getting started with the __ModuleName__ [retriever](/docs/concepts/#retrievers). For detailed documentation of all __ModuleName__Retriever features and configurations head to the [API reference](https://api.python.langchain.com/en/latest/retrievers/__module_name__.retrievers.__ModuleName__.__ModuleName__Retriever.html).\n",