Member Junction
    Preparing search index...

    Manager class for system placeholders. Provides methods to get, add, remove, and resolve placeholders.

    SystemPlaceholderManager

    Index

    Constructors

    Properties

    placeholders: SystemPlaceholder[] = ...

    Array of system placeholders. Protected to allow extension by subclasses.

    Methods

    • Adds a new system placeholder.

      Parameters

      Returns void

      If a placeholder with the same name already exists

      SystemPlaceholderManager.addPlaceholder({
      name: '_ORGANIZATION_NAME',
      description: 'Current organization name',
      getValue: async (params) => {
      // Custom logic to get organization name
      return 'My Organization';
      }
      });
    • Gets the current array of system placeholders. Returns a reference to the array, allowing direct manipulation.

      Returns SystemPlaceholder[]

      The array of system placeholders

      const placeholders = SystemPlaceholderManager.getPlaceholders();
      placeholders.push({
      name: '_CUSTOM_VALUE',
      description: 'My custom value',
      getValue: async (params) => 'custom result'
      });
    • Replaces bare {{ _NAME }} tokens in messages that never pass through the template engine, such as scoped prompt parts. This is substitution, not rendering: filters, tags, {{{ }}} and every other character stay as written. A token also stays as written when its placeholder declares no requires, needs something params does not carry, needs execution, fails, or returns no value, so the model sees the token rather than an empty value. Only string content is read. Each placeholder resolves once per call, so every message sees the same clock.

      Parameters

      • messages: ChatMessage[]

        The messages to resolve. Not modified.

      • params: Partial<AIPromptParams>

        What is known before the prompt runs, typically contextUser

      Returns Promise<ChatMessage[]>

      The messages with resolved tokens replaced, in the same order