APEX and GPT-3

Anton NielsenAnton Nielsen
1 min read

Michska and I built a quick application that uses the OpenAI GPT-3 REST API to show results through an APEX application. It's a quick and easy build. You can play with it here: https://apex.oracle.com/pls/apex/r/anton/ait99-gpt-3/gpt-3

Just put your email as a username, you won't need a password.

TLDR

If you just want to get the application up and running, do the following:

  1. Download the APEX application export file (f_gpt-3.sql) from here: https://github.com/ainielse/rando

  2. Import into your APEX (22.2 or higher) workspace.

  3. Sign up for an OpenAI account here: https://openai.com/api/

  4. Create a new secret key

  5. When you imported the APEX application it created a web credential: Credentials for OpenAI - GP3. You need to enter the SECRET KEY you just created to that credential. The format is
    Bearer blah-bla-bl-blah
    or
    Bearer [Your SECRET KEY]

  6. That's it...Run your application

You're a visual learner

Check out the YouTube video about it: https://www.youtube.com/watch?v=wDmngdO5lDw

Potential Pitfalls

Your database may have restrictions about what networks you can access (Network ACLs). Check out my ACL post:
https://apexdebug.com/query-to-find-users-granted-an-acl-the-natural-question-after-seeing-ora-24247

If you get an error complaining about TLS/SSL certificates, here is a script for getting all of the certs you are likely to need into your wallet:
https://github.com/Dani3lSun/oracle-ca-wallet-creator

2
Subscribe to my newsletter

Read articles from Anton Nielsen directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Anton Nielsen
Anton Nielsen