Class ZeroShotAgent

Agent for the MRKL chain.

Hierarchy

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

  • Construct a scratchpad to let the agent continue its thought process

    Parameters

    Returns Promise<string | BaseMessage[]>

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

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

    Parameters

    • tools: Tool[]

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

    • Optional args: ZeroShotCreatePromptArgs

      Arguments to create the prompt with.

    Returns PromptTemplate<any, any>

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

    Parameters

    • data: Object

    Returns Promise<ZeroShotAgent>

  • Validates the tools for the ZeroShotAgent. Throws an error if any tool does not have a description.

    Parameters

    • tools: Tool[]

      List of tools to validate.

    Returns void

Generated using TypeDoc