Friday, July 5, 2024

Using Generative AI in Oracle APEX 24.1ai

Carrying on from my previous post on how to install Oracle 23ai FREE and Oracle APEX 24.1ai, this post goes over setting it up in APEX and using some examples.

However, I couldn't get it to work in the VM I created, so instead I set up an APEX instance in Oracle Cloud, and this is how to do it.

Sign up for an account at cloud.oracle.com. Set up 2FA etc.

When logged in, select the 3 bars at the top left and select 'Oracle Database'

  

At the right of the screen, click on Apex Application Development

 

At the next screen, select 'Create APEX service'

 

Give it a name and scroll down

 

Make sure Always Free is toggled. The only option is V19.

 

Scroll down, enter a password and leave the access checked.

 

Scroll down and enter an email address then click on Create APEX service

 

 

It will open a new page and show 'Provisioning' - you'll need to wait a few minutes, then click on 'Apex Instances'. Click on the link.

 

 Click on 'Launch APEX', it will open a new tab.

 

Use the password you set up earlier.

 

Click on Create Workspace, then click on New Schema

 Enter a workspace name, username and password, then click on Create Workspace

 

Log out of Admin and into the new Workspace

 

 

 

This will open up the APEX workspace dashboard, but you need to set up an API key before proceeding.

AI is not implemented in APEX 24.1ai out of the box, it needs to be set up. For this you will need an API from Cohere

So, the first thing to do is create an account in Cohere - it's free.

https://dashboard.cohere.com/welcome/login

Once logged in, go here to generate an API key

https://dashboard.cohere.com/api-keys

Copy it and save it somewhere.

Go back to the APEX page, then to App Builder / Workspace Utilities / All Workspace Utilities


Click on 'Generative AI'


Click on Create

Use the drop-down to select 'Cohere', give it a name and toggle the 'Used by App Builder'



Scroll down to 'Credentials' and enter the API key from Cohere in the 'API Key' field


Click on Create.


Once created, click on App Builder and Create a New App


Click on 'Create App Using Generative AI'


If you don't already have data (and if you follow this post, you won't), it prompts to browse some samples.


I chose the Countries one, so click on install next to that then just click through




Click Exit, then go back and 'Create App Using Generative AI' and click 'Accept' at the prompt




Click on the suggestion


Click on Create Application

Click on Create Application again

Click on Run Application



Login


Well, it's an Application, but not a good one. I think AI has a way to go before it takes our jobs. I'll have a play and do another post with hopefully a better app.

I had another look, and this time I told it to create an application with a home page showing the list of countries and I want to click on the country name and it would show other details and also a population chart. It did a bit better, but not much.


It has more detail, but you can't click on the country name to drill-down. It does have a page with a population chart, but it looks the same as the other one above.

I find it pretty bad that Oracle have released this and it is nowhere near ready for any practical use.

With ChatGPT and other generative AIs, you can build on the input. For example, the scale in the chart goes up to 1 - no good at all. I want to be able to go back to the prompt and say "make the chart scale 100 more than the largest value", but I don't think that's possible here, making it of little use.

I'll continue to experiment to see if it can actually be useful.