Previous Next JavaScript must be enabled to correctly display this content

## 18.9.4.6 Creating a Page Process to Generate Text with AI

Create a page process to generate a text response from a Generative AI Service.

Note:

Before you can add a page process to generate text with AI, you must complete the steps described in About Including Generative AI in Applications. Failure to create a Generative AI Service or edit the application, AI attributes results in an error.
The following simple example creates a page process that invokes an AI and generates a one-time text response based on user content. Note this example only describes the limited number of attributes. This example assumes you have already created an application and page.

To create a page process:

1. View the page in Page Designer.
   1. On the Workspace home page, click the App Builder icon.
   2. Select an application.
   3. Select a page.

      Page Designer appears.

2. In either the Rendering or Processing tab, locate the node where the process will occur. Right-click and select Create Process.
3. Page Designer indicates what to do next. If there is an error, the Show Messages icon displays in the Page Developer toolbar.
   1. Click the Show Messages icon on the Page Designer toolbar.
      The Messages dialog displays errors that must be addressed.
   2. Select an error to highlight the associated attribute in the Property Editor.
      To learn more about an attribute, select the attribute in the Property Editor and click the Help tab in the central pane.
4. Identification, Name - Enter the name of the process for easy identification by developers.
5. Identification, Type - Select Generate Text with AI.
6. Generative AI, Configuration - Select the appropriate AI configuration.

   Note:

   Before you can add a page process to generate text with AI, you must complete the steps described in About Including Generative AI in Applications. Failure to create a Generative AI Service or edit the application, AI attributes results in an error.
7. Under Input Value:
   1. Type - Select Item.
   2. Item - Select the desired item.
8. Use Response, Item - Select the item the response is returned in.

   Tip:

   If you expect larger content back from the Generative AI service as a response, use the Session State Data type as CLOB.
9. Under Execution :
   1. Execution, Sequence - Specify the sequence for this computation. The sequence determines the order of execution.

      If two components have the same sequence value, then they may be executed in a different order when the application is exported and imported into another environment.

   2. Execution, Point - Select the point at which this process is executed.
   3. Execution, Run Process - Select the frequency that this process executes.
10. Under Success Message:
    - Success Message, Success Message - Enter the success message for this process.

      If the process runs and does not generate an error, then this process success message displays in the notification section of the resulting page displayed. If you are branching to another page using a URL redirect, you may need to check the preserve success message attribute.

      To learn more, select the attribute in the Property Editor and click the Help tab in the central pane.

11. Under Error:
    1. Error, Error Message - Enter the error message for this process.

       This message displays if an unhandled exception is raised. After any error processing stops, a rollback is issued and an error message displays.

    2. Error, Display Location - Select where this process error message displays, when the process fails to complete successfully.

       Option include:

       - Inline in Notification - The process error message displays in the Notification area (defined as part of the page template).
       - On Error Page - Error displays on a separate error page.
12. Click Save.

Parent topic: Including Generative AI in Applications