From e81ddb32a669ebdf6f98a8f76a56c39f1c0b8a97 Mon Sep 17 00:00:00 2001 From: Bagatur <22008038+baskaryan@users.noreply.github.com> Date: Fri, 2 Aug 2024 19:54:54 -0700 Subject: [PATCH] docs: fix kwargs docstring (#25010) Fix: ![Screenshot 2024-08-02 at 5 33 37 PM](https://github.com/user-attachments/assets/7c56cdeb-ee81-454c-b3eb-86aa8a9bdc8d) --- .../agent_toolkits/json/base.py | 2 +- .../agent_toolkits/load_tools.py | 4 +-- .../agent_toolkits/nla/tool.py | 2 +- .../agent_toolkits/nla/toolkit.py | 4 +-- .../agent_toolkits/openapi/base.py | 2 +- .../agent_toolkits/openapi/planner.py | 2 +- .../chat_models/zhipuai.py | 4 +-- .../document_loaders/airtable.py | 2 +- .../document_transformers/markdownify.py | 2 +- .../langchain_community/llms/sambanova.py | 8 ++--- .../utilities/cassandra.py | 2 +- .../vectorstores/aerospike.py | 2 +- .../vectorstores/aperturedb.py | 4 +-- .../vectorstores/clarifai.py | 4 +-- .../vectorstores/deeplake.py | 14 ++++----- .../vectorstores/duckdb.py | 2 +- .../vectorstores/tidb_vector.py | 6 ++-- .../vectorstores/weaviate.py | 2 +- .../langchain_community/vectorstores/zep.py | 2 +- .../vectorstores/zep_cloud.py | 2 +- libs/core/langchain_core/load/dump.py | 2 +- libs/core/langchain_core/messages/ai.py | 2 +- libs/core/langchain_core/messages/base.py | 2 +- libs/core/langchain_core/messages/human.py | 2 +- libs/core/langchain_core/messages/modifier.py | 2 +- libs/core/langchain_core/messages/system.py | 2 +- libs/core/langchain_core/messages/tool.py | 2 +- libs/core/langchain_core/retrievers.py | 8 ++--- libs/core/langchain_core/runnables/base.py | 18 +++++------ libs/core/langchain_core/runnables/branch.py | 6 ++-- libs/core/langchain_core/tools.py | 4 +-- libs/core/langchain_core/tracers/base.py | 30 +++++++++---------- libs/core/langchain_core/tracers/langchain.py | 4 +-- libs/core/langchain_core/vectorstores/base.py | 16 +++++----- .../langchain_core/vectorstores/in_memory.py | 2 +- .../agents/agent_toolkits/csv/base.py | 2 +- .../graph_transformers/diffbot.py | 2 +- .../graph_transformers/llm.py | 2 +- .../graph_transformers/relik.py | 2 +- .../tabular_synthetic_data/openai.py | 2 +- libs/langchain/langchain/agents/agent.py | 10 +++---- .../agents/agent_toolkits/vectorstore/base.py | 4 +-- libs/langchain/langchain/agents/initialize.py | 2 +- libs/langchain/langchain/agents/loading.py | 4 +-- libs/langchain/langchain/agents/mrkl/base.py | 2 +- .../langchain/agents/openai_assistant/base.py | 4 +-- .../agents/openai_functions_agent/base.py | 2 +- .../openai_functions_multi_agent/base.py | 2 +- .../chains/conversational_retrieval/base.py | 2 +- .../chains/elasticsearch_database/base.py | 2 +- libs/langchain/langchain/chains/flare/base.py | 2 +- .../chains/query_constructor/base.py | 4 +-- .../chains/structured_output/base.py | 2 +- .../evaluation/parsing/json_schema.py | 2 +- libs/langchain/langchain/evaluation/schema.py | 16 +++++----- .../evaluation/string_distance/base.py | 8 ++--- .../document_compressors/chain_filter.py | 2 +- .../document_compressors/listwise_rerank.py | 2 +- .../chroma/langchain_chroma/vectorstores.py | 24 +++++++-------- .../langchain_qdrant/fastembed_sparse.py | 2 +- .../together/langchain_together/llms.py | 4 +-- 61 files changed, 143 insertions(+), 143 deletions(-) diff --git a/libs/community/langchain_community/agent_toolkits/json/base.py b/libs/community/langchain_community/agent_toolkits/json/base.py index fc1aafd7ba3..8ed06c39de9 100644 --- a/libs/community/langchain_community/agent_toolkits/json/base.py +++ b/libs/community/langchain_community/agent_toolkits/json/base.py @@ -38,7 +38,7 @@ def create_json_agent( input_variables: The input variables to use. Default is None. verbose: Whether to print verbose output. Default is False. agent_executor_kwargs: Optional additional arguments for the agent executor. - **kwargs: Additional arguments for the agent. + kwargs: Additional arguments for the agent. Returns: The agent executor. diff --git a/libs/community/langchain_community/agent_toolkits/load_tools.py b/libs/community/langchain_community/agent_toolkits/load_tools.py index 18df5b3dee1..7f6273d0b64 100644 --- a/libs/community/langchain_community/agent_toolkits/load_tools.py +++ b/libs/community/langchain_community/agent_toolkits/load_tools.py @@ -590,7 +590,7 @@ def load_huggingface_tool( model_repo_id: Optional model repo id. Defaults to None. token: Optional token. Defaults to None. remote: Optional remote. Defaults to False. - **kwargs: Additional keyword arguments. + kwargs: Additional keyword arguments. Returns: A tool. @@ -686,7 +686,7 @@ def load_tools( It is your responsibility to understand which tools you're using and the risks associated with them. Defaults to False. - **kwargs: Additional keyword arguments. + kwargs: Additional keyword arguments. Returns: List of tools. diff --git a/libs/community/langchain_community/agent_toolkits/nla/tool.py b/libs/community/langchain_community/agent_toolkits/nla/tool.py index 997a83275a6..3e49748e4be 100644 --- a/libs/community/langchain_community/agent_toolkits/nla/tool.py +++ b/libs/community/langchain_community/agent_toolkits/nla/tool.py @@ -62,7 +62,7 @@ class NLATool(Tool): verbose: Whether to print verbose output. Default is False. return_intermediate_steps: Whether to return intermediate steps. Default is False. - **kwargs: Additional arguments. + kwargs: Additional arguments. Returns: The tool. diff --git a/libs/community/langchain_community/agent_toolkits/nla/toolkit.py b/libs/community/langchain_community/agent_toolkits/nla/toolkit.py index 1155ec415a7..6622dee5f57 100644 --- a/libs/community/langchain_community/agent_toolkits/nla/toolkit.py +++ b/libs/community/langchain_community/agent_toolkits/nla/toolkit.py @@ -76,7 +76,7 @@ class NLAToolkit(BaseToolkit): spec: The OpenAPI spec. requests: Optional requests object. Default is None. verbose: Whether to print verbose output. Default is False. - **kwargs: Additional arguments. + kwargs: Additional arguments. Returns: The toolkit. @@ -102,7 +102,7 @@ class NLAToolkit(BaseToolkit): open_api_url: The URL of the OpenAPI spec. requests: Optional requests object. Default is None. verbose: Whether to print verbose output. Default is False. - **kwargs: Additional arguments. + kwargs: Additional arguments. Returns: The toolkit. diff --git a/libs/community/langchain_community/agent_toolkits/openapi/base.py b/libs/community/langchain_community/agent_toolkits/openapi/base.py index 15ed8344b65..14c06fb2eb8 100644 --- a/libs/community/langchain_community/agent_toolkits/openapi/base.py +++ b/libs/community/langchain_community/agent_toolkits/openapi/base.py @@ -64,7 +64,7 @@ def create_openapi_agent( Default is False. agent_executor_kwargs: Optional. Additional keyword arguments for the agent executor. - **kwargs: Additional arguments. + kwargs: Additional arguments. Returns: The agent executor. diff --git a/libs/community/langchain_community/agent_toolkits/openapi/planner.py b/libs/community/langchain_community/agent_toolkits/openapi/planner.py index d793182e365..fc96e3284e7 100644 --- a/libs/community/langchain_community/agent_toolkits/openapi/planner.py +++ b/libs/community/langchain_community/agent_toolkits/openapi/planner.py @@ -421,7 +421,7 @@ def create_openapi_agent( Default is False. allowed_operations: Optional. The allowed operations. Default is ("GET", "POST"). - **kwargs: Additional arguments. + kwargs: Additional arguments. Returns: The agent executor. diff --git a/libs/community/langchain_community/chat_models/zhipuai.py b/libs/community/langchain_community/chat_models/zhipuai.py index f3573129dd7..ec9fea0e27b 100644 --- a/libs/community/langchain_community/chat_models/zhipuai.py +++ b/libs/community/langchain_community/chat_models/zhipuai.py @@ -48,7 +48,7 @@ def connect_sse(client: Any, method: str, url: str, **kwargs: Any) -> Iterator: client: The HTTP client. method: The HTTP method. url: The URL. - **kwargs: Additional keyword arguments. + kwargs: Additional keyword arguments. Yields: The event source. @@ -69,7 +69,7 @@ async def aconnect_sse( client: The HTTP client. method: The HTTP method. url: The URL. - **kwargs: Additional keyword arguments. + kwargs: Additional keyword arguments. Yields: The event source. diff --git a/libs/community/langchain_community/document_loaders/airtable.py b/libs/community/langchain_community/document_loaders/airtable.py index 45487ba2431..dc3e25dd47d 100644 --- a/libs/community/langchain_community/document_loaders/airtable.py +++ b/libs/community/langchain_community/document_loaders/airtable.py @@ -16,7 +16,7 @@ class AirtableLoader(BaseLoader): api_token: Airtable API token. table_id: Airtable table ID. base_id: - **kwargs: Additional parameters to pass to Table.all(). Refer to the + kwargs: Additional parameters to pass to Table.all(). Refer to the pyairtable documentation for available options: https://pyairtable.readthedocs.io/en/latest/api.html#pyairtable.Table.all """ # noqa: E501 diff --git a/libs/community/langchain_community/document_transformers/markdownify.py b/libs/community/langchain_community/document_transformers/markdownify.py index 5124514947b..cb8108deeaa 100644 --- a/libs/community/langchain_community/document_transformers/markdownify.py +++ b/libs/community/langchain_community/document_transformers/markdownify.py @@ -13,7 +13,7 @@ class MarkdownifyTransformer(BaseDocumentTransformer): convert: A list of tags to convert. This option can't be used with the strip option. autolinks: A boolean indicating whether the "automatic link" style should be used when a a tag's contents match its href. Defaults to True. heading_style: Defines how headings should be converted. Accepted values are ATX, ATX_CLOSED, SETEXT, and UNDERLINED (which is an alias for SETEXT). Defaults to ATX. - **kwargs: Additional options to pass to markdownify. + kwargs: Additional options to pass to markdownify. Example: .. code-block:: python diff --git a/libs/community/langchain_community/llms/sambanova.py b/libs/community/langchain_community/llms/sambanova.py index 24c98c83f74..30fb5b6a891 100644 --- a/libs/community/langchain_community/llms/sambanova.py +++ b/libs/community/langchain_community/llms/sambanova.py @@ -389,7 +389,7 @@ class Sambaverse(LLM): prompt: The prompt to pass into the model. stop: Optional list of stop words to use when generating. run_manager: Callback manager for the run. - **kwargs: Additional keyword arguments. directly passed + kwargs: Additional keyword arguments. directly passed to the sambaverse model in API call. Returns: @@ -426,7 +426,7 @@ class Sambaverse(LLM): stop: Stop words to use when generating. Model output is cut off at the first occurrence of any of the stop substrings. run_manager: Callback manager for the run. - **kwargs: Additional keyword arguments. directly passed + kwargs: Additional keyword arguments. directly passed to the sambaverse model in API call. Returns: @@ -453,7 +453,7 @@ class Sambaverse(LLM): stop: Stop words to use when generating. Model output is cut off at the first occurrence of any of the stop substrings. run_manager: Callback manager for the run. - **kwargs: Additional keyword arguments. directly passed + kwargs: Additional keyword arguments. directly passed to the sambaverse model in API call. Returns: @@ -951,7 +951,7 @@ class SambaStudio(LLM): stop: Stop words to use when generating. Model output is cut off at the first occurrence of any of the stop substrings. run_manager: Callback manager for the run. - **kwargs: Additional keyword arguments. directly passed + kwargs: Additional keyword arguments. directly passed to the sambaverse model in API call. Returns: diff --git a/libs/community/langchain_community/utilities/cassandra.py b/libs/community/langchain_community/utilities/cassandra.py index 7aa2d66ba36..22b22f3da5a 100644 --- a/libs/community/langchain_community/utilities/cassandra.py +++ b/libs/community/langchain_community/utilities/cassandra.py @@ -41,7 +41,7 @@ async def aexecute_cql(session: Session, query: str, **kwargs: Any) -> Any: Args: session: The Cassandra session to use. query: The CQL query to execute. - **kwargs: Additional keyword arguments to pass to the session execute method. + kwargs: Additional keyword arguments to pass to the session execute method. Returns: The result of the query. diff --git a/libs/community/langchain_community/vectorstores/aerospike.py b/libs/community/langchain_community/vectorstores/aerospike.py index e7759923b61..10265cb5e98 100644 --- a/libs/community/langchain_community/vectorstores/aerospike.py +++ b/libs/community/langchain_community/vectorstores/aerospike.py @@ -178,7 +178,7 @@ class Aerospike(VectorStore): wait_for_index: If True, wait for the all the texts to be indexed before returning. Requires index_name to be provided. Defaults to True. - **kwargs: Additional keyword arguments to pass to the client upsert call. + kwargs: Additional keyword arguments to pass to the client upsert call. Returns: List of ids from adding the texts into the vectorstore. diff --git a/libs/community/langchain_community/vectorstores/aperturedb.py b/libs/community/langchain_community/vectorstores/aperturedb.py index ca01f3115e2..44b278b38d9 100644 --- a/libs/community/langchain_community/vectorstores/aperturedb.py +++ b/libs/community/langchain_community/vectorstores/aperturedb.py @@ -396,7 +396,7 @@ class ApertureDB(VectorStore): texts: List of text strings embedding: Embeddings object as for constructing the vectorstore metadatas: Optional list of metadatas associated with the texts. - **kwargs: Additional arguments to pass to the constructor + kwargs: Additional arguments to pass to the constructor """ store = cls(embeddings=embedding, **kwargs) store.add_texts(texts, metadatas) @@ -416,7 +416,7 @@ class ApertureDB(VectorStore): documents: List of Document objects embedding: Embeddings object as for constructing the vectorstore metadatas: Optional list of metadatas associated with the texts. - **kwargs: Additional arguments to pass to the constructor + kwargs: Additional arguments to pass to the constructor """ store = cls(embeddings=embedding, **kwargs) store.add_documents(documents) diff --git a/libs/community/langchain_community/vectorstores/clarifai.py b/libs/community/langchain_community/vectorstores/clarifai.py index 34ff88421cc..b37b99f02a7 100644 --- a/libs/community/langchain_community/vectorstores/clarifai.py +++ b/libs/community/langchain_community/vectorstores/clarifai.py @@ -272,7 +272,7 @@ class Clarifai(VectorStore): token (Optional[str], optional): Session token. Defaults to None. metadatas (Optional[List[dict]]): Optional list of metadatas. Defaults to None. - **kwargs: Additional keyword arguments to be passed to the Search. + kwargs: Additional keyword arguments to be passed to the Search. Returns: Clarifai: Clarifai vectorstore. @@ -310,7 +310,7 @@ class Clarifai(VectorStore): to return during vector search. Defaults to None. pat (Optional[str], optional): Personal access token. Defaults to None. token (Optional[str], optional): Session token. Defaults to None. - **kwargs: Additional keyword arguments to be passed to the Search. + kwargs: Additional keyword arguments to be passed to the Search. Returns: Clarifai: Clarifai vectorstore. diff --git a/libs/community/langchain_community/vectorstores/deeplake.py b/libs/community/langchain_community/vectorstores/deeplake.py index 832ac785c82..0de4c6032a7 100644 --- a/libs/community/langchain_community/vectorstores/deeplake.py +++ b/libs/community/langchain_community/vectorstores/deeplake.py @@ -385,7 +385,7 @@ class DeepLake(VectorStore): model was trained. The search is performed using the Deep Memory model. If False, the distance metric is set to "COS" or whatever distance metric user specifies. - **kwargs: Additional keyword arguments. + kwargs: Additional keyword arguments. Returns: List of Documents by the specified distance metric, @@ -505,7 +505,7 @@ class DeepLake(VectorStore): Args: k (int): Number of Documents to return. Defaults to 4. query (str): Text to look up similar documents. - **kwargs: Additional keyword arguments include: + kwargs: Additional keyword arguments include: embedding (Callable): Embedding function to use. Defaults to None. distance_metric (str): 'L2' for Euclidean, 'L1' for Nuclear, 'max' for L-infinity, 'cos' for cosine, 'dot' for dot product. @@ -567,7 +567,7 @@ class DeepLake(VectorStore): embedding (Union[List[float], np.ndarray]): Embedding to find similar docs. k (int): Number of Documents to return. Defaults to 4. - **kwargs: Additional keyword arguments including: + kwargs: Additional keyword arguments including: filter (Union[Dict, Callable], optional): Additional filter before embedding search. - ``Dict`` - Key-value search on tensors of htype json. True @@ -636,7 +636,7 @@ class DeepLake(VectorStore): Args: query (str): Query text to search for. k (int): Number of results to return. Defaults to 4. - **kwargs: Additional keyword arguments. Some of these arguments are: + kwargs: Additional keyword arguments. Some of these arguments are: distance_metric: `L2` for Euclidean, `L1` for Nuclear, `max` L-infinity distance, `cos` for cosine similarity, 'dot' for dot product. Defaults to `L2`. @@ -728,7 +728,7 @@ class DeepLake(VectorStore): which the model was trained. The search is performed using the Deep Memory model. If False, the distance metric is set to "COS" or whatever distance metric user specifies. - **kwargs: Additional keyword arguments. + kwargs: Additional keyword arguments. Returns: List[Documents] - A list of documents. @@ -795,7 +795,7 @@ class DeepLake(VectorStore): which the model was trained. The search is performed using the Deep Memory model. If False, the distance metric is set to "COS" or whatever distance metric user specifies. - **kwargs: Additional keyword arguments + kwargs: Additional keyword arguments Returns: List of Documents selected by maximal marginal relevance. @@ -866,7 +866,7 @@ class DeepLake(VectorStore): Note, in other places, it is called embedding_function. metadatas (Optional[List[dict]]): List of metadatas. Defaults to None. ids (Optional[List[str]]): List of document IDs. Defaults to None. - **kwargs: Additional keyword arguments. + kwargs: Additional keyword arguments. Returns: DeepLake: Deep Lake dataset. diff --git a/libs/community/langchain_community/vectorstores/duckdb.py b/libs/community/langchain_community/vectorstores/duckdb.py index de333693ff0..ed10d3cb104 100644 --- a/libs/community/langchain_community/vectorstores/duckdb.py +++ b/libs/community/langchain_community/vectorstores/duckdb.py @@ -255,7 +255,7 @@ class DuckDB(VectorStore): texts: List of strings to add to the vector store. embedding: The embedding function or model to use for generating embeddings. metadatas: Optional list of metadata dictionaries associated with the texts. - **kwargs: Additional keyword arguments including: + kwargs: Additional keyword arguments including: - connection: DuckDB connection. If not provided, a new connection will be created. - vector_key: The column name for storing vectors. Default "vector". diff --git a/libs/community/langchain_community/vectorstores/tidb_vector.py b/libs/community/langchain_community/vectorstores/tidb_vector.py index e98d3bb6c41..def4eea5600 100644 --- a/libs/community/langchain_community/vectorstores/tidb_vector.py +++ b/libs/community/langchain_community/vectorstores/tidb_vector.py @@ -285,7 +285,7 @@ class TiDBVectorStore(VectorStore): Args: ids (Optional[List[str]]): A list of vector IDs to delete. - **kwargs: Additional keyword arguments. + kwargs: Additional keyword arguments. """ self._tidb.delete(ids=ids, **kwargs) @@ -305,7 +305,7 @@ class TiDBVectorStore(VectorStore): k (int, optional): The number of results to retrieve. Defaults to 4. filter (dict, optional): A filter to apply to the search results. Defaults to None. - **kwargs: Additional keyword arguments. + kwargs: Additional keyword arguments. Returns: List[Document]: A list of Document objects representing the search results. @@ -328,7 +328,7 @@ class TiDBVectorStore(VectorStore): k (int, optional): The number of results to return. Defaults to 5. filter (dict, optional): A filter to apply to the search results. Defaults to None. - **kwargs: Additional keyword arguments. + kwargs: Additional keyword arguments. Returns: A list of tuples containing relevant documents and their similarity scores. diff --git a/libs/community/langchain_community/vectorstores/weaviate.py b/libs/community/langchain_community/vectorstores/weaviate.py index 8d4e6e472b9..10464f3e9bf 100644 --- a/libs/community/langchain_community/vectorstores/weaviate.py +++ b/libs/community/langchain_community/vectorstores/weaviate.py @@ -428,7 +428,7 @@ class Weaviate(VectorStore): relevance_score_fn: Function for converting whatever distance function the vector store uses to a relevance score, which is a normalized similarity score (0 means dissimilar, 1 means similar). - **kwargs: Additional named parameters to pass to ``Weaviate.__init__()``. + kwargs: Additional named parameters to pass to ``Weaviate.__init__()``. Example: .. code-block:: python diff --git a/libs/community/langchain_community/vectorstores/zep.py b/libs/community/langchain_community/vectorstores/zep.py index 5348dd8ac6e..c32c4313ec8 100644 --- a/libs/community/langchain_community/vectorstores/zep.py +++ b/libs/community/langchain_community/vectorstores/zep.py @@ -639,7 +639,7 @@ class ZepVectorStore(VectorStore): api_url (str): The URL of the Zep API. api_key (Optional[str]): The API key for the Zep API. config (Optional[CollectionConfig]): The configuration for the collection. - **kwargs: Additional parameters specific to the vectorstore. + kwargs: Additional parameters specific to the vectorstore. Returns: ZepVectorStore: An instance of ZepVectorStore. diff --git a/libs/community/langchain_community/vectorstores/zep_cloud.py b/libs/community/langchain_community/vectorstores/zep_cloud.py index 052340e4fcd..4a8906980e5 100644 --- a/libs/community/langchain_community/vectorstores/zep_cloud.py +++ b/libs/community/langchain_community/vectorstores/zep_cloud.py @@ -442,7 +442,7 @@ class ZepCloudVectorStore(VectorStore): associated with the texts. collection_name (str): The name of the collection in the Zep store. api_key (str): The API key for the Zep API. - **kwargs: Additional parameters specific to the vectorstore. + kwargs: Additional parameters specific to the vectorstore. Returns: ZepVectorStore: An instance of ZepVectorStore. diff --git a/libs/core/langchain_core/load/dump.py b/libs/core/langchain_core/load/dump.py index df21f13b978..dbc723d41e0 100644 --- a/libs/core/langchain_core/load/dump.py +++ b/libs/core/langchain_core/load/dump.py @@ -28,7 +28,7 @@ def dumps(obj: Any, *, pretty: bool = False, **kwargs: Any) -> str: pretty: Whether to pretty print the json. If true, the json will be indented with 2 spaces (if no indent is provided as part of kwargs). Default is False. - **kwargs: Additional arguments to pass to json.dumps + kwargs: Additional arguments to pass to json.dumps Returns: A json string representation of the object. diff --git a/libs/core/langchain_core/messages/ai.py b/libs/core/langchain_core/messages/ai.py index ade80f7f379..51aeed441d7 100644 --- a/libs/core/langchain_core/messages/ai.py +++ b/libs/core/langchain_core/messages/ai.py @@ -89,7 +89,7 @@ class AIMessage(BaseMessage): Args: content: The content of the message. - **kwargs: Additional arguments to pass to the parent class. + kwargs: Additional arguments to pass to the parent class. """ super().__init__(content=content, **kwargs) diff --git a/libs/core/langchain_core/messages/base.py b/libs/core/langchain_core/messages/base.py index b1fb57a5cdd..c0607f6d957 100644 --- a/libs/core/langchain_core/messages/base.py +++ b/libs/core/langchain_core/messages/base.py @@ -61,7 +61,7 @@ class BaseMessage(Serializable): Args: content: The string contents of the message. - **kwargs: Additional fields to pass to the + kwargs: Additional fields to pass to the """ super().__init__(content=content, **kwargs) diff --git a/libs/core/langchain_core/messages/human.py b/libs/core/langchain_core/messages/human.py index 18b37e4c041..b61c0616af1 100644 --- a/libs/core/langchain_core/messages/human.py +++ b/libs/core/langchain_core/messages/human.py @@ -51,7 +51,7 @@ class HumanMessage(BaseMessage): Args: content: The string contents of the message. - **kwargs: Additional fields to pass to the message. + kwargs: Additional fields to pass to the message. """ super().__init__(content=content, **kwargs) diff --git a/libs/core/langchain_core/messages/modifier.py b/libs/core/langchain_core/messages/modifier.py index 7eff055aa02..66d6dd531d6 100644 --- a/libs/core/langchain_core/messages/modifier.py +++ b/libs/core/langchain_core/messages/modifier.py @@ -16,7 +16,7 @@ class RemoveMessage(BaseMessage): Args: id: The ID of the message to remove. - **kwargs: Additional fields to pass to the message. + kwargs: Additional fields to pass to the message. Raises: ValueError: If the 'content' field is passed in kwargs. diff --git a/libs/core/langchain_core/messages/system.py b/libs/core/langchain_core/messages/system.py index 3e3255a9994..07bcbe64ddd 100644 --- a/libs/core/langchain_core/messages/system.py +++ b/libs/core/langchain_core/messages/system.py @@ -45,7 +45,7 @@ class SystemMessage(BaseMessage): Args: content: The string contents of the message. - **kwargs: Additional fields to pass to the message. + kwargs: Additional fields to pass to the message. """ super().__init__(content=content, **kwargs) diff --git a/libs/core/langchain_core/messages/tool.py b/libs/core/langchain_core/messages/tool.py index 4a5ac5f6121..61baa32de58 100644 --- a/libs/core/langchain_core/messages/tool.py +++ b/libs/core/langchain_core/messages/tool.py @@ -83,7 +83,7 @@ class ToolMessage(BaseMessage): Args: content: The string contents of the message. - **kwargs: Additional fields to pass to the message + kwargs: Additional fields to pass to the message """ super().__init__(content=content, **kwargs) diff --git a/libs/core/langchain_core/retrievers.py b/libs/core/langchain_core/retrievers.py index 87d7f27aacb..efce96bdade 100644 --- a/libs/core/langchain_core/retrievers.py +++ b/libs/core/langchain_core/retrievers.py @@ -179,7 +179,7 @@ class BaseRetriever(RunnableSerializable[RetrieverInput, RetrieverOutput], ABC): Args: input: The query string. config: Configuration for the retriever. Defaults to None. - **kwargs: Additional arguments to pass to the retriever. + kwargs: Additional arguments to pass to the retriever. Returns: List of relevant documents. @@ -238,7 +238,7 @@ class BaseRetriever(RunnableSerializable[RetrieverInput, RetrieverOutput], ABC): Args: input: The query string. config: Configuration for the retriever. Defaults to None. - **kwargs: Additional arguments to pass to the retriever. + kwargs: Additional arguments to pass to the retriever. Returns: List of relevant documents. @@ -343,7 +343,7 @@ class BaseRetriever(RunnableSerializable[RetrieverInput, RetrieverOutput], ABC): and passed as arguments to the handlers defined in `callbacks`. Defaults to None. run_name: Optional name for the run. Defaults to None. - **kwargs: Additional arguments to pass to the retriever. + kwargs: Additional arguments to pass to the retriever. Returns: List of relevant documents. @@ -387,7 +387,7 @@ class BaseRetriever(RunnableSerializable[RetrieverInput, RetrieverOutput], ABC): and passed as arguments to the handlers defined in `callbacks`. Defaults to None. run_name: Optional name for the run. Defaults to None. - **kwargs: Additional arguments to pass to the retriever. + kwargs: Additional arguments to pass to the retriever. Returns: List of relevant documents. diff --git a/libs/core/langchain_core/runnables/base.py b/libs/core/langchain_core/runnables/base.py index c05aef70f99..a79e59dd587 100644 --- a/libs/core/langchain_core/runnables/base.py +++ b/libs/core/langchain_core/runnables/base.py @@ -738,7 +738,7 @@ class Runnable(Generic[Input, Output], ABC): for more details. Defaults to None. return_exceptions: Whether to return exceptions instead of raising them. Defaults to False. - **kwargs: Additional keyword arguments to pass to the Runnable. + kwargs: Additional keyword arguments to pass to the Runnable. Returns: A list of outputs from the Runnable. @@ -802,7 +802,7 @@ class Runnable(Generic[Input, Output], ABC): for more details. Defaults to None. Defaults to None. return_exceptions: Whether to return exceptions instead of raising them. Defaults to False. - **kwargs: Additional keyword arguments to pass to the Runnable. + kwargs: Additional keyword arguments to pass to the Runnable. Yields: A tuple of the index of the input and the output from the Runnable. @@ -846,7 +846,7 @@ class Runnable(Generic[Input, Output], ABC): Args: input: The input to the Runnable. config: The config to use for the Runnable. Defaults to None. - **kwargs: Additional keyword arguments to pass to the Runnable. + kwargs: Additional keyword arguments to pass to the Runnable. Yields: The output of the Runnable. @@ -866,7 +866,7 @@ class Runnable(Generic[Input, Output], ABC): Args: input: The input to the Runnable. config: The config to use for the Runnable. Defaults to None. - **kwargs: Additional keyword arguments to pass to the Runnable. + kwargs: Additional keyword arguments to pass to the Runnable. Yields: The output of the Runnable. @@ -943,7 +943,7 @@ class Runnable(Generic[Input, Output], ABC): exclude_names: Exclude logs with these names. exclude_types: Exclude logs with these types. exclude_tags: Exclude logs with these tags. - **kwargs: Additional keyword arguments to pass to the Runnable. + kwargs: Additional keyword arguments to pass to the Runnable. Yields: A RunLogPatch or RunLog object. @@ -1260,7 +1260,7 @@ class Runnable(Generic[Input, Output], ABC): Args: input: An iterator of inputs to the Runnable. config: The config to use for the Runnable. Defaults to None. - **kwargs: Additional keyword arguments to pass to the Runnable. + kwargs: Additional keyword arguments to pass to the Runnable. Yields: The output of the Runnable. @@ -1302,7 +1302,7 @@ class Runnable(Generic[Input, Output], ABC): Args: input: An async iterator of inputs to the Runnable. config: The config to use for the Runnable. Defaults to None. - **kwargs: Additional keyword arguments to pass to the Runnable. + kwargs: Additional keyword arguments to pass to the Runnable. Yields: The output of the Runnable. @@ -4429,7 +4429,7 @@ class RunnableLambda(Runnable[Input, Output]): Args: input: The input to this Runnable. config: The config to use. Defaults to None. - **kwargs: Additional keyword arguments. + kwargs: Additional keyword arguments. Returns: The output of this Runnable. @@ -4461,7 +4461,7 @@ class RunnableLambda(Runnable[Input, Output]): Args: input: The input to this Runnable. config: The config to use. Defaults to None. - **kwargs: Additional keyword arguments. + kwargs: Additional keyword arguments. Returns: The output of this Runnable. diff --git a/libs/core/langchain_core/runnables/branch.py b/libs/core/langchain_core/runnables/branch.py index b18f065926b..9b52d04091b 100644 --- a/libs/core/langchain_core/runnables/branch.py +++ b/libs/core/langchain_core/runnables/branch.py @@ -196,7 +196,7 @@ class RunnableBranch(RunnableSerializable[Input, Output]): Args: input: The input to the Runnable. config: The configuration for the Runnable. Defaults to None. - **kwargs: Additional keyword arguments to pass to the Runnable. + kwargs: Additional keyword arguments to pass to the Runnable. Returns: The output of the branch that was run. @@ -309,7 +309,7 @@ class RunnableBranch(RunnableSerializable[Input, Output]): Args: input: The input to the Runnable. config: The configuration for the Runnable. Defaults to None. - **kwargs: Additional keyword arguments to pass to the Runnable. + kwargs: Additional keyword arguments to pass to the Runnable. Yields: The output of the branch that was run. @@ -396,7 +396,7 @@ class RunnableBranch(RunnableSerializable[Input, Output]): Args: input: The input to the Runnable. config: The configuration for the Runnable. Defaults to None. - **kwargs: Additional keyword arguments to pass to the Runnable. + kwargs: Additional keyword arguments to pass to the Runnable. Yields: The output of the branch that was run. diff --git a/libs/core/langchain_core/tools.py b/libs/core/langchain_core/tools.py index 5ff3a72cd33..fcd93025bc7 100644 --- a/libs/core/langchain_core/tools.py +++ b/libs/core/langchain_core/tools.py @@ -859,7 +859,7 @@ class Tool(BaseTool): return_direct: Whether to return the output directly. Defaults to False. args_schema: The schema of the tool's input arguments. Defaults to None. coroutine: The asynchronous version of the function. Defaults to None. - **kwargs: Additional arguments to pass to the tool. + kwargs: Additional arguments to pass to the tool. Returns: The tool. @@ -992,7 +992,7 @@ class StructuredTool(BaseTool): error_on_invalid_docstring: if ``parse_docstring`` is provided, configure whether to raise ValueError on invalid Google Style docstrings. Defaults to False. - **kwargs: Additional arguments to pass to the tool + kwargs: Additional arguments to pass to the tool Returns: The tool. diff --git a/libs/core/langchain_core/tracers/base.py b/libs/core/langchain_core/tracers/base.py index cd3c645cfd8..a0b94afb7b7 100644 --- a/libs/core/langchain_core/tracers/base.py +++ b/libs/core/langchain_core/tracers/base.py @@ -72,7 +72,7 @@ class BaseTracer(_TracerCore, BaseCallbackHandler, ABC): parent_run_id: The parent run ID. Defaults to None. metadata: The metadata for the run. Defaults to None. name: The name of the run. - **kwargs: Additional arguments. + kwargs: Additional arguments. Returns: The run. @@ -113,7 +113,7 @@ class BaseTracer(_TracerCore, BaseCallbackHandler, ABC): parent_run_id: The parent run ID. Defaults to None. metadata: The metadata for the run. Defaults to None. name: The name of the run. - **kwargs: Additional arguments. + kwargs: Additional arguments. Returns: The run. @@ -148,7 +148,7 @@ class BaseTracer(_TracerCore, BaseCallbackHandler, ABC): chunk: The chunk. Defaults to None. run_id: The run ID. parent_run_id: The parent run ID. Defaults to None. - **kwargs: Additional arguments. + kwargs: Additional arguments. Returns: The run. @@ -177,7 +177,7 @@ class BaseTracer(_TracerCore, BaseCallbackHandler, ABC): Args: retry_state: The retry state. run_id: The run ID. - **kwargs: Additional arguments. + kwargs: Additional arguments. Returns: The run. @@ -194,7 +194,7 @@ class BaseTracer(_TracerCore, BaseCallbackHandler, ABC): Args: response: The response. run_id: The run ID. - **kwargs: Additional arguments. + kwargs: Additional arguments. Returns: The run. @@ -221,7 +221,7 @@ class BaseTracer(_TracerCore, BaseCallbackHandler, ABC): Args: error: The error. run_id: The run ID. - **kwargs: Additional arguments. + kwargs: Additional arguments. Returns: The run. @@ -260,7 +260,7 @@ class BaseTracer(_TracerCore, BaseCallbackHandler, ABC): metadata: The metadata for the run. Defaults to None. run_type: The type of the run. Defaults to None. name: The name of the run. - **kwargs: Additional arguments. + kwargs: Additional arguments. Returns: The run. @@ -294,7 +294,7 @@ class BaseTracer(_TracerCore, BaseCallbackHandler, ABC): outputs: The outputs for the chain. run_id: The run ID. inputs: The inputs for the chain. Defaults to None. - **kwargs: Additional arguments. + kwargs: Additional arguments. Returns: The run. @@ -323,7 +323,7 @@ class BaseTracer(_TracerCore, BaseCallbackHandler, ABC): error: The error. inputs: The inputs for the chain. Defaults to None. run_id: The run ID. - **kwargs: Additional arguments. + kwargs: Additional arguments. Returns: The run. @@ -362,7 +362,7 @@ class BaseTracer(_TracerCore, BaseCallbackHandler, ABC): metadata: The metadata for the run. Defaults to None. name: The name of the run. inputs: The inputs for the tool. - **kwargs: Additional arguments. + kwargs: Additional arguments. Returns: The run. @@ -388,7 +388,7 @@ class BaseTracer(_TracerCore, BaseCallbackHandler, ABC): Args: output: The output for the tool. run_id: The run ID. - **kwargs: Additional arguments. + kwargs: Additional arguments. Returns: The run. @@ -414,7 +414,7 @@ class BaseTracer(_TracerCore, BaseCallbackHandler, ABC): Args: error: The error. run_id: The run ID. - **kwargs: Additional arguments. + kwargs: Additional arguments. Returns: The run. @@ -449,7 +449,7 @@ class BaseTracer(_TracerCore, BaseCallbackHandler, ABC): tags: The tags for the run. Defaults to None. metadata: The metadata for the run. Defaults to None. name: The name of the run. - **kwargs: Additional arguments. + kwargs: Additional arguments. Returns: The run. @@ -480,7 +480,7 @@ class BaseTracer(_TracerCore, BaseCallbackHandler, ABC): Args: error: The error. run_id: The run ID. - **kwargs: Additional arguments. + kwargs: Additional arguments. Returns: The run. @@ -502,7 +502,7 @@ class BaseTracer(_TracerCore, BaseCallbackHandler, ABC): Args: documents: The documents. run_id: The run ID. - **kwargs: Additional arguments. + kwargs: Additional arguments. Returns: The run. diff --git a/libs/core/langchain_core/tracers/langchain.py b/libs/core/langchain_core/tracers/langchain.py index adc8813ac3a..a8ef48fd013 100644 --- a/libs/core/langchain_core/tracers/langchain.py +++ b/libs/core/langchain_core/tracers/langchain.py @@ -94,7 +94,7 @@ class LangChainTracer(BaseTracer): project_name: The project name. Defaults to the tracer project. client: The client. Defaults to the global client. tags: The tags. Defaults to an empty list. - **kwargs: Additional keyword arguments. + kwargs: Additional keyword arguments. """ super().__init__(**kwargs) self.example_id = ( @@ -127,7 +127,7 @@ class LangChainTracer(BaseTracer): parent_run_id: The parent run ID. Defaults to None. metadata: The metadata. Defaults to None. name: The name. Defaults to None. - **kwargs: Additional keyword arguments. + kwargs: Additional keyword arguments. Returns: Run: The run. diff --git a/libs/core/langchain_core/vectorstores/base.py b/libs/core/langchain_core/vectorstores/base.py index 19b8b86ac81..87806ecb3a1 100644 --- a/libs/core/langchain_core/vectorstores/base.py +++ b/libs/core/langchain_core/vectorstores/base.py @@ -145,7 +145,7 @@ class VectorStore(ABC): Args: items: Iterable of Documents to add to the vectorstore. batch_size: The size of each batch to upsert. - **kwargs: Additional keyword arguments. + kwargs: Additional keyword arguments. kwargs should only include parameters that are common to all documents. (e.g., timeout for indexing, retry policy, etc.) kwargs should not include ids to avoid ambiguous semantics. @@ -186,7 +186,7 @@ class VectorStore(ABC): Args: items: Sequence of Documents to add to the vectorstore. - **kwargs: Additional keyword arguments. + kwargs: Additional keyword arguments. Returns: UpsertResponse: A response object that contains the list of IDs that were @@ -247,7 +247,7 @@ class VectorStore(ABC): Args: items: Iterable of Documents to add to the vectorstore. batch_size: The size of each batch to upsert. - **kwargs: Additional keyword arguments. + kwargs: Additional keyword arguments. kwargs should only include parameters that are common to all documents. (e.g., timeout for indexing, retry policy, etc.) kwargs should not include ids to avoid ambiguous semantics. @@ -279,7 +279,7 @@ class VectorStore(ABC): Args: items: Sequence of Documents to add to the vectorstore. - **kwargs: Additional keyword arguments. + kwargs: Additional keyword arguments. Returns: UpsertResponse: A response object that contains the list of IDs that were @@ -1048,7 +1048,7 @@ class VectorStore(ABC): Args: documents: List of Documents to add to the vectorstore. embedding: Embedding function to use. - **kwargs: Additional keyword arguments. + kwargs: Additional keyword arguments. Returns: VectorStore: VectorStore initialized from documents and embeddings. @@ -1069,7 +1069,7 @@ class VectorStore(ABC): Args: documents: List of Documents to add to the vectorstore. embedding: Embedding function to use. - **kwargs: Additional keyword arguments. + kwargs: Additional keyword arguments. Returns: VectorStore: VectorStore initialized from documents and embeddings. @@ -1094,7 +1094,7 @@ class VectorStore(ABC): embedding: Embedding function to use. metadatas: Optional list of metadatas associated with the texts. Default is None. - **kwargs: Additional keyword arguments. + kwargs: Additional keyword arguments. Returns: VectorStore: VectorStore initialized from texts and embeddings. @@ -1115,7 +1115,7 @@ class VectorStore(ABC): embedding: Embedding function to use. metadatas: Optional list of metadatas associated with the texts. Default is None. - **kwargs: Additional keyword arguments. + kwargs: Additional keyword arguments. Returns: VectorStore: VectorStore initialized from texts and embeddings. diff --git a/libs/core/langchain_core/vectorstores/in_memory.py b/libs/core/langchain_core/vectorstores/in_memory.py index 3ac363f22da..3adb1f6888c 100644 --- a/libs/core/langchain_core/vectorstores/in_memory.py +++ b/libs/core/langchain_core/vectorstores/in_memory.py @@ -324,7 +324,7 @@ class InMemoryVectorStore(VectorStore): Args: path: The path to load the vector store from. embedding: The embedding to use. - **kwargs: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. Returns: A VectorStore object. diff --git a/libs/experimental/langchain_experimental/agents/agent_toolkits/csv/base.py b/libs/experimental/langchain_experimental/agents/agent_toolkits/csv/base.py index e757714d6d8..4e0c946cdcf 100644 --- a/libs/experimental/langchain_experimental/agents/agent_toolkits/csv/base.py +++ b/libs/experimental/langchain_experimental/agents/agent_toolkits/csv/base.py @@ -25,7 +25,7 @@ def create_csv_agent( path: A string path, file-like object or a list of string paths/file-like objects that can be read in as pandas DataFrames with pd.read_csv(). pandas_kwargs: Named arguments to pass to pd.read_csv(). - **kwargs: Additional kwargs to pass to langchain_experimental.agents.agent_toolkits.pandas.base.create_pandas_dataframe_agent(). + kwargs: Additional kwargs to pass to langchain_experimental.agents.agent_toolkits.pandas.base.create_pandas_dataframe_agent(). Returns: An AgentExecutor with the specified agent_type agent and access to diff --git a/libs/experimental/langchain_experimental/graph_transformers/diffbot.py b/libs/experimental/langchain_experimental/graph_transformers/diffbot.py index 42659670065..8adb0b90790 100644 --- a/libs/experimental/langchain_experimental/graph_transformers/diffbot.py +++ b/libs/experimental/langchain_experimental/graph_transformers/diffbot.py @@ -352,7 +352,7 @@ class DiffbotGraphTransformer: Args: documents (Sequence[Document]): The original documents. - **kwargs: Additional keyword arguments. + kwargs: Additional keyword arguments. Returns: Sequence[GraphDocument]: The transformed documents as graphs. diff --git a/libs/experimental/langchain_experimental/graph_transformers/llm.py b/libs/experimental/langchain_experimental/graph_transformers/llm.py index f9f6fc87926..6b1c60ad83e 100644 --- a/libs/experimental/langchain_experimental/graph_transformers/llm.py +++ b/libs/experimental/langchain_experimental/graph_transformers/llm.py @@ -774,7 +774,7 @@ class LLMGraphTransformer: Args: documents (Sequence[Document]): The original documents. - **kwargs: Additional keyword arguments. + kwargs: Additional keyword arguments. Returns: Sequence[GraphDocument]: The transformed documents as graphs. diff --git a/libs/experimental/langchain_experimental/graph_transformers/relik.py b/libs/experimental/langchain_experimental/graph_transformers/relik.py index 05a8a35b061..94eeab10fa4 100644 --- a/libs/experimental/langchain_experimental/graph_transformers/relik.py +++ b/libs/experimental/langchain_experimental/graph_transformers/relik.py @@ -89,7 +89,7 @@ class RelikGraphTransformer: Args: documents (Sequence[Document]): The original documents. - **kwargs: Additional keyword arguments. + kwargs: Additional keyword arguments. Returns: Sequence[GraphDocument]: The transformed documents as graphs. diff --git a/libs/experimental/langchain_experimental/tabular_synthetic_data/openai.py b/libs/experimental/langchain_experimental/tabular_synthetic_data/openai.py index eedd86f6d93..33f33e27d4b 100644 --- a/libs/experimental/langchain_experimental/tabular_synthetic_data/openai.py +++ b/libs/experimental/langchain_experimental/tabular_synthetic_data/openai.py @@ -41,7 +41,7 @@ def create_openai_data_generator( from the function types. - **kwargs: Additional keyword arguments to be passed to + kwargs: Additional keyword arguments to be passed to `create_structured_output_chain`. diff --git a/libs/langchain/langchain/agents/agent.py b/libs/langchain/langchain/agents/agent.py index 3e47ac1094f..ce84c188386 100644 --- a/libs/langchain/langchain/agents/agent.py +++ b/libs/langchain/langchain/agents/agent.py @@ -156,7 +156,7 @@ class BaseSingleActionAgent(BaseModel): llm: Language model to use. tools: Tools to use. callback_manager: Callback manager to use. - **kwargs: Additional arguments. + kwargs: Additional arguments. Returns: BaseSingleActionAgent: Agent object. @@ -939,7 +939,7 @@ class Agent(BaseSingleActionAgent): tools: Tools to use. callback_manager: Callback manager to use. output_parser: Output parser to use. - **kwargs: Additional arguments. + kwargs: Additional arguments. Returns: Agent: Agent object. @@ -1110,7 +1110,7 @@ class AgentExecutor(Chain): agent: Agent to use. tools: Tools to use. callbacks: Callbacks to use. - **kwargs: Additional arguments. + kwargs: Additional arguments. Returns: AgentExecutor: Agent executor object. @@ -1741,7 +1741,7 @@ class AgentExecutor(Chain): Args: input: Input to the agent. config: Config to use. - **kwargs: Additional arguments. + kwargs: Additional arguments. Yields: AddableDict: Addable dictionary. @@ -1772,7 +1772,7 @@ class AgentExecutor(Chain): Args: input: Input to the agent. config: Config to use. - **kwargs: Additional arguments. + kwargs: Additional arguments. Yields: AddableDict: Addable dictionary. diff --git a/libs/langchain/langchain/agents/agent_toolkits/vectorstore/base.py b/libs/langchain/langchain/agents/agent_toolkits/vectorstore/base.py index 681f48bfb0c..79c2a477b59 100644 --- a/libs/langchain/langchain/agents/agent_toolkits/vectorstore/base.py +++ b/libs/langchain/langchain/agents/agent_toolkits/vectorstore/base.py @@ -33,7 +33,7 @@ def create_vectorstore_agent( prefix (str, optional): The prefix prompt for the agent. If not provided uses default PREFIX. verbose (bool, optional): If you want to see the content of the scratchpad. [ Defaults to False ] agent_executor_kwargs (Optional[Dict[str, Any]], optional): If there is any other parameter you want to send to the agent. [ Defaults to None ] - **kwargs: Additional named parameters to pass to the ZeroShotAgent. + kwargs: Additional named parameters to pass to the ZeroShotAgent. Returns: AgentExecutor: Returns a callable AgentExecutor object. Either you can call it or use run method with the query to get the response @@ -74,7 +74,7 @@ def create_vectorstore_router_agent( prefix (str, optional): The prefix prompt for the router agent. If not provided uses default ROUTER_PREFIX. verbose (bool, optional): If you want to see the content of the scratchpad. [ Defaults to False ] agent_executor_kwargs (Optional[Dict[str, Any]], optional): If there is any other parameter you want to send to the agent. [ Defaults to None ] - **kwargs: Additional named parameters to pass to the ZeroShotAgent. + kwargs: Additional named parameters to pass to the ZeroShotAgent. Returns: AgentExecutor: Returns a callable AgentExecutor object. Either you can call it or use run method with the query to get the response. diff --git a/libs/langchain/langchain/agents/initialize.py b/libs/langchain/langchain/agents/initialize.py index 6e93a27164c..fcfa35b5364 100644 --- a/libs/langchain/langchain/agents/initialize.py +++ b/libs/langchain/langchain/agents/initialize.py @@ -45,7 +45,7 @@ def initialize_agent( agent_kwargs: Additional keyword arguments to pass to the underlying agent. Defaults to None. tags: Tags to apply to the traced runs. Defaults to None. - **kwargs: Additional keyword arguments passed to the agent executor. + kwargs: Additional keyword arguments passed to the agent executor. Returns: An agent executor. diff --git a/libs/langchain/langchain/agents/loading.py b/libs/langchain/langchain/agents/loading.py index 5159fc7a321..d2188529b9a 100644 --- a/libs/langchain/langchain/agents/loading.py +++ b/libs/langchain/langchain/agents/loading.py @@ -44,7 +44,7 @@ def load_agent_from_config( config: Config dict to load agent from. llm: Language model to use as the agent. tools: List of tools this agent has access to. - **kwargs: Additional keyword arguments passed to the agent executor. + kwargs: Additional keyword arguments passed to the agent executor. Returns: An agent executor. @@ -98,7 +98,7 @@ def load_agent( Args: path: Path to the agent file. - **kwargs: Additional keyword arguments passed to the agent executor. + kwargs: Additional keyword arguments passed to the agent executor. Returns: An agent executor. diff --git a/libs/langchain/langchain/agents/mrkl/base.py b/libs/langchain/langchain/agents/mrkl/base.py index 2d8e830a912..5257f3206bc 100644 --- a/libs/langchain/langchain/agents/mrkl/base.py +++ b/libs/langchain/langchain/agents/mrkl/base.py @@ -128,7 +128,7 @@ class ZeroShotAgent(Agent): format_instructions: The format instructions to use. Defaults to FORMAT_INSTRUCTIONS. input_variables: The input variables to use. Defaults to None. - **kwargs: Additional parameters to pass to the agent. + kwargs: Additional parameters to pass to the agent. """ cls._validate_tools(tools) prompt = cls.create_prompt( diff --git a/libs/langchain/langchain/agents/openai_assistant/base.py b/libs/langchain/langchain/agents/openai_assistant/base.py index c592942c721..a384e30d2ce 100644 --- a/libs/langchain/langchain/agents/openai_assistant/base.py +++ b/libs/langchain/langchain/agents/openai_assistant/base.py @@ -261,7 +261,7 @@ class OpenAIAssistantRunnable(RunnableSerializable[Dict, OutputType]): model: Assistant model to use. client: OpenAI or AzureOpenAI client. Will create a default OpenAI client if not specified. - **kwargs: Additional arguments. + kwargs: Additional arguments. Returns: OpenAIAssistantRunnable configured to run using the created assistant. @@ -418,7 +418,7 @@ class OpenAIAssistantRunnable(RunnableSerializable[Dict, OutputType]): tools: Override Assistant tools for this run. run_metadata: Metadata to associate with new run. config: Runnable config. Defaults to None. - **kwargs: Additional arguments. + kwargs: Additional arguments. Return: If self.as_agent, will return diff --git a/libs/langchain/langchain/agents/openai_functions_agent/base.py b/libs/langchain/langchain/agents/openai_functions_agent/base.py index 2a009628aea..f39ae1f266b 100644 --- a/libs/langchain/langchain/agents/openai_functions_agent/base.py +++ b/libs/langchain/langchain/agents/openai_functions_agent/base.py @@ -262,7 +262,7 @@ class OpenAIFunctionsAgent(BaseSingleActionAgent): extra_prompt_messages: Extra prompt messages to use. Defaults to None. system_message: The system message to use. Defaults to a default system message. - **kwargs: Additional parameters to pass to the agent. + kwargs: Additional parameters to pass to the agent. """ prompt = cls.create_prompt( extra_prompt_messages=extra_prompt_messages, diff --git a/libs/langchain/langchain/agents/openai_functions_multi_agent/base.py b/libs/langchain/langchain/agents/openai_functions_multi_agent/base.py index eef744820f5..cf20eb81157 100644 --- a/libs/langchain/langchain/agents/openai_functions_multi_agent/base.py +++ b/libs/langchain/langchain/agents/openai_functions_multi_agent/base.py @@ -307,7 +307,7 @@ class OpenAIMultiFunctionsAgent(BaseMultiActionAgent): extra_prompt_messages: Extra prompt messages to use. Default is None. system_message: The system message to use. Default is a default system message. - **kwargs: Additional arguments. + kwargs: Additional arguments. """ prompt = cls.create_prompt( extra_prompt_messages=extra_prompt_messages, diff --git a/libs/langchain/langchain/chains/conversational_retrieval/base.py b/libs/langchain/langchain/chains/conversational_retrieval/base.py index b35f93167f6..f2ab3acf403 100644 --- a/libs/langchain/langchain/chains/conversational_retrieval/base.py +++ b/libs/langchain/langchain/chains/conversational_retrieval/base.py @@ -445,7 +445,7 @@ class ConversationalRetrievalChain(BaseConversationalRetrievalChain): combine_docs_chain_kwargs: Parameters to pass as kwargs to `load_qa_chain` when constructing the combine_docs_chain. callbacks: Callbacks to pass to all subchains. - **kwargs: Additional parameters to pass when initializing + kwargs: Additional parameters to pass when initializing ConversationalRetrievalChain """ combine_docs_chain_kwargs = combine_docs_chain_kwargs or {} diff --git a/libs/langchain/langchain/chains/elasticsearch_database/base.py b/libs/langchain/langchain/chains/elasticsearch_database/base.py index f7360aaa414..4ea74f1cd37 100644 --- a/libs/langchain/langchain/chains/elasticsearch_database/base.py +++ b/libs/langchain/langchain/chains/elasticsearch_database/base.py @@ -197,7 +197,7 @@ class ElasticsearchDatabaseChain(Chain): answer_prompt: The prompt to use for answering user question given data. query_output_parser: The output parser to use for parsing model-generated ES query. Defaults to SimpleJsonOutputParser. - **kwargs: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. """ query_prompt = query_prompt or DSL_PROMPT query_output_parser = query_output_parser or SimpleJsonOutputParser() diff --git a/libs/langchain/langchain/chains/flare/base.py b/libs/langchain/langchain/chains/flare/base.py index 8070fc12374..8a100ed0595 100644 --- a/libs/langchain/langchain/chains/flare/base.py +++ b/libs/langchain/langchain/chains/flare/base.py @@ -245,7 +245,7 @@ class FlareChain(Chain): Args: llm: Language model to use. max_generation_len: Maximum length of the generated response. - **kwargs: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. Returns: FlareChain class with the given language model. diff --git a/libs/langchain/langchain/chains/query_constructor/base.py b/libs/langchain/langchain/chains/query_constructor/base.py index 17a033a741f..0d303f6a616 100644 --- a/libs/langchain/langchain/chains/query_constructor/base.py +++ b/libs/langchain/langchain/chains/query_constructor/base.py @@ -217,7 +217,7 @@ def get_query_constructor_prompt( enable_limit: Whether to enable the limit operator. Defaults to False. schema_prompt: Prompt for describing query schema. Should have string input variables allowed_comparators and allowed_operators. - **kwargs: Additional named params to pass to FewShotPromptTemplate init. + kwargs: Additional named params to pass to FewShotPromptTemplate init. Returns: A prompt template that can be used to construct queries. @@ -339,7 +339,7 @@ def load_query_constructor_runnable( variables allowed_comparators and allowed_operators. fix_invalid: Whether to fix invalid filter directives by ignoring invalid operators, comparators and attributes. - **kwargs: Additional named params to pass to FewShotPromptTemplate init. + kwargs: Additional named params to pass to FewShotPromptTemplate init. Returns: A Runnable that can be used to construct queries. diff --git a/libs/langchain/langchain/chains/structured_output/base.py b/libs/langchain/langchain/chains/structured_output/base.py index 9a0d00fffb7..3b2ae20aa83 100644 --- a/libs/langchain/langchain/chains/structured_output/base.py +++ b/libs/langchain/langchain/chains/structured_output/base.py @@ -224,7 +224,7 @@ def create_structured_output_runnable( structured outputs or a single one. If True and model does not return any structured outputs then chain output is None. If False and model does not return any structured outputs then chain output is an empty list. - **kwargs: Additional named arguments. + kwargs: Additional named arguments. Returns: A runnable sequence that will return a structured output(s) matching the given diff --git a/libs/langchain/langchain/evaluation/parsing/json_schema.py b/libs/langchain/langchain/evaluation/parsing/json_schema.py index 1ecc59d6a36..ff3d3f80277 100644 --- a/libs/langchain/langchain/evaluation/parsing/json_schema.py +++ b/libs/langchain/langchain/evaluation/parsing/json_schema.py @@ -36,7 +36,7 @@ class JsonSchemaEvaluator(StringEvaluator): """Initializes the JsonSchemaEvaluator. Args: - **kwargs: Additional keyword arguments. + kwargs: Additional keyword arguments. Raises: ImportError: If the jsonschema package is not installed. diff --git a/libs/langchain/langchain/evaluation/schema.py b/libs/langchain/langchain/evaluation/schema.py index 6fd08897552..a21a2f1e4f4 100644 --- a/libs/langchain/langchain/evaluation/schema.py +++ b/libs/langchain/langchain/evaluation/schema.py @@ -158,7 +158,7 @@ class StringEvaluator(_EvalArgsMixin, ABC): prediction (str): The LLM or chain prediction to evaluate. reference (Optional[str], optional): The reference label to evaluate against. input (Optional[str], optional): The input to consider during evaluation. - **kwargs: Additional keyword arguments, including callbacks, tags, etc. + kwargs: Additional keyword arguments, including callbacks, tags, etc. Returns: dict: The evaluation results containing the score or value. It is recommended that the dictionary contain the following keys: @@ -181,7 +181,7 @@ class StringEvaluator(_EvalArgsMixin, ABC): prediction (str): The LLM or chain prediction to evaluate. reference (Optional[str], optional): The reference label to evaluate against. input (Optional[str], optional): The input to consider during evaluation. - **kwargs: Additional keyword arguments, including callbacks, tags, etc. + kwargs: Additional keyword arguments, including callbacks, tags, etc. Returns: dict: The evaluation results containing the score or value. It is recommended that the dictionary contain the following keys: @@ -212,7 +212,7 @@ class StringEvaluator(_EvalArgsMixin, ABC): prediction (str): The LLM or chain prediction to evaluate. reference (Optional[str], optional): The reference label to evaluate against. input (Optional[str], optional): The input to consider during evaluation. - **kwargs: Additional keyword arguments, including callbacks, tags, etc. + kwargs: Additional keyword arguments, including callbacks, tags, etc. Returns: dict: The evaluation results containing the score or value. """ # noqa: E501 @@ -235,7 +235,7 @@ class StringEvaluator(_EvalArgsMixin, ABC): prediction (str): The LLM or chain prediction to evaluate. reference (Optional[str], optional): The reference label to evaluate against. input (Optional[str], optional): The input to consider during evaluation. - **kwargs: Additional keyword arguments, including callbacks, tags, etc. + kwargs: Additional keyword arguments, including callbacks, tags, etc. Returns: dict: The evaluation results containing the score or value. """ # noqa: E501 @@ -265,7 +265,7 @@ class PairwiseStringEvaluator(_EvalArgsMixin, ABC): prediction_b (str): The output string from the second model. reference (Optional[str], optional): The expected output / reference string. input (Optional[str], optional): The input string. - **kwargs: Additional keyword arguments, such as callbacks and optional reference strings. + kwargs: Additional keyword arguments, such as callbacks and optional reference strings. Returns: dict: A dictionary containing the preference, scores, and/or other information. """ # noqa: E501 @@ -286,7 +286,7 @@ class PairwiseStringEvaluator(_EvalArgsMixin, ABC): prediction_b (str): The output string from the second model. reference (Optional[str], optional): The expected output / reference string. input (Optional[str], optional): The input string. - **kwargs: Additional keyword arguments, such as callbacks and optional reference strings. + kwargs: Additional keyword arguments, such as callbacks and optional reference strings. Returns: dict: A dictionary containing the preference, scores, and/or other information. """ # noqa: E501 @@ -316,7 +316,7 @@ class PairwiseStringEvaluator(_EvalArgsMixin, ABC): prediction_b (str): The output string from the second model. reference (Optional[str], optional): The expected output / reference string. input (Optional[str], optional): The input string. - **kwargs: Additional keyword arguments, such as callbacks and optional reference strings. + kwargs: Additional keyword arguments, such as callbacks and optional reference strings. Returns: dict: A dictionary containing the preference, scores, and/or other information. """ # noqa: E501 @@ -345,7 +345,7 @@ class PairwiseStringEvaluator(_EvalArgsMixin, ABC): prediction_b (str): The output string from the second model. reference (Optional[str], optional): The expected output / reference string. input (Optional[str], optional): The input string. - **kwargs: Additional keyword arguments, such as callbacks and optional reference strings. + kwargs: Additional keyword arguments, such as callbacks and optional reference strings. Returns: dict: A dictionary containing the preference, scores, and/or other information. """ # noqa: E501 diff --git a/libs/langchain/langchain/evaluation/string_distance/base.py b/libs/langchain/langchain/evaluation/string_distance/base.py index 17a00f98ee8..bb9c9719d73 100644 --- a/libs/langchain/langchain/evaluation/string_distance/base.py +++ b/libs/langchain/langchain/evaluation/string_distance/base.py @@ -278,7 +278,7 @@ class StringDistanceEvalChain(StringEvaluator, _RapidFuzzChainMixin): reference (Optional[str], optional): The reference string. input (Optional[str], optional): The input string. callbacks (Callbacks, optional): The callbacks to use. - **kwargs: Additional keyword arguments. + kwargs: Additional keyword arguments. Returns: dict: The evaluation results containing the score. @@ -314,7 +314,7 @@ class StringDistanceEvalChain(StringEvaluator, _RapidFuzzChainMixin): reference (Optional[str], optional): The reference string. input (Optional[str], optional): The input string. callbacks (Callbacks, optional): The callbacks to use. - **kwargs: Additional keyword arguments. + kwargs: Additional keyword arguments. Returns: dict: The evaluation results containing the score. @@ -412,7 +412,7 @@ class PairwiseStringDistanceEvalChain(PairwiseStringEvaluator, _RapidFuzzChainMi callbacks (Callbacks, optional): The callbacks to use. tags (List[str], optional): Tags to apply to traces. metadata (Dict[str, Any], optional): Metadata to apply to traces. - **kwargs: Additional keyword arguments. + kwargs: Additional keyword arguments. Returns: dict: The evaluation results containing the score. @@ -446,7 +446,7 @@ class PairwiseStringDistanceEvalChain(PairwiseStringEvaluator, _RapidFuzzChainMi callbacks (Callbacks, optional): The callbacks to use. tags (List[str], optional): Tags to apply to traces. metadata (Dict[str, Any], optional): Metadata to apply to traces. - **kwargs: Additional keyword arguments. + kwargs: Additional keyword arguments. Returns: dict: The evaluation results containing the score. diff --git a/libs/langchain/langchain/retrievers/document_compressors/chain_filter.py b/libs/langchain/langchain/retrievers/document_compressors/chain_filter.py index a88bc5924fc..1efaef7abf0 100644 --- a/libs/langchain/langchain/retrievers/document_compressors/chain_filter.py +++ b/libs/langchain/langchain/retrievers/document_compressors/chain_filter.py @@ -104,7 +104,7 @@ class LLMChainFilter(BaseDocumentCompressor): Args: llm: The language model to use for filtering. prompt: The prompt to use for the filter. - **kwargs: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. Returns: A LLMChainFilter that uses the given language model. diff --git a/libs/langchain/langchain/retrievers/document_compressors/listwise_rerank.py b/libs/langchain/langchain/retrievers/document_compressors/listwise_rerank.py index 76fdef05b11..16647df82c6 100644 --- a/libs/langchain/langchain/retrievers/document_compressors/listwise_rerank.py +++ b/libs/langchain/langchain/retrievers/document_compressors/listwise_rerank.py @@ -105,7 +105,7 @@ class LLMListwiseRerank(BaseDocumentCompressor): llm: The language model to use for filtering. **Must implement BaseLanguageModel.with_structured_output().** prompt: The prompt to use for the filter. - **kwargs: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. Returns: A LLMListwiseRerank document compressor that uses the given language model. diff --git a/libs/partners/chroma/langchain_chroma/vectorstores.py b/libs/partners/chroma/langchain_chroma/vectorstores.py index 495b6c9f49e..59debf689cd 100644 --- a/libs/partners/chroma/langchain_chroma/vectorstores.py +++ b/libs/partners/chroma/langchain_chroma/vectorstores.py @@ -250,7 +250,7 @@ class Chroma(VectorStore): e.g. {"color" : "red", "price": 4.20}. where_document: dict used to filter by the documents. E.g. {$contains: {"text": "hello"}}. - **kwargs: Additional keyword arguments to pass to Chroma collection query. + kwargs: Additional keyword arguments to pass to Chroma collection query. Returns: List of `n_results` nearest neighbor embeddings for provided @@ -286,7 +286,7 @@ class Chroma(VectorStore): metadatas: Optional list of metadatas. When querying, you can filter on this metadata. ids: Optional list of IDs. - **kwargs: Additional keyword arguments to pass. + kwargs: Additional keyword arguments to pass. Returns: List of IDs of the added images. @@ -374,7 +374,7 @@ class Chroma(VectorStore): metadatas: Optional list of metadatas. When querying, you can filter on this metadata. ids: Optional list of IDs. - **kwargs: Additional keyword arguments. + kwargs: Additional keyword arguments. Returns: List of IDs of the added texts. @@ -456,7 +456,7 @@ class Chroma(VectorStore): query: Query text to search for. k: Number of results to return. Defaults to 4. filter: Filter by metadata. Defaults to None. - **kwargs: Additional keyword arguments to pass to Chroma collection query. + kwargs: Additional keyword arguments to pass to Chroma collection query. Returns: List of documents most similar to the query text. @@ -482,7 +482,7 @@ class Chroma(VectorStore): filter: Filter by metadata. Defaults to None. where_document: dict used to filter by the documents. E.g. {$contains: {"text": "hello"}}. - **kwargs: Additional keyword arguments to pass to Chroma collection query. + kwargs: Additional keyword arguments to pass to Chroma collection query. Returns: List of Documents most similar to the query vector. @@ -512,7 +512,7 @@ class Chroma(VectorStore): filter: Filter by metadata. Defaults to None. where_document: dict used to filter by the documents. E.g. {$contains: {"text": "hello"}}. - **kwargs: Additional keyword arguments to pass to Chroma collection query. + kwargs: Additional keyword arguments to pass to Chroma collection query. Returns: List of documents most similar to the query text and relevance score @@ -543,7 +543,7 @@ class Chroma(VectorStore): filter: Filter by metadata. Defaults to None. where_document: dict used to filter by the documents. E.g. {$contains: {"text": "hello"}}. - **kwargs: Additional keyword arguments to pass to Chroma collection query. + kwargs: Additional keyword arguments to pass to Chroma collection query. Returns: List of documents most similar to the query text and @@ -722,7 +722,7 @@ class Chroma(VectorStore): filter: Filter by metadata. Defaults to None. where_document: dict used to filter by the documents. E.g. {$contains: {"text": "hello"}}. - **kwargs: Additional keyword arguments to pass to Chroma collection query. + kwargs: Additional keyword arguments to pass to Chroma collection query. Returns: List of Documents selected by maximal marginal relevance. @@ -773,7 +773,7 @@ class Chroma(VectorStore): filter: Filter by metadata. Defaults to None. where_document: dict used to filter by the documents. E.g. {$contains: {"text": "hello"}}. - **kwargs: Additional keyword arguments to pass to Chroma collection query. + kwargs: Additional keyword arguments to pass to Chroma collection query. Returns: List of Documents selected by maximal marginal relevance. @@ -935,7 +935,7 @@ class Chroma(VectorStore): https://docs.trychroma.com/reference/js-client#class:-chromaclient collection_metadata: Collection configurations. Defaults to None. - **kwargs: Additional keyword arguments to initialize a Chroma client. + kwargs: Additional keyword arguments to initialize a Chroma client. Returns: Chroma: Chroma vectorstore. @@ -1000,7 +1000,7 @@ class Chroma(VectorStore): https://docs.trychroma.com/reference/js-client#class:-chromaclient collection_metadata: Collection configurations. Defaults to None. - **kwargs: Additional keyword arguments to initialize a Chroma client. + kwargs: Additional keyword arguments to initialize a Chroma client. Returns: Chroma: Chroma vectorstore. @@ -1025,6 +1025,6 @@ class Chroma(VectorStore): Args: ids: List of ids to delete. - **kwargs: Additional keyword arguments. + kwargs: Additional keyword arguments. """ self._collection.delete(ids=ids) diff --git a/libs/partners/qdrant/langchain_qdrant/fastembed_sparse.py b/libs/partners/qdrant/langchain_qdrant/fastembed_sparse.py index bd612916d89..c521540965e 100644 --- a/libs/partners/qdrant/langchain_qdrant/fastembed_sparse.py +++ b/libs/partners/qdrant/langchain_qdrant/fastembed_sparse.py @@ -34,7 +34,7 @@ class FastEmbedSparse(SparseEmbeddings): If `None`, don't use data-parallel processing,\ use default onnxruntime threading instead.\ Defaults to None. - **kwargs: Additional options to pass to fastembed.SparseTextEmbedding + kwargs: Additional options to pass to fastembed.SparseTextEmbedding Raises: ValueError: If the model_name is not supported in SparseTextEmbedding. """ diff --git a/libs/partners/together/langchain_together/llms.py b/libs/partners/together/langchain_together/llms.py index ed0bebe96db..34517587679 100644 --- a/libs/partners/together/langchain_together/llms.py +++ b/libs/partners/together/langchain_together/llms.py @@ -135,7 +135,7 @@ class Together(LLM): prompt: The prompt to pass into the model. stop: Optional list of stop words to use when generating. run_manager: The CallbackManager for LLM run, it's not used at the moment. - **kwargs: Additional parameters to pass to the model. + kwargs: Additional parameters to pass to the model. Returns: The string generated by the model.. @@ -185,7 +185,7 @@ class Together(LLM): prompt: The prompt to pass into the model. stop: Optional list of stop words to use when generating. run_manager: The CallbackManager for LLM run, it's not used at the moment. - **kwargs: Additional parameters to pass to the model. + kwargs: Additional parameters to pass to the model. Returns: The string generated by the model.