SAP AI SDK for JavaScript - v2.8.0
    Preparing search index...

    Type Alias PromptTemplate

    PromptTemplate: Omit<Template, "template"> & {
        template?: TemplatingChatMessage;
    }

    Representation of the 'Template' schema.

    Type Declaration

    • Optionaltemplate?: TemplatingChatMessage

      A chat message array to be formatted with values from placeholderValues. Both role and content can use {{?variable}} placeholders.

      For dynamic templating (changing per request), pass templated messages directly in .chatCompletion({ messages }).

      // Static template: passed once in client config
      templating: {
      template: [
      {
      role: 'system',
      content: 'You are a helpful assistant for {{?product}}.'
      }
      ]
      }

      Copyright Ⓒ 2026 SAP SE or an SAP affiliate company. All rights reserved.