Class Initialize

java.lang.Object
com.hw.langchain.agents.initialize.Initialize

public class Initialize extends Object
Load agent.
Author:
HamaWhite
  • 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 agent
      kwargs - Additional key word arguments passed to the agent executor
      Returns:
      An agent executor