Send Dynamic Data to the AI Agent with Prompt Templates

Use prompt templates to define prompts that include variable data. When you run the AI agent, you select the prompt template and specify the JSON payload. The prompt template is combined with the payload and is submitted to the Large Language Model (LLM). Prompt templates use Liquid syntax.

Example:

  • You configure the prompt template as: The rate is {{rateValue}}
  • You specify this JSON payload: {"rateValue":500}
  • The prompt sent to the LLM is: "The rate is 500"

Send Dynamic Data to the AI Agent

  1. In the navigation pane, select Projects.
  2. Select the project that contains your AI agent.
  3. In the left navigation pane, select AI Agents AI Agents icon.
  4. Create the prompt template.
    1. In the Prompt templates box, click Add .

      The Create prompt template panel is displayed.

    2. Configure required fields.
      • Name: Name for your prompt template. Provide a descriptive name so that you know when to use the template. For example, if you had a weather AI agent, you could create a prompt template for cities in diferent countries, like Cities in France.
      • Identifier: Oracle Integration generates this value using the Name value.
      • Description: Provide additional information about the prompt template so anyone can know when to use it.
    3. Click Create.
      The Prompt Template details page is displayed.
    4. In Prompt, specify the prompt that you want to send to the LLM with any variables as placeholders for data, then click Save.

      Use Liquid syntax. For example:

      Get the weather for {{ city }}, France
    5. Click Back Back icon to return to the AI Agents page.
      You can now associate the prompt template with an AI agent.
  5. Associate the prompt template with an AI agent.
    1. Find the AI agent with which you want to associate the prompt template.
    2. Deactivate the AI agent if it's Active.
    3. Select the AI agent.
      The Agent details page is displayed.
    4. In the Prompt Templates section, click +, select the prompt template you just created, then click Add.
    5. Click Save to save your changes to the AI agent.
    6. Click Back Back icon to return to the AI Agents page.
      You can now run the AI agent with the new prompt template.
  6. Run the AI agent and specify the prompt template.
    1. In the Agents box, find the AI agent to run.
    2. Click Actions Actions icon, and select Run.
    3. Click New run to test the agent with the prompt template.
    4. Click in the Prompt field to display a list of prompt templates, choose the prompt template you created.

      The Define payload dialog is displayed.

    5. In Define payload, enter the values for the variables and click Submit.

      Test agent screen with a "New run" selected on the left. In the center, a pop-up window titled "Define payload" displays a JSON editor where the payload object includes a city key set to "Paris". Cancel and Submit buttons appear below the editor. The main interface is dimmed in the background.

      The values you entered are added to the prompt created from the prompt template.


      Test agent screen with "New run" selected on the left. In the center, a prompt input box contains the text “Get the weather for Paris, France.” Next to the prompt are buttons to clear the text, submit the query, or edit the payload.

    6. In Prompt, click Run Run icon.