Agent for the MRKL chain.

Hierarchy (view full)

Constructors

Properties

ToolType: ToolInterface
llmChain: LLMChain<string, any>
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.

  • Decide what to do given some input.

    Parameters

    • steps: AgentStep[]

      Steps the LLM has taken so far, along with observations from each.

    • inputs: ChainValues

      User inputs.

    • OptionalcallbackManager: any

      Callback manager to use for this call.

    Returns Promise<any>

    Action specifying what tool to use.

  • Return response when agent has been stopped due to max iterations

    Parameters

    • earlyStoppingMethod: StoppingMethod
    • steps: AgentStep[]
    • inputs: ChainValues
    • OptionalcallbackManager: any

    Returns Promise<AgentFinish>

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

    Parameters

    • tools: ToolInterface[]

      Array of Tool instances to validate.

    Returns void

    void