Class that represents an agent that uses XML tags.

Use the method instead.

Hierarchy (view full)

Implements

Constructors

Properties

ToolType: StructuredToolInterface<ZodObjectAny>
llmChain: LLMChain<string, LLMType>
outputParser: XMLAgentOutputParser = ...
tools: ToolInterface<ZodObjectAny>[]

Accessors

  • get allowedTools(): undefined | string[]
  • Returns undefined | 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.

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

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

    Parameters

    • llm: BaseLanguageModelInterface<any, BaseLanguageModelCallOptions>

      The BaseLanguageModel to use.

    • tools: ToolInterface<ZodObjectAny>[]

      The tools to be used by the agent.

    • Optionalargs: XMLAgentInput & Pick<AgentArgs, "callbacks">

      Optional arguments for creating the agent.

    Returns XMLAgent

    An instance of XMLAgent.