langchain.js
    Preparing search index...

    A class that extends AgentActionOutputParser to provide a custom implementation for parsing the output of a ZeroShotAgent action.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    finishToolName: string
    lc_namespace: string[] = ...

    Methods

    • Returns the format instructions for parsing the output of an agent action in the style of the ZeroShotAgent.

      Returns string

      The format instructions for parsing the output.

    • Parses the text output of an agent action, extracting the tool, tool input, and output.

      Parameters

      • text: string

        The text output of an agent action.

      Returns Promise<
          | {
              log: string;
              returnValues: { output: string };
              tool?: undefined;
              toolInput?: undefined;
          }
          | {
              log: string;
              returnValues?: undefined;
              tool: string;
              toolInput: string;
          },
      >

      An object containing the tool, tool input, and output extracted from the text, along with the original text as a log.