Loading
Visual Studio Code Based Modeler for Consumer Goods Cloud
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          executePromptTemplateAsync()

          executePromptTemplateAsync()

          Sends a REST request to the Einstein Prompt Template service to generate prompt text asynchronously using a specific prompt template.

          Required Editions

          Available in: Enterprise and Unlimited Editions where Consumer Goods Cloud is enabled

          Parameters

          payload: A single object containing all parameters for the prompt generation. This object must include:

          • promptBuilderID: The string ID of the prompt template to use.
          • inputParams: An array of objects. See Einstein Prompt Template Generations for details.
          • additionalConfig : Optional. If necessary, specify the maximum number of tokens to generate using maxToken. Other parameters such as isPreview, numGenerations, and outputLanguage aren’t supported. See Einstein LLM Additional Configuration Input.

          Returns

          This function returns a Promise.

          • On Resolution (string): If the call is successful, the Promise resolves with a prompt text.
          • On Rejection (Error): If the call fails, the Promise is rejected with an error. For example, the device is offline, Agentforce is unavailable, or parameters are invalid.
          Example
          Example
          const payload = {
              promptBuilderID: "einstein_gpt_summarizeAccountDefault",
              inputParams: [
              {
              name: "Account",
              value: {
              name: "id",
              value: "801Ws00003AZgY1IAL"
              }
              }
              ],
              additionalConfig: {
              maxTokens: 1024
              }
              };
           
          Loading
          Salesforce Help | Article