The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
Documentation fixes (linting and broken links) (#5563)
sseide001b14745088
diff --git a/docs/modules/agents/agent_executors/examples/sharedmemory_for_tools.ipynb b/docs/modules/agents/agent_executors/examples/sharedmemory_for_tools.ipynbindex 62d75c6556..c6326728a0 100644--- a/docs/modules/agents/agent_executors/examples/sharedmemory_for_tools.ipynb+++ b/docs/modules/agents/agent_executors/examples/sharedmemory_for_tools.ipynb@@ -9,8 +9,8 @@"\n","This notebook goes over adding memory to **both** of an Agent and its tools. Before going through this notebook, please walk through the following notebooks, as this will build on top of both of them:\n","\n",- "- [Adding memory to an LLM Chain](../../memory/examples/adding_memory.ipynb)\n",- "- [Custom Agents](custom_agent.ipynb)\n",+ "- [Adding memory to an LLM Chain](../../../memory/examples/adding_memory.ipynb)\n",+ "- [Custom Agents](../../agents/custom_agent.ipynb)\n","\n","We are going to create a custom Agent. The agent has access to a conversation memory, search tool, and a summarization tool. And, the summarization tool also needs access to the conversation memory."]diff --git a/docs/modules/agents/how_to_guides.rst b/docs/modules/agents/how_to_guides.rstindex e7af4b8f48..9725a9c78a 100644--- a/docs/modules/agents/how_to_guides.rst+++ b/docs/modules/agents/how_to_guides.rst@@ -36,7 +36,7 @@ The first category of how-to guides here cover specific parts of working with ag:glob::hidden:- ./examples/*+ ./agents/examples/*Agent Toolkits@@ -46,26 +46,26 @@ The next set of examples covers agents with toolkits.As opposed to the examples above, these examples are not intended to show off an agent `type`,but rather to show off an agent applied to particular use case.-`SQLDatabase Agent <./agent_toolkits/sql_database.html>`_: This notebook covers how to interact with an arbitrary SQL database using an agent.+`SQLDatabase Agent <./toolkits/sql_database.html>`_: This notebook covers how to interact with an arbitrary SQL database using an agent.-`JSON Agent <./agent_toolkits/json.html>`_: This notebook covers how to interact with a JSON dictionary using an agent.+`JSON Agent <./toolkits/json.html>`_: This notebook covers how to interact with a JSON dictionary using an agent.-`OpenAPI Agent <./agent_toolkits/openapi.html>`_: This notebook covers how to interact with an arbitrary OpenAPI endpoint using an agent.+`OpenAPI Agent <./toolkits/openapi.html>`_: This notebook covers how to interact with an arbitrary OpenAPI endpoint using an agent.-`VectorStore Agent <./agent_toolkits/vectorstore.html>`_: This notebook covers how to interact with VectorStores using an agent.+`VectorStore Agent <./toolkits/vectorstore.html>`_: This notebook covers how to interact with VectorStores using an agent.-`Python Agent <./agent_toolkits/python.html>`_: This notebook covers how to produce and execute python code using an agent.+`Python Agent <./toolkits/python.html>`_: This notebook covers how to produce and execute python code using an agent.-`Pandas DataFrame Agent <./agent_toolkits/pandas.html>`_: This notebook covers how to do question answering over a pandas dataframe using an agent. Under the hood this calls the Python agent..+`Pandas DataFrame Agent <./toolkits/pandas.html>`_: This notebook covers how to do question answering over a pandas dataframe using an agent. Under the hood this calls the Python agent..-`CSV Agent <./agent_toolkits/csv.html>`_: This notebook covers how to do question answering over a csv file. Under the hood this calls the Pandas DataFrame agent.+`CSV Agent <./toolkits/csv.html>`_: This notebook covers how to do question answering over a csv file. Under the hood this calls the Pandas DataFrame agent... toctree:::maxdepth: 1:glob::hidden:- ./agent_toolkits/*+ ./toolkits/*Agent Typesdiff --git a/docs/modules/chains/generic/async_chain.ipynb b/docs/modules/chains/generic/async_chain.ipynbindex 6a99a115a8..29d7dcf9b1 100644--- a/docs/modules/chains/generic/async_chain.ipynb+++ b/docs/modules/chains/generic/async_chain.ipynb@@ -9,7 +9,7 @@"\n","LangChain provides async support for Chains by leveraging the [asyncio](https://docs.python.org/3/library/asyncio.html) library.\n","\n",- "Async methods are currently supported in `LLMChain` (through `arun`, `apredict`, `acall`) and `LLMMathChain` (through `arun` and `acall`), `ChatVectorDBChain`, and [QA chains](../indexes/chain_examples/question_answering.html). Async support for other chains is on the roadmap."+ "Async methods are currently supported in `LLMChain` (through `arun`, `apredict`, `acall`) and `LLMMathChain` (through `arun` and `acall`), `ChatVectorDBChain`, and [QA chains](../index_examples/question_answering.ipynb). Async support for other chains is on the roadmap."]},{@@ -104,7 +104,7 @@"s = time.perf_counter()\n","generate_serially()\n","elapsed = time.perf_counter() - s\n",- "print('\\033[1m' + f\"Serial executed in {elapsed:0.2f} seconds.\" + '\\033[0m')"+ "print('\\033[1m' + f\"Serial executed in {elapsed:0.2f} seconds.\" + '\\033[0m')\n"]}],diff --git a/docs/modules/indexes/document_loaders.rst b/docs/modules/indexes/document_loaders.rstindex 6ac4d9517b..ea2ba661e6 100644--- a/docs/modules/indexes/document_loaders.rst+++ b/docs/modules/indexes/document_loaders.rst@@ -88,7 +88,7 @@ We don't need any access permissions to these datasets and services.Proprietary dataset or service loaders-------------------------------+--------------------------------------These datasets and services are not from the public domain.These loaders mostly transform data from specific formats of applications or cloud services,for example **Google Drive**.diff --git a/docs/modules/indexes/document_loaders/examples/docugami.ipynb b/docs/modules/indexes/document_loaders/examples/docugami.ipynbindex 0191d7af56..9af69e655c 100644--- a/docs/modules/indexes/document_loaders/examples/docugami.ipynb+++ b/docs/modules/indexes/document_loaders/examples/docugami.ipynb@@ -137,7 +137,7 @@"metadata": {},"outputs": [],"source": [- "!poetry run pip -q install openai tiktoken chromadb "+ "!poetry run pip -q install openai tiktoken chromadb"]},{@@ -317,7 +317,7 @@"cell_type": "markdown","metadata": {},"source": [- "We can use a [self-querying retriever](../../retrievers/examples/self_query_retriever.ipynb) to improve our query accuracy, using this additional metadata:"+ "We can use a [self-querying retriever](../../retrievers/examples/self_query.ipynb) to improve our query accuracy, using this additional metadata:"]},{diff --git a/docs/modules/memory/examples/agent_with_memory.ipynb b/docs/modules/memory/examples/agent_with_memory.ipynbindex 4f0010a85a..c2b7a57abe 100644--- a/docs/modules/memory/examples/agent_with_memory.ipynb+++ b/docs/modules/memory/examples/agent_with_memory.ipynb@@ -10,7 +10,7 @@"This notebook goes over adding memory to an Agent. Before going through this notebook, please walkthrough the following notebooks, as this will build on top of both of them:\n","\n","- [Adding memory to an LLM Chain](adding_memory.ipynb)\n",- "- [Custom Agents](../../agents/examples/custom_agent.ipynb)\n",+ "- [Custom Agents](../../agents/agents/custom_agent.ipynb)\n","\n","In order to add a memory to an agent we are going to the the following steps:\n","\n",diff --git a/docs/modules/memory/examples/agent_with_memory_in_db.ipynb b/docs/modules/memory/examples/agent_with_memory_in_db.ipynbindex b96760bbbe..cf692824ea 100644--- a/docs/modules/memory/examples/agent_with_memory_in_db.ipynb+++ b/docs/modules/memory/examples/agent_with_memory_in_db.ipynb@@ -10,8 +10,8 @@"This notebook goes over adding memory to an Agent where the memory uses an external message store. Before going through this notebook, please walkthrough the following notebooks, as this will build on top of both of them:\n","\n","- [Adding memory to an LLM Chain](adding_memory.ipynb)\n",- "- [Custom Agents](../../agents/examples/custom_agent.ipynb)\n",- "- [Agent with Memory](agetn_with_memory.ipynb)\n",+ "- [Custom Agents](../../agents/agents/custom_agent.ipynb)\n",+ "- [Agent with Memory](agent_with_memory.ipynb)\n","\n","In order to add a memory with an external message store to an agent we are going to do the following steps:\n","\n",diff --git a/docs/reference/modules/experimental.rst b/docs/reference/modules/experimental.rstindex 22c124b92a..e97b4ca562 100644--- a/docs/reference/modules/experimental.rst+++ b/docs/reference/modules/experimental.rst@@ -1,6 +1,6 @@-==========+====================Experimental Modules-==========+====================This module contains experimental modules and reproductions of existing work using LangChain primitives.diff --git a/langchain/chat_models/anthropic.py b/langchain/chat_models/anthropic.pyindex 3ac59507c5..e913f6c448 100644--- a/langchain/chat_models/anthropic.py+++ b/langchain/chat_models/anthropic.py@@ -28,6 +28,7 @@ class ChatAnthropic(BaseChatModel, _AnthropicCommon):Example:.. code-block:: python+import anthropicfrom langchain.llms import Anthropicmodel = ChatAnthropic(model="<model_name>", anthropic_api_key="my-api-key")diff --git a/langchain/chat_models/azure_openai.py b/langchain/chat_models/azure_openai.pyindex 1020604936..8b370251f0 100644--- a/langchain/chat_models/azure_openai.py+++ b/langchain/chat_models/azure_openai.py@@ -30,6 +30,7 @@ class AzureChatOpenAI(ChatOpenAI):`35-turbo-dev`, the constructor should look like:.. code-block:: python+AzureChatOpenAI(deployment_name="35-turbo-dev",openai_api_version="2023-03-15-preview",diff --git a/langchain/chat_models/promptlayer_openai.py b/langchain/chat_models/promptlayer_openai.pyindex 5969599460..65865c1dc7 100644--- a/langchain/chat_models/promptlayer_openai.py+++ b/langchain/chat_models/promptlayer_openai.py@@ -20,6 +20,7 @@ class PromptLayerChatOpenAI(ChatOpenAI):All parameters that can be passed to the OpenAI LLM can alsobe passed here. The PromptLayerChatOpenAI adds to optional+parameters:``pl_tags``: List of strings to tag the request with.``return_pl_id``: If True, the PromptLayer request ID will bediff --git a/langchain/embeddings/aleph_alpha.py b/langchain/embeddings/aleph_alpha.pyindex f6ca5008ed..e5e9664ee8 100644--- a/langchain/embeddings/aleph_alpha.py+++ b/langchain/embeddings/aleph_alpha.py@@ -149,6 +149,7 @@ class AlephAlphaSymmetricSemanticEmbedding(AlephAlphaAsymmetricSemanticEmbeddingqueries are embedded with a SemanticRepresentation.SymmetricExample:.. code-block:: python+from aleph_alpha import AlephAlphaSymmetricSemanticEmbeddingembeddings = AlephAlphaAsymmetricSemanticEmbedding()diff --git a/langchain/embeddings/elasticsearch.py b/langchain/embeddings/elasticsearch.pyindex 9d3b119231..7574a39b15 100644--- a/langchain/embeddings/elasticsearch.py+++ b/langchain/embeddings/elasticsearch.py@@ -66,30 +66,32 @@ class ElasticsearchEmbeddings(Embeddings):es_user: (str, optional): Elasticsearch username.es_password: (str, optional): Elasticsearch password.- Example Usage:- from langchain.embeddings import ElasticsearchEmbeddings-- # Define the model ID and input field name (if different from default)- model_id = "your_model_id"- # Optional, only if different from 'text_field'- input_field = "your_input_field"-- # Credentials can be passed in two ways. Either set the env vars- # ES_CLOUD_ID, ES_USER, ES_PASSWORD and they will be automatically pulled- # in, or pass them in directly as kwargs.- embeddings = ElasticsearchEmbeddings.from_credentials(- model_id,- input_field=input_field,- # es_cloud_id="foo",- # es_user="bar",- # es_password="baz",- )-- documents = [- "This is an example document.",- "Another example document to generate embeddings for.",- ]- embeddings_generator.embed_documents(documents)+ Example:+ .. code-block:: python++ from langchain.embeddings import ElasticsearchEmbeddings++ # Define the model ID and input field name (if different from default)+ model_id = "your_model_id"+ # Optional, only if different from 'text_field'+ input_field = "your_input_field"++ # Credentials can be passed in two ways. Either set the env vars+ # ES_CLOUD_ID, ES_USER, ES_PASSWORD and they will be automatically+ # pulled in, or pass them in directly as kwargs.+ embeddings = ElasticsearchEmbeddings.from_credentials(+ model_id,+ input_field=input_field,+ # es_cloud_id="foo",+ # es_user="bar",+ # es_password="baz",+ )++ documents = [+ "This is an example document.",+ "Another example document to generate embeddings for.",+ ]+ embeddings_generator.embed_documents(documents)"""try:from elasticsearch import Elasticsearch@@ -135,32 +137,35 @@ class ElasticsearchEmbeddings(Embeddings):Returns:ElasticsearchEmbeddings: An instance of the ElasticsearchEmbeddings class.- Example Usage:- from elasticsearch import Elasticsearch- from langchain.embeddings import ElasticsearchEmbeddings+ Example:+ .. code-block:: python- # Define the model ID and input field name (if different from default)- model_id = "your_model_id"- # Optional, only if different from 'text_field'- input_field = "your_input_field"+ from elasticsearch import Elasticsearch- # Create Elasticsearch connection- es_connection = Elasticsearch(- hosts=["localhost:9200"], http_auth=("user", "password")- )+ from langchain.embeddings import ElasticsearchEmbeddings- # Instantiate ElasticsearchEmbeddings using the existing connection- embeddings = ElasticsearchEmbeddings.from_es_connection(- model_id,- es_connection,- input_field=input_field,- )+ # Define the model ID and input field name (if different from default)+ model_id = "your_model_id"+ # Optional, only if different from 'text_field'+ input_field = "your_input_field"++ # Create Elasticsearch connection+ es_connection = Elasticsearch(+ hosts=["localhost:9200"], http_auth=("user", "password")+ )++ # Instantiate ElasticsearchEmbeddings using the existing connection+ embeddings = ElasticsearchEmbeddings.from_es_connection(+ model_id,+ es_connection,+ input_field=input_field,+ )- documents = [- "This is an example document.",- "Another example document to generate embeddings for.",- ]- embeddings_generator.embed_documents(documents)+ documents = [+ "This is an example document.",+ "Another example document to generate embeddings for.",+ ]+ embeddings_generator.embed_documents(documents)"""# Importing MlClient from elasticsearch.client within the method to# avoid unnecessary import if the method is not useddiff --git a/langchain/llms/anthropic.py b/langchain/llms/anthropic.pyindex a6cf9ce932..e9da0ae6b1 100644--- a/langchain/llms/anthropic.py+++ b/langchain/llms/anthropic.py@@ -107,6 +107,7 @@ class Anthropic(LLM, _AnthropicCommon):Example:.. code-block:: python+import anthropicfrom langchain.llms import Anthropicmodel = Anthropic(model="<model_name>", anthropic_api_key="my-api-key")diff --git a/langchain/llms/anyscale.py b/langchain/llms/anyscale.pyindex 972957d7c1..0128b6515d 100644--- a/langchain/llms/anyscale.py+++ b/langchain/llms/anyscale.py@@ -18,6 +18,7 @@ class Anyscale(LLM):Example:.. code-block:: python+from langchain.llms import Anyscaleanyscale = Anyscale(anyscale_service_url="SERVICE_URL",anyscale_service_route="SERVICE_ROUTE",diff --git a/langchain/llms/bananadev.py b/langchain/llms/bananadev.pyindex 353c9dca9f..d0d604539d 100644--- a/langchain/llms/bananadev.py+++ b/langchain/llms/bananadev.py@@ -23,6 +23,7 @@ class Banana(LLM):Example:.. code-block:: python+from langchain.llms import Bananabanana = Banana(model_key="")"""diff --git a/langchain/llms/beam.py b/langchain/llms/beam.pyindex fd58309b82..d7d3f27ca5 100644--- a/langchain/llms/beam.py+++ b/langchain/llms/beam.py@@ -31,24 +31,28 @@ class Beam(LLM):The wrapper can then be called as follows, where the name, cpu, memory, gpu,python version, and python packages can be updated accordingly. Once deployed,the instance can be called.- llm = Beam(model_name="gpt2",- name="langchain-gpt2",- cpu=8,- memory="32Gi",- gpu="A10G",- python_version="python3.8",- python_packages=[- "diffusers[torch]>=0.10",- "transformers",- "torch",- "pillow",- "accelerate",- "safetensors",- "xformers",],- max_length=50)-- llm._deploy()- call_result = llm._call(input)++ Example:+ .. code-block:: python++ llm = Beam(model_name="gpt2",+ name="langchain-gpt2",+ cpu=8,+ memory="32Gi",+ gpu="A10G",+ python_version="python3.8",+ python_packages=[+ "diffusers[torch]>=0.10",+ "transformers",+ "torch",+ "pillow",+ "accelerate",+ "safetensors",+ "xformers",],+ max_length=50)+ llm._deploy()+ call_result = llm._call(input)+"""model_name: str = ""diff --git a/langchain/llms/cerebriumai.py b/langchain/llms/cerebriumai.pyindex 3da3dfbc73..dac1f48a17 100644--- a/langchain/llms/cerebriumai.py+++ b/langchain/llms/cerebriumai.py@@ -23,6 +23,7 @@ class CerebriumAI(LLM):Example:.. code-block:: python+from langchain.llms import CerebriumAIcerebrium = CerebriumAI(endpoint_url="")diff --git a/langchain/llms/gooseai.py b/langchain/llms/gooseai.pyindex e1a3f8db22..0271d039e7 100644--- a/langchain/llms/gooseai.py+++ b/langchain/llms/gooseai.py@@ -22,6 +22,7 @@ class GooseAI(LLM):Example:.. code-block:: python+from langchain.llms import GooseAIgooseai = GooseAI(model_name="gpt-neo-20b")diff --git a/langchain/llms/llamacpp.py b/langchain/llms/llamacpp.pyindex 8be51aa38a..ff10f41808 100644--- a/langchain/llms/llamacpp.py+++ b/langchain/llms/llamacpp.py@@ -172,7 +172,7 @@ class LlamaCpp(LLM):def _get_parameters(self, stop: Optional[List[str]] = None) -> Dict[str, Any]:"""- Performs sanity check, preparing paramaters in format needed by llama_cpp.+ Performs sanity check, preparing parameters in format needed by llama_cpp.Args:stop (Optional[List[str]]): List of stop sequences for llama_cpp.@@ -238,7 +238,7 @@ class LlamaCpp(LLM):) -> Generator[Dict, None, None]:"""Yields results objects as they are generated in real time.- BETA: this is a beta feature while we figure out the right abstraction:+ BETA: this is a beta feature while we figure out the right abstraction.Once that happens, this interface could change.It also calls the callback manager's on_llm_new_token event withdiff --git a/langchain/llms/modal.py b/langchain/llms/modal.pyindex 53f112f70f..338a6b42f5 100644--- a/langchain/llms/modal.py+++ b/langchain/llms/modal.py@@ -22,6 +22,7 @@ class Modal(LLM):Example:.. code-block:: python+from langchain.llms import Modalmodal = Modal(endpoint_url="")diff --git a/langchain/llms/petals.py b/langchain/llms/petals.pyindex 293d240cef..f407bcf280 100644--- a/langchain/llms/petals.py+++ b/langchain/llms/petals.py@@ -23,6 +23,7 @@ class Petals(LLM):Example:.. code-block:: python+from langchain.llms import petalspetals = Petals()diff --git a/langchain/llms/pipelineai.py b/langchain/llms/pipelineai.pyindex 3a29d64ec6..677504056c 100644--- a/langchain/llms/pipelineai.py+++ b/langchain/llms/pipelineai.py@@ -23,6 +23,7 @@ class PipelineAI(LLM, BaseModel):Example:.. code-block:: python+from langchain import PipelineAIpipeline = PipelineAI(pipeline_key="")"""diff --git a/langchain/llms/predictionguard.py b/langchain/llms/predictionguard.pyindex 003e284cf7..ee2a9d4b78 100644--- a/langchain/llms/predictionguard.py+++ b/langchain/llms/predictionguard.py@@ -19,8 +19,10 @@ class PredictionGuard(LLM):it as a named parameter to the constructor. To use Prediction Guard's API alongwith OpenAI models, set the environment variable ``OPENAI_API_KEY`` with yourOpenAI API key as well.+Example:.. code-block:: python+pgllm = PredictionGuard(model="MPT-7B-Instruct",token="my-access-token",output={diff --git a/langchain/llms/promptlayer_openai.py b/langchain/llms/promptlayer_openai.pyindex 77df805177..6454ed804f 100644--- a/langchain/llms/promptlayer_openai.py+++ b/langchain/llms/promptlayer_openai.py@@ -20,6 +20,7 @@ class PromptLayerOpenAI(OpenAI):All parameters that can be passed to the OpenAI LLM can alsobe passed here. The PromptLayerOpenAI LLM adds two optional+parameters:``pl_tags``: List of strings to tag the request with.``return_pl_id``: If True, the PromptLayer request ID will be@@ -124,6 +125,7 @@ class PromptLayerOpenAIChat(OpenAIChat):All parameters that can be passed to the OpenAIChat LLM can alsobe passed here. The PromptLayerOpenAIChat adds two optional+parameters:``pl_tags``: List of strings to tag the request with.``return_pl_id``: If True, the PromptLayer request ID will bediff --git a/langchain/llms/replicate.py b/langchain/llms/replicate.pyindex 117d8dde46..10c727bdd5 100644--- a/langchain/llms/replicate.py+++ b/langchain/llms/replicate.py@@ -23,6 +23,7 @@ class Replicate(LLM):Example:.. code-block:: python+from langchain.llms import Replicatereplicate = Replicate(model="stability-ai/stable-diffusion: \27b93a2413e7f36cd83da926f365628\diff --git a/langchain/memory/chat_message_histories/cassandra.py b/langchain/memory/chat_message_histories/cassandra.pyindex 0b468dca19..7f50bf3d74 100644--- a/langchain/memory/chat_message_histories/cassandra.py+++ b/langchain/memory/chat_message_histories/cassandra.py@@ -20,6 +20,7 @@ DEFAULT_PORT = 9042class CassandraChatMessageHistory(BaseChatMessageHistory):"""Chat message history that stores history in Cassandra.+Args:contact_points: list of ips to connect to Cassandra clustersession_id: arbitrary key that is used to store the messagesdiff --git a/langchain/tools/zapier/tool.py b/langchain/tools/zapier/tool.pyindex cb1fc29544..9709f5bb4c 100644--- a/langchain/tools/zapier/tool.py+++ b/langchain/tools/zapier/tool.py@@ -27,7 +27,7 @@ This quick start will focus on the server-side use case for brevity.Review [full docs](https://nla.zapier.com/api/v1/docs) or reach out to[email protected] for user-facing oauth developer support.-Typically you'd use SequentialChain, here's a basic example:+Typically, you'd use SequentialChain, here's a basic example:1. Use NLA to find an email in Gmail2. Use LLMChain to generate a draft reply to (1)@@ -100,6 +100,7 @@ class ZapierNLARunAction(BaseTool):params: a dict, optional. Any params provided will *override* AI guessesfrom `instructions` (see "understanding the AI guessing flow" here:https://nla.zapier.com/api/v1/docs)+"""api_wrapper: ZapierNLAWrapper = Field(default_factory=ZapierNLAWrapper)@@ -160,6 +161,7 @@ class ZapierNLAListActions(BaseTool):"""Args:None+"""name = "Zapier NLA: List Actions"diff --git a/langchain/utilities/arxiv.py b/langchain/utilities/arxiv.pyindex e9e96bc894..ce0c3f9a09 100644--- a/langchain/utilities/arxiv.py+++ b/langchain/utilities/arxiv.py@@ -29,6 +29,7 @@ class ArxivAPIWrapper(BaseModel):if True: the `metadata` of the loaded Documents gets all available meta info(see https://lukasschwab.me/arxiv.py/index.html#Result),if False: the `metadata` gets only the most informative fields.+"""arxiv_client: Any #: :meta private:diff --git a/langchain/utilities/google_search.py b/langchain/utilities/google_search.pyindex 7846c72a33..e02b0b9758 100644--- a/langchain/utilities/google_search.py+++ b/langchain/utilities/google_search.py@@ -33,7 +33,7 @@ class GoogleSearchAPIWrapper(BaseModel):- That’s all you have to fill up, the rest doesn’t matter.In the left-side menu, click Edit search engine → {your search engine name}→ Setup Set Search the entire web to ON. Remove the URL you added from- the list of Sites to search.+ the list of Sites to search.- Under Search engine ID you’ll find the search-engine-ID.4. Enable the Custom Search APIdiff --git a/langchain/utilities/searx_search.py b/langchain/utilities/searx_search.pyindex 4c780f277a..8feb6c76de 100644--- a/langchain/utilities/searx_search.py+++ b/langchain/utilities/searx_search.py@@ -3,11 +3,11 @@SearxNG is a privacy-friendly free metasearch engine that aggregates results from`multiple search engines<https://docs.searxng.org/admin/engines/configured_engines.html>`_ and databases and-supports the `OpenSearch+supports the `OpenSearch<https://github.com/dewitt/opensearch/blob/master/opensearch-1-1-draft-6.md>`_specification.-More detailes on the installtion instructions `here. <../../integrations/searx.html>`_+More details on the installation instructions `here. <../../integrations/searx.html>`_For the search API refer to https://docs.searxng.org/dev/search_api.html@@ -40,7 +40,7 @@ SearchingUse the :meth:`run() <SearxSearchWrapper.run>` and:meth:`results() <SearxSearchWrapper.results>` methods to query the searx API.-Other methods are are available for convenience.+Other methods are available for convenience.:class:`SearxResults` is a convenience wrapper around the raw json result.@@ -415,33 +415,22 @@ class SearxSearchWrapper(BaseModel):Args:query: The query to search for.-query_suffix: Extra suffix appended to the query.-num_results: Limit the number of results to return.-engines: List of engines to use for the query.-categories: List of categories to use for the query.-**kwargs: extra parameters to pass to the searx API.Returns:Dict with the following keys:-{snippet: The description of the result.-title: The title of the result.-link: The link to the result.-engines: The engines used for the result.-category: Searx category of the result.}-"""_params = {"q": query,diff --git a/langchain/vectorstores/analyticdb.py b/langchain/vectorstores/analyticdb.pyindex bb32549b45..be45c1a553 100644--- a/langchain/vectorstores/analyticdb.py+++ b/langchain/vectorstores/analyticdb.py@@ -121,6 +121,7 @@ class AnalyticDB(VectorStore):- `pre_delete_collection` if True, will delete the collection if it exists.(default: False)- Useful for testing.+"""def __init__(diff --git a/langchain/vectorstores/base.py b/langchain/vectorstores/base.pyindex 6b689cd14e..a789d358b3 100644--- a/langchain/vectorstores/base.py+++ b/langchain/vectorstores/base.py@@ -52,7 +52,6 @@ class VectorStore(ABC):Args:documents (List[Document]: Documents to add to the vectorstore.-Returns:List[str]: List of IDs of the added texts."""diff --git a/langchain/vectorstores/chroma.py b/langchain/vectorstores/chroma.pyindex b10a81ed9b..39577b0cf5 100644--- a/langchain/vectorstores/chroma.py+++ b/langchain/vectorstores/chroma.py@@ -244,6 +244,7 @@ class Chroma(VectorStore):"""Return docs selected using the maximal marginal relevance.Maximal marginal relevance optimizes for similarity to query AND diversityamong selected documents.+Args:embedding: Embedding to look up documents similar to.k: Number of Documents to return. Defaults to 4.@@ -253,6 +254,7 @@ class Chroma(VectorStore):to maximum diversity and 1 to minimum diversity.Defaults to 0.5.filter (Optional[Dict[str, str]]): Filter by metadata. Defaults to None.+Returns:List of Documents selected by maximal marginal relevance."""@@ -287,6 +289,7 @@ class Chroma(VectorStore):"""Return docs selected using the maximal marginal relevance.Maximal marginal relevance optimizes for similarity to query AND diversityamong selected documents.+Args:query: Text to look up documents similar to.k: Number of Documents to return. Defaults to 4.@@ -296,6 +299,7 @@ class Chroma(VectorStore):to maximum diversity and 1 to minimum diversity.Defaults to 0.5.filter (Optional[Dict[str, str]]): Filter by metadata. Defaults to None.+Returns:List of Documents selected by maximal marginal relevance."""diff --git a/langchain/vectorstores/deeplake.py b/langchain/vectorstores/deeplake.pyindex 01ed62df13..62ae2a5726 100644--- a/langchain/vectorstores/deeplake.py+++ b/langchain/vectorstores/deeplake.py@@ -391,6 +391,7 @@ class DeepLake(VectorStore):Args:embedding: Embedding to look up documents similar to.k: Number of Documents to return. Defaults to 4.+Returns:List of Documents most similar to the query vector."""@@ -412,6 +413,7 @@ class DeepLake(VectorStore):Defaults to `L2`.k (int): Number of results to return. Defaults to 4.filter (Optional[Dict[str, str]]): Filter by metadata. Defaults to None.+Returns:List[Tuple[Document, float]]: List of documents most similar to the querytext with distance in float.@@ -435,14 +437,16 @@ class DeepLake(VectorStore):"""Return docs selected using the maximal marginal relevance.Maximal marginal relevance optimizes for similarity to query AND diversityamong selected documents.+Args:embedding: Embedding to look up documents similar to.k: Number of Documents to return. Defaults to 4.fetch_k: Number of Documents to fetch to pass to MMR algorithm.lambda_mult: Number between 0 and 1 that determines the degree- of diversity among the results with 0 corresponding- to maximum diversity and 1 to minimum diversity.- Defaults to 0.5.+ of diversity among the results with 0 corresponding+ to maximum diversity and 1 to minimum diversity.+ Defaults to 0.5.+Returns:List of Documents selected by maximal marginal relevance."""@@ -514,7 +518,7 @@ class DeepLake(VectorStore):- AWS S3 path of the form ``s3://bucketname/path/to/dataset``.Credentials are required in either the environment- Google Cloud Storage path of the form- ``gcs://bucketname/path/to/dataset``Credentials are required+ ``gcs://bucketname/path/to/dataset`` Credentials are requiredin either the environment- Local file system path of the form ``./path/to/dataset`` or``~/path/to/dataset`` or ``path/to/dataset``.diff --git a/langchain/vectorstores/myscale.py b/langchain/vectorstores/myscale.pyindex 3ae8d275db..cc43aa7ee2 100644--- a/langchain/vectorstores/myscale.py+++ b/langchain/vectorstores/myscale.py@@ -30,7 +30,7 @@ class MyScaleSettings(BaseSettings):myscale_host (str) : An URL to connect to MyScale backend.Defaults to 'localhost'.myscale_port (int) : URL port to connect with HTTP. Defaults to 8443.- username (str) : Usernamed to login. Defaults to None.+ username (str) : Username to login. Defaults to None.password (str) : Password to login. Defaults to None.index_type (str): index type string.index_param (dict): index build parameter.@@ -43,14 +43,16 @@ class MyScaleSettings(BaseSettings):semantics. Must have keys: `text`, `id`, `vector`,must be same size to number of columns. For example:.. code-block:: python- {- 'id': 'text_id',- 'vector': 'text_embedding',- 'text': 'text_plain',- 'metadata': 'metadata_dictionary_in_json',- }++ {+ 'id': 'text_id',+ 'vector': 'text_embedding',+ 'text': 'text_plain',+ 'metadata': 'metadata_dictionary_in_json',+ }Defaults to identity map.+"""host: str = "localhost"diff --git a/langchain/vectorstores/qdrant.py b/langchain/vectorstores/qdrant.pyindex ce6a1b782b..c3fead1459 100644--- a/langchain/vectorstores/qdrant.py+++ b/langchain/vectorstores/qdrant.py@@ -382,10 +382,10 @@ class Qdrant(VectorStore):Additional arguments passed directly into REST client initializationThis is a user-friendly interface that:- 1. Creates embeddings, one for each text- 2. Initializes the Qdrant database as an in-memory docstore by default- (and overridable to a remote docstore)- 3. Adds the text embeddings to the Qdrant database+ 1. Creates embeddings, one for each text+ 2. Initializes the Qdrant database as an in-memory docstore by default+ (and overridable to a remote docstore)+ 3. Adds the text embeddings to the Qdrant databaseThis is intended to be a quick way to get started.diff --git a/langchain/vectorstores/supabase.py b/langchain/vectorstores/supabase.pyindex d6d5b0275b..72a062de60 100644--- a/langchain/vectorstores/supabase.py+++ b/langchain/vectorstores/supabase.py@@ -298,8 +298,9 @@ class SupabaseVectorStore(VectorStore):List of Documents selected by maximal marginal relevance.`max_marginal_relevance_search` requires that `query_name` returns matched- embeddings alongside the match documents. The following function function+ embeddings alongside the match documents. The following functiondemonstrates how to do this:+```sqlCREATE FUNCTION match_documents_embeddings(query_embedding vector(1536),match_count int)@@ -326,7 +327,8 @@ class SupabaseVectorStore(VectorStore):docstore.embedding <=> query_embeddingLIMIT match_count;END;- $$;```+ $$;+ ```"""embedding = self._embedding.embed_documents([query])docs = self.max_marginal_relevance_search_by_vector(