Class ChatConversationalAgent

Agent for the MRKL chain.

Hierarchy

  • Agent
    • ChatConversationalAgent

Constructors

Properties

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

Accessors

  • get allowedTools(): undefined | string[]
  • Returns undefined | string[]

  • get inputKeys(): string[]
  • Returns string[]

  • get returnValues(): string[]
  • Returns string[]

Methods

  • Constructs the agent scratchpad based on the agent steps. It returns an array of base messages representing the thoughts of the agent.

    Parameters

    • steps: AgentStep[]

      The agent steps to construct the scratchpad from.

    Returns Promise<BaseMessage[]>

    An array of base messages representing the thoughts of the agent.

  • Name of tool to use to terminate the chain.

    Returns string

  • Prefix to append the LLM call with.

    Returns string

  • Prefix to append the observation with.

    Returns string

  • 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.

    • Optional callbackManager: CallbackManager

      Callback manager to use for this call.

    Returns Promise<AgentAction | AgentFinish>

    Action specifying what tool to use.

  • Prepare the agent for output, if needed

    Parameters

    • _returnValues: Record<string, any>
    • _steps: AgentStep[]

    Returns Promise<Record<string, any>>

  • Load an agent from a json-like object describing it.

    Parameters

    • data: Object

    Returns Promise<Agent>

  • Returns the default output parser for the ChatConversationalAgent class. It takes optional fields as arguments to customize the output parser.

    Parameters

    • Optional fields: OutputParserArgs & {
          toolNames: string[];
      }

      Optional fields to customize the output parser.

    Returns AgentActionOutputParser

    The default output parser for the ChatConversationalAgent class.

  • Validate that appropriate tools are passed in

    Parameters

    Returns void

Generated using TypeDoc