initialize_agent(
tools: Sequence[BaseTool],
llm: BaseLanguageModel,
agent: AgentType| Name | Type | Description |
|---|---|---|
tools* | Sequence[BaseTool] | List of tools this agent has access to. |
llm* | BaseLanguageModel | Language model to use as the agent. |
agent | AgentType | None | Default: NoneAgent type to use. If |
callback_manager | BaseCallbackManager | None | Default: None |
agent_path | str | None | Default: None |
agent_kwargs | dict | None | Default: None |
tags | Sequence[str] | None | Default: None |
kwargs | Any | Default: {} |
Load an agent executor given tools and LLM.
This function is no deprecated in favor of
create_agent from the langchain
package, which provides a more flexible agent factory with middleware
support, structured output, and integration with LangGraph.
For migration guidance, see Migrating to langchain v1 and Migrating from AgentExecutor.
CallbackManager to use. Global callback manager is used if not provided.
Path to serialized agent to use. If None and agent is also None,
will default to AgentType.ZERO_SHOT_REACT_DESCRIPTION.
Additional keyword arguments to pass to the underlying agent.
Tags to apply to the traced runs.
Additional keyword arguments passed to the agent executor.