17.7.2 Managing Generative AI Services

Create Generative AI Services on the Generative AI Services page in Workspace Utilities.

17.7.2.1 Creating a Generative AI Service Object

Create a Generative AI Service object on the Generative AI Services, Create/Edit page.

Note:

Before creating a Generative AI Service, you need an API key or OCI Credentials from your AI Provider. To learn more, contact your AI Provider.

Each AI Service must have a unique Name and Static ID within the workspace. Developers can select from a list of supported AI Services.

Note:

Enable the Used by App Builder setting to add a Generative AI option in the Create Application Wizard and include Generative AI support (APEX Assistant) in all APEX Code Editors. Only one Generative AI Service at a time can be configured with the Used by App Builder setting enabled.

To create a generative AI Service:

  1. Navigate to the Generative AI Services page:
    1. On the Workspace home page, click the App Builder icon.
    2. On the App Builder home page, click the Workspace Utilities icon.

      Tip:

      You can also access the Generative AI Services page from the menu bar. From the APEX menu bar, select App Builder, Workspace Utilities, and then All Workspace Utilities.

      The Workspace Utilities page appears.

    3. On the Workspace Utilities page, click Generative AI.

      The Generative AI Services page appears.

  2. To create a Generative AI Service object, click Create.

    The Create/Edit page appears.

  3. Under Identification:
    1. Identification, AI Provider - Select the AI Provider to use for this Generative AI Service. Options include:
      • OCI Generative AI Service
      • Open AI
      • Cohere
    2. Identification, Name - The name of the Generative AI Service. The name will display on the Generative AI Services page in Workspace Utilities.
      Example: HCM Open AI Service
    3. Identification, Static ID - The Static ID for the Generative AI Service. The static ID is used when using the service with the APEX_AI package (APEX_AI.CHAT).
      Example: HCM_OPENAI
    The UI changes depending upon the AI Provider you select. The steps that follow describe properties for the Open AI, OCI Generative AI Service, and Cohere.
  4. If AI Provider is OCI Generative AI Service:
    1. OCI Generative AI, Compartment ID - The Oracle Cloud Infrastructure Compartment ID.
    2. OCI Generative AI, Region - The Oracle Cloud Infrastructure Region.

      Default Region: us-chicago-1

    3. OCI Generative AI, Model ID - The OCI Generative AI Model ID. The default Model ID is cohere.command-r-16k.

      To learn more about OCI Generative AI chat models, see OCI Generative AI chat models in Oracle Cloud Infrastructure Documentation

    4. Settings, Used by App Builder - Indicates whether this Generative AI Service is used by App Builder.
    5. Settings, Base URL - The base URL of the Generative AI Service. The base URL is typically the REST API endpoint for the specified Generative AI Provider. Make sure the URL in the selected Web Credential is reflected in the base URL of the Generative AI Service.

      For advanced use cases, you can specify Query Parameters as part of the Base URL by appending the following to the Base URL:

      ?param1=value1&param2=value2&param3=value3 ...

      Where param<X> is the name of the query parameter and value<X> the value of parameter param<X>.

    6. Credentials, Credential - Select the Web Credential to use for this Generative AI Service. Customers must sign-up for or use existing credentials of their respective AI provider.
    7. Credentials, OCI User ID - Enter the Oracle Cloud Infrastructure User OCID. Oracle APEX does not store this information encrypted.
    8. Credentials, OCI Private Key - Enter the private key in PEM format for OCI authentication. Oracle APEX stores this information as encrypted and secure, so it cannot be retrieved back in clear text.
    9. Credentials, OCI Tenancy ID - Enter the Oracle Cloud Infrastructure Tenancy's OCID.
    10. Credentials, OCI Public Key Fingerprint - Enter the public RSA key fingerprint for OCI authentication.

      Tip:

      To learn more, see Required Keys and OCIDs in Oracle Cloud Infrastructure Documentation.
    11. Advanced, Additional Attributes - Click Additional Attributes to include additional attributes that will be added to the JSON request payload as part of performing a Generative AI Service operation.
    12. Advanced, HTTP Headers - Additional HTTP headers used in the Generative AI Service (REST) request. HTTP headers are specified in the following format:

      name_1=value_1

      name_2=value_2

    13. Advanced, Comments - Enter any developer comments or notes.
  5. If AI Provider is Open AI:
    1. Settings, Used by App Builder - Indicates whether this Generative AI Service is used by App Builder.
    2. Settings, Base URL - The base URL of the Generative AI Service. For normal use, accept the default. The base URL is typically the REST API endpoint for the specified Generative AI Provider. Make sure the URL in the selected Web Credential is reflected in the base URL of the Generative AI Service.

      For advanced use cases, you can specify Query Parameters as part of the Base URL by appending the following to the Base URL:

      ?param1=value1&param2=value2&param3=value3 ...

      Where param<X> is the name of the query parameter and value<X> the value of parameter param<X>.

    3. Credentials, Credential - Select the Web Credential to use for this Generative AI Service. Customers must sign-up for or use existing credentials of their respective AI provider.
      The Web Credential can be created as part of creating the Generative AI service. Once created, the Web Credential will also appear on the Web Credentials page in Workspace Utilities.
    4. Credentials, API Key - If you are creating a new credential, enter the API key.
      The API key is generated from you Open AI account. For more information, see your Open AI documentation.
    5. Advanced, Additional Attributes - Click Additional Attributes to include additional attributes that will be added to the JSON request payload as part of performing a Generative AI Service operation.
      For more information, see the REST API documentation of the selected AI provider.
    6. Advanced, AI Model - Enter an AI Model. For Open AI, the default model is gpt-3.5-turbo.
    7. Advanced, HTTP Headers - Additional HTTP headers used in the Generative AI Service (REST) request. HTTP headers are specified in the following format:

      name_1=value_1

      name_2=value_2

    8. Advanced, Comments - Enter any developer comments or notes.
  6. If AI Provider is Cohere:
    1. Settings, Used by App Builder - Indicates whether this Generative AI Service is used by App Builder.
    2. Settings, Base URL - The base URL of the Generative AI Service. The base URL is typically the REST API endpoint for the specified Generative AI Provider. Make sure the URL in the selected Web Credential is reflected in the base URL of the Generative AI Service.

      For advanced use cases, you can specify Query Parameters as part of the Base URL by appending the following to the Base URL:

      ?param1=value1&param2=value2&param3=value3 ...

      Where param<X> is the name of the query parameter and value<X> the value of parameter param<X>.

    3. Credentials, Credential - Select the Web Credential to use for this Generative AI Service. Customers must sign-up for or use existing credentials of their respective AI provider.
    4. Credentials, API Key - If you are creating a new credential, enter the API key.
      The API key is generated from you Cohere account. For more information, see your Cohere documentation.
    5. Credentials, Credential - Select the Web Credential to use for this Generative AI Service. Customers must sign-up for or use existing credentials of their respective AI provider.
      The Web Credential can be created as part of creating the Generative AI service. Once created, the Web Credential will also appear on the Web Credentials page in Workspace Utilities.
    6. Advanced, Additional Attributes - Click Additional Attributes to include additional attributes that will be added to the JSON request payload as part of performing a Generative AI Service operation.
    7. Advanced, AI Model - An optional model name or ID for the Generative AI Service. If no model information is given, the default model of the respective AI provider is used.
    8. Advanced, HTTP Headers - Additional HTTP headers used in the Generative AI Service (REST) request. HTTP headers are specified in the following format:

      name_1=value_1

      name_2=value_2

    9. Advanced, Comments - Enter any developer comments or notes.
  7. Click Apply Changes.

17.7.2.2 Editing or Deleting a Generative AI Service

Edit or delete a Generative AI Service on the Generative AI Services, Create/Edit page.

To edit or delete a Generative AI Service:

  1. Navigate to the Generative AI Services page:
    1. On the Workspace home page, click the App Builder icon.
    2. On the App Builder home page, click the Workspace Utilities icon.
    3. On the Workspace Utilities page, click Generative AI.
      The Generative AI Services page appears.
  2. To edit a Generative AI Service:
    1. Click the AI Service Name.

      Edit the attributes.

    2. Identification, AI Provider - Determines the AI Provider to use for this Generative AI Service. Options include:
      • OCI Generative AI Service
      • Open AI
      • Cohere
    3. Identification, Name - The name of the Generative AI Service. The name displays on the Generative AI Services page in Workspace Utilities.
      Example: HCM Open AI Service
    4. Identification, Static ID - The Static ID for the Generative AI Service. The static ID is used when using the service with the APEX_AI package (APEX_AI.CHAT).

      Example: HCM_OPENAI.

      The UI that displays next changes depending upon the selected AI Provider.
    5. Edit the appropriate attributes and click Apply Changes.

      To learn more about a specific attribute, see item Help.

  3. To delete a Generative AI Service:

    Tip:

    If a Generative AI Service is in use, you cannot delete it.
    1. Click the AI Service Name.
    2. Click Delete.
    3. Confirm your selection and click Delete again.

    Note:

    Creating a Generative AI Service creates a Web Credential. When you delete a Generative AI Service, you must manually delete the associated Web Credential. See Editing or Deleting Credentials.

17.7.2.3 Viewing Generative AI Service Utilization

View a report that details where Generative AI Service objects are used within the current workspace.

To view the Generative AI Services Utilization report:

  1. Navigate to the Generative AI Services page:
    1. On the Workspace home page, click the App Builder icon.
    2. On the App Builder home page, click the Workspace Utilities icon.
    3. On the Workspace Utilities page, click Generative AI.
      The Generative AI Services page appears.
  2. On the Generative AI Services page, click Utilization.

    The Generative AI Services Utilization report appears.

17.7.2.4 Viewing Generative AI Service History

View a report of recent modifications made to Generative AI Services in this workspace.

To view the Generative AI Services History report:

  1. Navigate to the Generative AI Services page:
    1. On the Workspace home page, click the App Builder icon.
    2. On the App Builder home page, click the Workspace Utilities icon.
    3. On the Workspace Utilities page, click Generative AI.
      The Generative AI Services page appears.
  2. On the Generative AI Services page, click History.

    The Generative AI Services History report appears.