Class Initialize
java.lang.Object
com.hw.langchain.agents.initialize.Initialize
Load agent.
- Author:
- HamaWhite
-
Method Summary
Modifier and TypeMethodDescriptionstatic AgentExecutor
initializeAgent
(List<BaseTool> tools, BaseLanguageModel llm, AgentType agent) static AgentExecutor
initializeAgent
(List<BaseTool> tools, BaseLanguageModel llm, AgentType agent, String agentPath, Map<String, Object> agentKwargs, Map<String, Object> kwargs) Load an agent executor given tools and LLM.
-
Method Details
-
initializeAgent
public static AgentExecutor initializeAgent(List<BaseTool> tools, BaseLanguageModel llm, AgentType agent) -
initializeAgent
public static AgentExecutor initializeAgent(List<BaseTool> tools, BaseLanguageModel llm, AgentType agent, String agentPath, Map<String, Object> agentKwargs, Map<String, Object> kwargs) 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.agentPath
- Path to serialized agent to use.agentKwargs
- Additional key word arguments to pass to the underlying agentkwargs
- Additional key word arguments passed to the agent executor- Returns:
- An agent executor
-