Class AgentAbstract

Class responsible for calling a language model and deciding an action.

Remarks

This is driven by an LLMChain. The prompt in the LLMChain must include a variable called "agent_scratchpad" where the agent can put its intermediary work.

Hierarchy

Constructors

Properties

ToolType: StructuredToolInterface<ZodObject<any, any, any, any, {}>>
llmChain: LLMChain<string, LLMType>
outputParser: undefined | AgentActionOutputParser

Accessors

Methods

  • Create a prompt for this class

    Parameters

    • _tools: StructuredToolInterface<ZodObject<any, any, any, any, {}>>[]

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

    • Optional _fields: Record<string, any>

      Additional fields used to format the prompt.

    Returns BasePromptTemplate<any, BasePromptValueInterface, any>

    A PromptTemplate assembled from the given tools and fields.

  • Validate that appropriate tools are passed in

    Parameters

    • _tools: StructuredToolInterface<ZodObject<any, any, any, any, {}>>[]

    Returns void

Generated using TypeDoc