Class used to generate prompts for the AutoGPT model. It takes into account the AI's name, role, tools, token counter, and send token limit. The class also handles the formatting of messages and the construction of the full prompt.

Hierarchy (view full)

Implements

Constructors

Properties

aiName: string
aiRole: string
sendTokenLimit: number
tokenCounter: ((text) => Promise<number>)

Type declaration

    • (text): Promise<number>
    • Parameters

      • text: string

      Returns Promise<number>

tools: StructuredTool[]

Methods

  • Constructs the full prompt based on the provided goals.

    Parameters

    • goals: string[]

      An array of goals.

    Returns string

    The full prompt as a string.

  • Formats the messages based on the provided parameters.

    Parameters

    • __namedParameters: {
          goals: string[];
          memory: VectorStoreRetrieverInterface;
          messages: BaseMessage[];
          user_input: string;
      }
      • goals: string[]
      • memory: VectorStoreRetrieverInterface
      • messages: BaseMessage[]
      • user_input: string

    Returns Promise<BaseMessage[]>

    An array of formatted messages.

  • This method is not implemented in the AutoGPTPrompt class and will throw an error if called.

    Parameters

    • _values: PartialValues

      Partial values.

    Returns Promise<BaseChatPromptTemplate>

    Throws an error.

Generated using TypeDoc