diff --git a/langchain/agents/initialize.py b/langchain/agents/initialize.py index 550061e4613..e4d43d1f989 100644 --- a/langchain/agents/initialize.py +++ b/langchain/agents/initialize.py @@ -17,12 +17,12 @@ def initialize_agent( agent_kwargs: Optional[dict] = None, **kwargs: Any, ) -> AgentExecutor: - """Load agent given tools and LLM. + """Load an agent executor given tools and LLM. Args: tools: List of tools this agent has access to. llm: Language model to use as the agent. - agent: The agent to use. Valid options are: + agent: A string that specified the agent type to use. Valid options are: `zero-shot-react-description` `react-docstore` `self-ask-with-search` @@ -32,10 +32,11 @@ def initialize_agent( callback_manager: CallbackManager to use. Global callback manager is used if not provided. Defaults to None. agent_path: Path to serialized agent to use. - **kwargs: Additional key word arguments to pass to the agent. + agent_kwargs: Additional key word arguments to pass to the underlying agent + **kwargs: Additional key word arguments passed to the agent executor Returns: - An agent. + An agent executor """ if agent is None and agent_path is None: agent = "zero-shot-react-description"