Agent for the MRKL chain.

Use the method instead.

Hierarchy (view full)

  • Agent
    • ChatConversationalAgent

Constructors

Properties

ToolType: ToolInterface<ZodObjectAny | ZodEffects<ZodObjectAny, any, {}> | JsonSchema7Type, unknown>
llmChain: LLMChain<string, LLMType>
outputParser: undefined | AgentActionOutputParser

Accessors

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.

  • Create prompt in the style of the ChatConversationAgent.

    Parameters

    • tools: ToolInterface<ZodObjectAny | ZodEffects<ZodObjectAny, any, {}> | JsonSchema7Type, unknown>[]

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

    • Optionalargs: ChatConversationalCreatePromptArgs

      Arguments to create the prompt with.

    Returns ChatPromptTemplate<any, any>

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

    Parameters

    • data: SerializedZeroShotAgent & {
          llm?: BaseLanguageModelInterface<any, BaseLanguageModelCallOptions>;
          tools?: ToolInterface<(ZodObjectAny | ZodEffects<ZodObjectAny, any, { [x: string]: any; }> | JsonSchema7Type), unknown>[];
      }

    Returns Promise<Agent>