Agent for the MRKL chain.

Use the method instead.

Hierarchy (view full)

Constructors

Properties

ToolType: ToolInterface<ZodObjectAny>
llmChain: LLMChain<string, LLMType>
outputParser: undefined | AgentActionOutputParser

Accessors

Methods

  • Constructs the agent's scratchpad, which is a string representation of the agent's previous steps.

    Parameters

    • steps: AgentStep[]

      Array of AgentStep instances representing the agent's previous steps.

    Returns Promise<string>

    Promise resolving to a string representing the agent's scratchpad.

  • Create prompt in the style of the zero shot agent.

    Parameters

    • tools: ToolInterface<ZodObjectAny>[]

      List of tools the agent will have access to, used to format the prompt.

    • Optionalargs: ChatCreatePromptArgs

      Arguments to create the prompt with.

    Returns ChatPromptTemplate<any, any>

  • Creates a ChatAgent instance using a language model, tools, and optional arguments.

    Parameters

    • llm: BaseLanguageModelInterface<any, BaseLanguageModelCallOptions>

      BaseLanguageModelInterface instance to use in the agent.

    • tools: ToolInterface<ZodObjectAny>[]

      Array of Tool instances to include in the agent.

    • Optionalargs: ChatCreatePromptArgs & AgentArgs

      Optional arguments to customize the agent and prompt.

    Returns ChatAgent

    ChatAgent instance

  • Validates that all tools have descriptions. Throws an error if a tool without a description is found.

    Parameters

    • tools: ToolInterface<ZodObjectAny>[]

      Array of Tool instances to validate.

    Returns void

    void