Skip to content

How to Configure Gen AI Service in Oracle APEX using Open AI

Manoj Kumar Aug 27, 2024 12:15:00 PM
How to Configure Gen AI Service in Oracle APEX using Open AI
2:08

In this blog post, I will explain how we can configure the Gen AI service of Oracle APEX using the Open AI LLM model.

Introduction: We can bring Gen AI capabilities based on large language models (LLms) to our applications built using Oracle APEX. The Gen AI service can be accessed through REST APIs, and by using the powerful REST Data Source capabilities of APEX, we can incorporate the advanced technology into our applications with a low-code approach.

Pre-Requisites:

  1. Should have an Open AI account and Open AI key.
  2. Access to Apex 24.1 workspace.

STEP 1: Create Web Credentials in Oracle APEX

  1. Log into APEX workspace and from the APEX home page, click App Builder. Apex

  2. Now Click on Workspace Utilities. Apex

  3. Now click on Web Credentials. Apex

  4. Click Create. Apex

  5. Fill in the below attributes and click Create.
    Name = Open AI
    Static ID = Open AI
    Authentication Type = HTTP Header
    Credentials Name = Authorization
    Credential Secret = Bearer <Your Open AI API Key> (note that there is space between Bearer and api key)
    Valid for URL = https://api.openai.com /v1

    Apex

  6. It will create the Web credentials. Apex

STEP 2: Now we have Web Credential we are ready to configure Gen AI service in APEX.

  1. Again go to Application Builder and click on Workspace Utilities and this time click on Gen AI Services. Apex

  2. Click Create and provide the information.
    AI Provider = Open AI ( as I am using Open AI, if you using other provider, select accordingly)
    Name = ES Open AI Service (The name will be shown in the Generative AI Services overview page.)
    Static ID = ES_OpenAI (The static ID is used when using the service with the APEX_AI package (APEX_AI.CHAT).)
    Enable used by App builder

    Make sure in the credential section web credentials are selected that we created in Step 1. Apex

  3. It will show like below. Apex

STEP 3: Now We click on SQL Workshop –> SQL Commands and see that we have the APEX Wizard button enabled now.

Apex

Click on APEX Assistant and accept, it will open APEX Wizard.

Apex

So we successfully configure Gen AI service with Apex.

In the next blog, I will show you how to use this Apex assistant.

Leave a Comment