langchain.agents.initialize
.initialize_agentΒΆ
- langchain.agents.initialize.initialize_agent(tools: Sequence[BaseTool], llm: BaseLanguageModel, agent: Optional[AgentType] = None, callback_manager: Optional[BaseCallbackManager] = None, agent_path: Optional[str] = None, agent_kwargs: Optional[dict] = None, *, tags: Optional[Sequence[str]] = None, **kwargs: Any) AgentExecutor [source]ΒΆ
Load an agent executor given tools and LLM.
- Parameters
tools β List of tools this agent has access to.
llm β Language model to use as the agent.
agent β Agent type to use. If None and agent_path is also None, will default to AgentType.ZERO_SHOT_REACT_DESCRIPTION.
callback_manager β CallbackManager to use. Global callback manager is used if not provided. Defaults to None.
agent_path β Path to serialized agent to use.
agent_kwargs β Additional keyword arguments to pass to the underlying agent
tags β Tags to apply to the traced runs.
**kwargs β Additional keyword arguments passed to the agent executor
- Returns
An agent executor