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]¶
[Deprecated] 加载给定工具和LLM的代理执行器。
- 参数:
tools:代理可以访问的工具列表。 llm:用作代理的语言模型。 agent:要使用的代理类型。如果为None且agent_path也为None,则默认为AgentType.ZERO_SHOT_REACT_DESCRIPTION。 callback_manager:要使用的CallbackManager。如果未提供,则使用全局回调管理器。默认为None。 agent_path:要使用的序列化代理的路径。 agent_kwargs:传递给底层代理的额外关键字参数。 tags:要应用于跟踪运行的标记。 **kwargs:传递给代理执行器的额外关键字参数。
- 返回:
一个代理执行器。
Notes
Deprecated since version 0.1.0: Use Use new agent constructor methods like create_react_agent, create_json_agent, create_structured_chat_agent, etc. instead.
- Parameters
tools (Sequence[BaseTool]) –
llm (BaseLanguageModel) –
agent (Optional[AgentType]) –
callback_manager (Optional[BaseCallbackManager]) –
agent_path (Optional[str]) –
agent_kwargs (Optional[dict]) –
tags (Optional[Sequence[str]]) –
kwargs (Any) –
- Return type
Examples using initialize_agent¶
Artifacts are charts created by matplotlib when `plt.show()` is called
How YahooFinanceNewsTool works? {#how-yahoofinancenewstool-works}
IMPORTANT: If you plan to use this account in the future, make sure to save the
If this is your first time using playwright, you’ll have to install a browser executable.
These are sample parameters for Falcon 40B Instruct Deployed from Amazon SageMaker JumpStart
Using https://huggingface.co/laiyer/deberta-v3-base-prompt-injection
need to use GPT-4 here as GPT-3.5 does not understand, however hard you insist, that