Class XMLAgent

Class that represents an agent that uses XML tags.

Hierarchy

Implements

Constructors

Properties

ToolType: StructuredTool<ZodObject<any, any, any, any, {}>>
llmChain: LLMChain<string, LLMType>
outputParser: XMLAgentOutputParser = ...
tools: Tool[]

Accessors

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

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

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

Methods

  • Plans the next action or finish state of the agent based on the provided steps, inputs, and optional callback manager.

    Parameters

    • steps: AgentStep[]

      The steps to consider in planning.

    • inputs: ChainValues

      The inputs to consider in planning.

    • Optional callbackManager: CallbackManager

      Optional CallbackManager to use in planning.

    Returns Promise<AgentAction | AgentFinish>

    A Promise that resolves to an AgentAction or AgentFinish object representing the planned action or finish state.

  • Prepare the agent for output, if needed

    Parameters

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

    Returns Promise<Record<string, any>>

  • Creates an XMLAgent from a BaseLanguageModel and a list of tools.

    Parameters

    Returns XMLAgent

    An instance of XMLAgent.

Generated using TypeDoc