The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
Use term keyword according to the official python doc glossary (#11338)
Vicente Reyesf3e13e7e5a6e
diff --git a/docs/docs_skeleton/docs/get_started/quickstart.mdx b/docs/docs_skeleton/docs/get_started/quickstart.mdxindex bbad4f4488..3c1bf0f8c4 100644--- a/docs/docs_skeleton/docs/get_started/quickstart.mdx+++ b/docs/docs_skeleton/docs/get_started/quickstart.mdx@@ -85,7 +85,7 @@ import InputMessages from "@snippets/get_started/quickstart/input_messages.mdx"<InputMessages/>-For both these methods, you can also pass in parameters as key word arguments.+For both these methods, you can also pass in parameters as keyword arguments.For example, you could pass in `temperature=0` to adjust the temperature that is used from what the object was configured with.Whatever values are passed in during run time will always override what the object was configured with.diff --git a/docs/snippets/modules/agents/get_started.mdx b/docs/snippets/modules/agents/get_started.mdxindex 78f3f71515..9bde8b49ba 100644--- a/docs/snippets/modules/agents/get_started.mdx+++ b/docs/snippets/modules/agents/get_started.mdx@@ -54,7 +54,7 @@ prompt = ChatPromptTemplate.from_messages([```How does the agent know what tools it can use?-Those are passed in as a separate argument, so we can bind those as key word arguments to the LLM.+Those are passed in as a separate argument, so we can bind those as keyword arguments to the LLM.```pythonfrom langchain.tools.render import format_tool_to_openai_functiondiff --git a/libs/langchain/langchain/agents/initialize.py b/libs/langchain/langchain/agents/initialize.pyindex dfbb7f9b47..378d2c9d11 100644--- a/libs/langchain/langchain/agents/initialize.py+++ b/libs/langchain/langchain/agents/initialize.py@@ -30,9 +30,9 @@ def initialize_agent(callback_manager: CallbackManager to use. Global callback manager is used ifnot provided. Defaults to None.agent_path: Path to serialized agent to use.- agent_kwargs: Additional key word arguments to pass to the underlying agent+ agent_kwargs: Additional keyword arguments to pass to the underlying agenttags: Tags to apply to the traced runs.- **kwargs: Additional key word arguments passed to the agent executor+ **kwargs: Additional keyword arguments passed to the agent executorReturns:An agent executordiff --git a/libs/langchain/langchain/agents/loading.py b/libs/langchain/langchain/agents/loading.pyindex 8a0c4a9b3f..32e882c94a 100644--- a/libs/langchain/langchain/agents/loading.py+++ b/libs/langchain/langchain/agents/loading.py@@ -42,7 +42,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 key word arguments passed to the agent executor.+ **kwargs: Additional keyword arguments passed to the agent executor.Returns:An agent executor.@@ -92,7 +92,7 @@ def load_agent(Args:path: Path to the agent file.- **kwargs: Additional key word 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/chat_models/azureml_endpoint.py b/libs/langchain/langchain/chat_models/azureml_endpoint.pyindex 9cd57fbcf8..2ab7d3ea4f 100644--- a/libs/langchain/langchain/chat_models/azureml_endpoint.py+++ b/libs/langchain/langchain/chat_models/azureml_endpoint.py@@ -93,7 +93,7 @@ class AzureMLChatOnlineEndpoint(SimpleChatModel):the endpoint"""model_kwargs: Optional[dict] = None- """Key word arguments to pass to the model."""+ """Keyword arguments to pass to the model."""@validator("http_client", always=True, allow_reuse=True)@classmethoddiff --git a/libs/langchain/langchain/embeddings/bedrock.py b/libs/langchain/langchain/embeddings/bedrock.pyindex 654cce07d0..b65200901b 100644--- a/libs/langchain/langchain/embeddings/bedrock.py+++ b/libs/langchain/langchain/embeddings/bedrock.py@@ -59,7 +59,7 @@ class BedrockEmbeddings(BaseModel, Embeddings):equivalent to the modelId property in the list-foundation-models api"""model_kwargs: Optional[Dict] = None- """Key word arguments to pass to the model."""+ """Keyword arguments to pass to the model."""endpoint_url: Optional[str] = None"""Needed if you don't want to default to us-east-1 endpoint"""diff --git a/libs/langchain/langchain/embeddings/huggingface.py b/libs/langchain/langchain/embeddings/huggingface.pyindex 870c3965a8..5f355d0e2b 100644--- a/libs/langchain/langchain/embeddings/huggingface.py+++ b/libs/langchain/langchain/embeddings/huggingface.py@@ -45,9 +45,9 @@ class HuggingFaceEmbeddings(BaseModel, Embeddings):"""Path to store models.Can be also set by SENTENCE_TRANSFORMERS_HOME environment variable."""model_kwargs: Dict[str, Any] = Field(default_factory=dict)- """Key word arguments to pass to the model."""+ """Keyword arguments to pass to the model."""encode_kwargs: Dict[str, Any] = Field(default_factory=dict)- """Key word arguments to pass when calling the `encode` method of the model."""+ """Keyword arguments to pass when calling the `encode` method of the model."""multi_process: bool = False"""Run encode() on multiple GPUs."""@@ -133,9 +133,9 @@ class HuggingFaceInstructEmbeddings(BaseModel, Embeddings):"""Path to store models.Can be also set by SENTENCE_TRANSFORMERS_HOME environment variable."""model_kwargs: Dict[str, Any] = Field(default_factory=dict)- """Key word arguments to pass to the model."""+ """Keyword arguments to pass to the model."""encode_kwargs: Dict[str, Any] = Field(default_factory=dict)- """Key word arguments to pass when calling the `encode` method of the model."""+ """Keyword arguments to pass when calling the `encode` method of the model."""embed_instruction: str = DEFAULT_EMBED_INSTRUCTION"""Instruction to use for embedding documents."""query_instruction: str = DEFAULT_QUERY_INSTRUCTION@@ -212,9 +212,9 @@ class HuggingFaceBgeEmbeddings(BaseModel, Embeddings):"""Path to store models.Can be also set by SENTENCE_TRANSFORMERS_HOME environment variable."""model_kwargs: Dict[str, Any] = Field(default_factory=dict)- """Key word arguments to pass to the model."""+ """Keyword arguments to pass to the model."""encode_kwargs: Dict[str, Any] = Field(default_factory=dict)- """Key word arguments to pass when calling the `encode` method of the model."""+ """Keyword arguments to pass when calling the `encode` method of the model."""query_instruction: str = DEFAULT_QUERY_BGE_INSTRUCTION_EN"""Instruction to use for embedding query."""diff --git a/libs/langchain/langchain/embeddings/huggingface_hub.py b/libs/langchain/langchain/embeddings/huggingface_hub.pyindex 7bb52f3fa5..d887be2abc 100644--- a/libs/langchain/langchain/embeddings/huggingface_hub.py+++ b/libs/langchain/langchain/embeddings/huggingface_hub.py@@ -33,7 +33,7 @@ class HuggingFaceHubEmbeddings(BaseModel, Embeddings):task: Optional[str] = "feature-extraction""""Task to call the model with."""model_kwargs: Optional[dict] = None- """Key word arguments to pass to the model."""+ """Keyword arguments to pass to the model."""huggingfacehub_api_token: Optional[str] = Nonediff --git a/libs/langchain/langchain/embeddings/sagemaker_endpoint.py b/libs/langchain/langchain/embeddings/sagemaker_endpoint.pyindex f3a72ccb37..6bfd29f2c2 100644--- a/libs/langchain/langchain/embeddings/sagemaker_endpoint.py+++ b/libs/langchain/langchain/embeddings/sagemaker_endpoint.py@@ -90,7 +90,7 @@ class SagemakerEndpointEmbeddings(BaseModel, Embeddings):""" # noqa: E501model_kwargs: Optional[Dict] = None- """Key word arguments to pass to the model."""+ """Keyword arguments to pass to the model."""endpoint_kwargs: Optional[Dict] = None"""Optional attributes passed to the invoke_endpointdiff --git a/libs/langchain/langchain/embeddings/self_hosted_hugging_face.py b/libs/langchain/langchain/embeddings/self_hosted_hugging_face.pyindex e12263d67f..7fbcc60f4d 100644--- a/libs/langchain/langchain/embeddings/self_hosted_hugging_face.py+++ b/libs/langchain/langchain/embeddings/self_hosted_hugging_face.py@@ -86,7 +86,7 @@ class SelfHostedHuggingFaceEmbeddings(SelfHostedEmbeddings):model_load_fn: Callable = load_embedding_model"""Function to load the model remotely on the server."""load_fn_kwargs: Optional[dict] = None- """Key word arguments to pass to the model load function."""+ """Keyword arguments to pass to the model load function."""inference_fn: Callable = _embed_documents"""Inference function to extract the embeddings."""diff --git a/libs/langchain/langchain/llms/amazon_api_gateway.py b/libs/langchain/langchain/llms/amazon_api_gateway.pyindex 3161c0bc2e..1a019dfdd9 100644--- a/libs/langchain/langchain/llms/amazon_api_gateway.py+++ b/libs/langchain/langchain/llms/amazon_api_gateway.py@@ -36,7 +36,7 @@ class AmazonAPIGateway(LLM):"""API Gateway HTTP Headers to send, e.g. for authentication"""model_kwargs: Optional[Dict] = None- """Key word arguments to pass to the model."""+ """Keyword arguments to pass to the model."""content_handler: ContentHandlerAmazonAPIGateway = ContentHandlerAmazonAPIGateway()"""The content handler class that provides an input anddiff --git a/libs/langchain/langchain/llms/anyscale.py b/libs/langchain/langchain/llms/anyscale.pyindex 810d173071..b358296114 100644--- a/libs/langchain/langchain/llms/anyscale.py+++ b/libs/langchain/langchain/llms/anyscale.py@@ -36,7 +36,7 @@ class Anyscale(LLM):"""model_kwargs: Optional[dict] = None- """Key word arguments to pass to the model. Reserved for future use"""+ """Keyword arguments to pass to the model. Reserved for future use"""anyscale_service_url: Optional[str] = Noneanyscale_service_route: Optional[str] = Nonediff --git a/libs/langchain/langchain/llms/azureml_endpoint.py b/libs/langchain/langchain/llms/azureml_endpoint.pyindex 3e7833bc98..e8baa7d8c4 100644--- a/libs/langchain/langchain/llms/azureml_endpoint.py+++ b/libs/langchain/langchain/llms/azureml_endpoint.py@@ -230,7 +230,7 @@ class AzureMLOnlineEndpoint(LLM, BaseModel):the endpoint"""model_kwargs: Optional[dict] = None- """Key word arguments to pass to the model."""+ """Keyword arguments to pass to the model."""@validator("http_client", always=True, allow_reuse=True)@classmethoddiff --git a/libs/langchain/langchain/llms/bedrock.py b/libs/langchain/langchain/llms/bedrock.pyindex 265ac72592..1713af650c 100644--- a/libs/langchain/langchain/llms/bedrock.py+++ b/libs/langchain/langchain/llms/bedrock.py@@ -147,7 +147,7 @@ class BedrockBase(BaseModel, ABC):equivalent to the modelId property in the list-foundation-models api"""model_kwargs: Optional[Dict] = None- """Key word arguments to pass to the model."""+ """Keyword arguments to pass to the model."""endpoint_url: Optional[str] = None"""Needed if you don't want to default to us-east-1 endpoint"""diff --git a/libs/langchain/langchain/llms/chatglm.py b/libs/langchain/langchain/llms/chatglm.pyindex 232f2f9af7..e7b2a49d16 100644--- a/libs/langchain/langchain/llms/chatglm.py+++ b/libs/langchain/langchain/llms/chatglm.py@@ -28,7 +28,7 @@ class ChatGLM(LLM):endpoint_url: str = "http://127.0.0.1:8000/""""Endpoint URL to use."""model_kwargs: Optional[dict] = None- """Key word arguments to pass to the model."""+ """Keyword arguments to pass to the model."""max_token: int = 20000"""Max token allowed to pass to the model."""temperature: float = 0.1diff --git a/libs/langchain/langchain/llms/deepsparse.py b/libs/langchain/langchain/llms/deepsparse.pyindex f506e2c120..aa7d8612af 100644--- a/libs/langchain/langchain/llms/deepsparse.py+++ b/libs/langchain/langchain/llms/deepsparse.py@@ -28,7 +28,7 @@ class DeepSparse(LLM):"""The path to a model file or directory or the name of a SparseZoo model stub."""model_config: Optional[Dict[str, Any]] = None- """Key word arguments passed to the pipeline construction.+ """Keyword arguments passed to the pipeline construction.Common parameters are sequence_length, prompt_sequence_length"""generation_config: Union[None, str, Dict] = Nonediff --git a/libs/langchain/langchain/llms/gradient_ai.py b/libs/langchain/langchain/llms/gradient_ai.pyindex 9bc72a8d2e..4a2c4f12dc 100644--- a/libs/langchain/langchain/llms/gradient_ai.py+++ b/libs/langchain/langchain/llms/gradient_ai.py@@ -54,7 +54,7 @@ class GradientLLM(LLM):"""model_kwargs: Optional[dict] = None- """Key word arguments to pass to the model."""+ """Keyword arguments to pass to the model."""gradient_api_url: str = "https://api.gradient.ai/api""""Endpoint URL to use."""diff --git a/libs/langchain/langchain/llms/huggingface_endpoint.py b/libs/langchain/langchain/llms/huggingface_endpoint.pyindex a1593287a6..2c55bb213e 100644--- a/libs/langchain/langchain/llms/huggingface_endpoint.py+++ b/libs/langchain/langchain/llms/huggingface_endpoint.py@@ -39,7 +39,7 @@ class HuggingFaceEndpoint(LLM):"""Task to call the model with.Should be a task that returns `generated_text` or `summary_text`."""model_kwargs: Optional[dict] = None- """Key word arguments to pass to the model."""+ """Keyword arguments to pass to the model."""huggingfacehub_api_token: Optional[str] = Nonediff --git a/libs/langchain/langchain/llms/huggingface_hub.py b/libs/langchain/langchain/llms/huggingface_hub.pyindex f1bc8977ab..45b326c4e9 100644--- a/libs/langchain/langchain/llms/huggingface_hub.py+++ b/libs/langchain/langchain/llms/huggingface_hub.py@@ -33,7 +33,7 @@ class HuggingFaceHub(LLM):"""Task to call the model with.Should be a task that returns `generated_text` or `summary_text`."""model_kwargs: Optional[dict] = None- """Key word arguments to pass to the model."""+ """Keyword arguments to pass to the model."""huggingfacehub_api_token: Optional[str] = Nonediff --git a/libs/langchain/langchain/llms/huggingface_pipeline.py b/libs/langchain/langchain/llms/huggingface_pipeline.pyindex 336b61842e..0658185902 100644--- a/libs/langchain/langchain/llms/huggingface_pipeline.py+++ b/libs/langchain/langchain/llms/huggingface_pipeline.py@@ -53,9 +53,9 @@ class HuggingFacePipeline(BaseLLM):model_id: str = DEFAULT_MODEL_ID"""Model name to use."""model_kwargs: Optional[dict] = None- """Key word arguments passed to the model."""+ """Keyword arguments passed to the model."""pipeline_kwargs: Optional[dict] = None- """Key word arguments passed to the pipeline."""+ """Keyword arguments passed to the pipeline."""batch_size: int = DEFAULT_BATCH_SIZE"""Batch size to use when passing multiple documents to generate."""diff --git a/libs/langchain/langchain/llms/mosaicml.py b/libs/langchain/langchain/llms/mosaicml.pyindex 718466178b..9103988f5c 100644--- a/libs/langchain/langchain/llms/mosaicml.py+++ b/libs/langchain/langchain/llms/mosaicml.py@@ -53,7 +53,7 @@ class MosaicML(LLM):inject_instruction_format: bool = False"""Whether to inject the instruction format into the prompt."""model_kwargs: Optional[dict] = None- """Key word arguments to pass to the model."""+ """Keyword arguments to pass to the model."""retry_sleep: float = 1.0"""How long to try sleeping for if a rate limit is encountered"""diff --git a/libs/langchain/langchain/llms/octoai_endpoint.py b/libs/langchain/langchain/llms/octoai_endpoint.pyindex 93bdb36ff9..adc2bf89bc 100644--- a/libs/langchain/langchain/llms/octoai_endpoint.py+++ b/libs/langchain/langchain/llms/octoai_endpoint.py@@ -40,7 +40,7 @@ class OctoAIEndpoint(LLM):"""Endpoint URL to use."""model_kwargs: Optional[dict] = None- """Key word arguments to pass to the model."""+ """Keyword arguments to pass to the model."""octoai_api_token: Optional[str] = None"""OCTOAI API Token"""diff --git a/libs/langchain/langchain/llms/openllm.py b/libs/langchain/langchain/llms/openllm.pyindex 4677d8b96c..42238ac3b8 100644--- a/libs/langchain/langchain/llms/openllm.py+++ b/libs/langchain/langchain/llms/openllm.py@@ -88,7 +88,7 @@ class OpenLLM(LLM):"""Initialize this LLM instance in current process by default. Shouldonly set to False when using in conjunction with BentoML Service."""llm_kwargs: Dict[str, Any]- """Key word arguments to be passed to openllm.LLM"""+ """Keyword arguments to be passed to openllm.LLM"""_runner: Optional[openllm.LLMRunner] = PrivateAttr(default=None)_client: Union[diff --git a/libs/langchain/langchain/llms/sagemaker_endpoint.py b/libs/langchain/langchain/llms/sagemaker_endpoint.pyindex b38cbd40d4..c7e465c8c1 100644--- a/libs/langchain/langchain/llms/sagemaker_endpoint.py+++ b/libs/langchain/langchain/llms/sagemaker_endpoint.py@@ -171,7 +171,7 @@ class SagemakerEndpoint(LLM):"""model_kwargs: Optional[Dict] = None- """Key word arguments to pass to the model."""+ """Keyword arguments to pass to the model."""endpoint_kwargs: Optional[Dict] = None"""Optional attributes passed to the invoke_endpointdiff --git a/libs/langchain/langchain/llms/self_hosted.py b/libs/langchain/langchain/llms/self_hosted.pyindex b43ce822e5..8e18881493 100644--- a/libs/langchain/langchain/llms/self_hosted.py+++ b/libs/langchain/langchain/llms/self_hosted.py@@ -132,7 +132,7 @@ class SelfHostedPipeline(LLM):model_load_fn: Callable"""Function to load the model remotely on the server."""load_fn_kwargs: Optional[dict] = None- """Key word arguments to pass to the model load function."""+ """Keyword arguments to pass to the model load function."""model_reqs: List[str] = ["./", "torch"]"""Requirements to install on hardware to inference the model."""diff --git a/libs/langchain/langchain/llms/self_hosted_hugging_face.py b/libs/langchain/langchain/llms/self_hosted_hugging_face.pyindex 0b590cf519..77c00d8173 100644--- a/libs/langchain/langchain/llms/self_hosted_hugging_face.py+++ b/libs/langchain/langchain/llms/self_hosted_hugging_face.py@@ -158,7 +158,7 @@ class SelfHostedHuggingFaceLLM(SelfHostedPipeline):device: int = 0"""Device to use for inference. -1 for CPU, 0 for GPU, 1 for second GPU, etc."""model_kwargs: Optional[dict] = None- """Key word arguments to pass to the model."""+ """Keyword arguments to pass to the model."""hardware: Any"""Remote hardware to send the inference function to."""model_reqs: List[str] = ["./", "transformers", "torch"]diff --git a/libs/langchain/langchain/llms/xinference.py b/libs/langchain/langchain/llms/xinference.pyindex 3b16838da1..9ca7e078dd 100644--- a/libs/langchain/langchain/llms/xinference.py+++ b/libs/langchain/langchain/llms/xinference.py@@ -80,7 +80,7 @@ class Xinference(LLM):model_uid: Optional[str]"""UID of the launched model"""model_kwargs: Dict[str, Any]- """Key word arguments to be passed to xinference.LLM"""+ """Keyword arguments to be passed to xinference.LLM"""def __init__(self,diff --git a/libs/langchain/langchain/retrievers/kendra.py b/libs/langchain/langchain/retrievers/kendra.pyindex fd11358f85..68d6444caa 100644--- a/libs/langchain/langchain/retrievers/kendra.py+++ b/libs/langchain/langchain/retrievers/kendra.py@@ -53,7 +53,7 @@ Dates are also represented as str.# Unexpected keyword argument "extra" for "__init_subclass__" of "object"class Highlight(BaseModel, extra=Extra.allow): # type: ignore[call-arg]- """Information that highlights the key words in the excerpt."""+ """Information that highlights the keywords in the excerpt."""BeginOffset: int"""The zero-based location in the excerpt where the highlight starts."""diff --git a/libs/langchain/tests/unit_tests/test_formatting.py b/libs/langchain/tests/unit_tests/test_formatting.pyindex 482615608e..ef941932da 100644--- a/libs/langchain/tests/unit_tests/test_formatting.py+++ b/libs/langchain/tests/unit_tests/test_formatting.py@@ -20,7 +20,7 @@ def test_does_not_allow_args() -> None:def test_does_not_allow_extra_kwargs() -> None:- """Test formatting does not allow extra key word arguments."""+ """Test formatting does not allow extra keyword arguments."""template = "This is a {foo} test."with pytest.raises(KeyError):formatter.format(template, foo="good", bar="oops")