Skip to content

6. Use OCI GenAI

Frédéric Descamps edited this page Sep 24, 2025 · 3 revisions

You can use OCI GenAI Service (some are also always Free) directly in your code.

We provide SDKs and sample code for several programming languages, including Java and Python.

From the OCI Console, we go to the GenAI section:

oci_genai_01

Depending on your region, you have access to different models:

oci_genai_02

We provide examples, or you can leave it blank:

oci_genai_03

Finally, you can copy the code for the programming language you prefer:

oci_genai_04

The example uses the ~/.oci/config file with your settings (same as we did in MySQL Shell Studio Code, but this time on our compute instance):

Screenshot From 2025-09-24 15-48-34

We copied the code for Python, and we modified it just a little bit to add our input question:

Screenshot From 2025-09-24 15-50-17

Then we run the demo:

$ python demo.py
Screenshot From 2025-09-24 15-53-10

Let's see all this in action in the video below:

06_OCI_GenAI_V2.mp4

Clone this wiki locally