Implements

Constructors

Properties

_prompts: PromptMap = {}
customizationService: undefined | PromptCustomizationService
settingsService: undefined | AISettingsService
toolInvocationRegistry: undefined | ToolInvocationRegistry
variableService: undefined | AIVariableService

Methods

  • Allows to directly replace placeholders in the prompt. The supported format is 'Hi {{name}}!'. The placeholder is then searched inside the args object and replaced. Function references are also supported via format '~{functionId}'.

    Parameters

    • id: string

      the id of the prompt

    • Optional args: {
          [key: string]: unknown;
      }

      the object with placeholders, mapping the placeholder key to the value

      • [key: string]: unknown

    Returns Promise<undefined | ResolvedPromptTemplate>

  • Retrieve the currently selected variant ID for a given main prompt ID. If a variant is selected for the main prompt, it will be returned. Otherwise, the main prompt ID will be returned.

    Parameters

    • id: string

      the id of the main prompt

    Returns Promise<string>

    the variant ID if one is selected, or the main prompt ID otherwise