Skip to content

Commit

Permalink
wms: 11628: Changes in steps and implementation to use OCI Gen AI ser…
Browse files Browse the repository at this point in the history
…vice (#172)

* ocw manifest files

* Added Movies-Lab workshop files

* ocw manifest files

* 22.1 updates to Spreadsheet Lab

* 22.1 updates

* Update 1-sign-up-apex.md

* Updated absolute urls

* updated the common urls

* updated the urls

* Added a NOTE to indicate version difference

* updated path for Lab 4

* Updated the paths

* Updated the Workshop Title

* Update screenshot in Task 2 Step 7

* Added alt text to images

* URLS updated in index.html

* Updated the steps for Option 2: Sign up for APEX using ADB

* alt text for images

* Shopping App 22.1 updates

* 22.1 updates

* archiving Shopping Cart 21.2

* Updated manifest files for OCW

* Feedback updated for 22.1

* Updated the PL/SQL code for checkout

* Update process-properties.png

* Feedback update 22.1

* Hid the old walkthrough videos

* Alt text for all images

* Delete clothing-images.zip

* Updated steps for Livelabs Green Button

* Changes to steps for Livelabs Green button

* Fixed the comments wrt PR

* Updated screenshots in Common

* OCW updates to optional labs

* Updated filename in manifest for optional lab

* OCI console Redwood theme screenshots

Replacement of screenshots as per the new Redwood theme for OCI console

* Resolved issue in APEX 22.2 for Task 5

Added an additional step to set the source for Region in Task 5.

* Update manifest.json

Lab 4 was pointing to an invalid lab. I have updated it to the correct folder path.

* First Draft for New Workshop

All the files related to the Social Media Workshop

* Issue fix

* Issue fixes

* Issue Fix

* issue-fix

* removed lab 10

* screenshot fix

* Replaced Screenshots

* Updated screenshots

* Replaced Screenshots

* Updated Screenshots

* Create menu-button.png

* Issue fixes and time saver step

* Lab 10 steps added

* Fixed issues

* Renamed Lab titles

* Added Task 3 and 4 in Lab 8

* Updated screenshots

* uploaded the catch up app

* Update 0-introduction.md

* Completed app zip files

* Added download links from Object Storage

* ocw23 folders

* 23.1 changes

* updated acknowledgements

* Archive of 22.1

* Updated Movies and common

* Updated APEX version in Intro

* Feedback fixes

* Grammar edits

* Sign up for APEX using Quickstart

* Updated Lab 10

Added missing steps to get device location

* Added the support lab

Added CloudWorld support labs for Movies Watchlist and Social Media Workshop

* Updated Getting Started Common Lab

Changed the steps to sign up for an APEX Service

* Updated missing steps

* Changed the title of Spreadsheet workshop

* Embedded walkthrough videos

Social Media Workshop

* Grammar edits

* Updated Need Help for OCW

* Update 4-Update-table.md

* Rename 4-Update-table.md to 4-update-table.md

* Delete task-definition.md

* Update 4-update-table.md

* Fixing bugs

* Added video walkthrough files

* Update intro.md

* Update manifest.json

* Updated screenshots in Common

* APEX 23.2 updates to Spreadsheet

Updates to Spreadsheet and Common Lab

* Naming issues fixed

* Update 1-sign-up-apex.md

* Fixed naming, prereq, obj

* Naming issues fixed

* Issue fixes in common lab

* Changes in common and delete unwanted files

* Removed duplicate folders

* Updated all labs to 23.2

* Fixed the Manifest file errors

* Updated steps and text related to a bug

* New Lab added

* Update 5-improve-ux.md

* Update manifest.json

* Update 5-improve-ux.md

* fixed issues for new lab

* Update introduction.md

* Updated to latest files

* renamed the images

* Fixed issues and feedback

* Title and text changes

* Improve text and screenshots

* Improve text

* Fixed bugs

* Fix Grammar and issues

* Updated common lab

* Update 1-sign-up-apex.md

* Update introduction.md

* updated par url

* Update introduction.md

* Update introduction.md

* Update introduction.md

* Grammar changes

* 11628 - New Workshop

* wms: 11628 -Lab 3 and Lab 4

* wms: 11628 - Lab 5

* Create nyc_high_schools.xlsx

* Feedback fixes

* Grammar edits

* issue fixes

* issue fix

* common lab

* Update 0-intro.md

* Update 0-intro.md

* typo fixes

* grammar fixes

* self-qa check

* Grammar fixes to Title

* Update 3-using-genai.md

* Feedback fixes

* Typo Fix

* Issue fixes.

* Bug fixes

* Screenshot fixes

* Screenshot mismatch fixed

* PAR URL update

* Changes in implementation to OCI Gen AI

---------

Co-authored-by: Michelle Malcher <[email protected]>
Co-authored-by: Anoosha Pilli <[email protected]>
Co-authored-by: Hope Fisher <[email protected]>
Co-authored-by: Dan Wiliams <[email protected]>
  • Loading branch information
5 people authored Jul 23, 2024
1 parent 3688169 commit 7eb6589
Show file tree
Hide file tree
Showing 105 changed files with 148 additions and 21 deletions.
11 changes: 6 additions & 5 deletions nyc-genai-lab/0-intro/0-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ Estimated Time: 60 minutes

| Module | Est. Time |
| --- | --- |
| [Creating an APEX application](?lab=1-create-app) | 10 minutes |
| [Creating an APEX application](?lab=1-create-app) | 5 minutes |
| [Visualize Schools on a Map](?lab=2-schools-on-map) | 10 minutes |
| [Build conversation Inquiry using Generative AI](?lab=3-using-genai) | 20 minutes |
| [Generate Email to Apply to a School](?lab=4-apply-to-school) | 15 minutes |
| [Run the Application](?lab=5-run-app) | 5 minutes |
| [Configure the OCI API Keys](?lab=3-configure-oci) | 10 minutes |
| [Build conversation Inquiry using Generative AI](?lab=4-using-genai) | 20 minutes |
| [Generate Email to Apply to a School](?lab=5-apply-to-school) | 15 minutes |
| [Run the Application](?lab=6-run-app) | 5 minutes |

Total estimated time: 60 minutes

Expand All @@ -49,7 +50,7 @@ If you are stuck or the App is not working as expected, you can download and ins
1. [Click here](https://c4u04.objectstorage.us-ashburn-1.oci.customer-oci.com/p/EcTjWk2IuZPZeNnD_fYMcgUhdNDIDA6rt9gaFj_WZMiL7VvxPBNMY60837hu5hga/n/c4u04/b/livelabsfiles/o/labfiles%2Fnyc-gen-ai-app.sql.zip) to download the completed application zip file and unzip it.
2. Import the **nyc-genai-app.sql** file into your workspace. Follow the steps in the Install Application wizard to install the app along with the Supporting Objects.
3. Once the application is installed, navigate to **App Builder > Workspace Utilities > Generative AI**.
4. Edit the **Open AI** service. For Credential, select **Create New** and for API Key, enter your Open AI API key.
4. Edit the **OCI Gen AI** service. Enter the **Compartment ID**. For Credential, select **Create New** and enter the OCI API Key details.
5. All set. Now, run the application and see it in action!


Expand Down
8 changes: 4 additions & 4 deletions nyc-genai-lab/1-create-app/1-create-app.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Create an APEX Application

## Introduction
In this lab, you learn to create an APEX application by importing data from a spreadsheet. APEX can build an app directly from a table created using the spreadsheet. Later, you learn to modify the pages and the theme of the application.
In this lab, you learn to create an APEX application by importing data from a spreadsheet. APEX can build an app directly from a table that is created using a spreadsheet. Later, you learn to modify the pages and the theme of the application.

**Note:** The screenshots in this workshop are taken using Dark Mode in APEX 24.1.

Estimated Time: 10 minutes
Estimated Time: 5 minutes

<!-- Watch the video below for a quick walk-through of the lab.
[Create an APEX App](videohub:1_a6bi2e62) -->
Expand All @@ -15,7 +15,7 @@ Estimated Time: 10 minutes
In this lab, you will:
- Create a new APEX application
- Configure a Cards region
- Customize the app theme using Theme Roller
- Customize the application theme using Theme Roller

### Prerequisites

Expand Down Expand Up @@ -149,6 +149,6 @@ You may now **proceed to the next lab**.
## Acknowledgments

- **Authors** - Toufiq Mohammed, Senior Product Manager; Apoorva Srinivas, Senior Product Manager
- **Last Updated By/Date** - Apoorva Srinivas, Senior Product Manager, June 2024
- **Last Updated By/Date** - Apoorva Srinivas, Senior Product Manager, July 2024


108 changes: 108 additions & 0 deletions nyc-genai-lab/3-configure-oci/3-configure-oci.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Configure the OCI API keys

## Introduction

In this workshop, you use OCI Generative AI as the AI provider to build a conversational chatbot. To use the OCI Generative AI Service in APEX, you need to configure the OCI API keys. In Oracle Cloud Infrastructure (OCI), API keys are used for secure authentication when accessing OCI resources through REST APIs.

OCI API keys consist of two parts: a **Public key** and a **Private key**. You use the OCI console to generate the Private/Public key pair.

Note: The OCI account must have the OCI Generative AI Service enabled.

If you already have an OCI key pair, skip this lab.

Estimated Time: 10 Minutes

### Objectives
In this lab, you:

- Generate API Keys using OCI Console
- Create Web Credentials in Oracle APEX

## Task 1: Generate API Keys using OCI Console

To Generate the API Keys using OCI Console:

1. Login into your OCI Account.

![Add API Key](images/oci-login.png " ")

2. Click **My Profile** at the top-right corner.

![Profile Menu](images/profile.png " ")

3. Under Resources at the bottom-left, select **API Keys** and click **Add API Key**.

![Add API Key](images/api-keys.png " ")

4. The Add API Key dialog is displayed. Select **Generate API Key Pair** to create a new key pair.

5. Click **Download Private Key**. A *.pem* file is saved to your local device. You do not need to download the public key.

*Note: You will use this private key while configuring the web credentials in Oracle APEX in the upcoming lab.*

6. Click **Add**.

![Profile Menu](images/add-api-key.png " ")

7. The key is added, and the Configuration File Preview is displayed. Copy and save the configuration file snippet from the text box into a notepad. You will use this information for creating Oracle APEX Web Credentials.

![Profile Menu](images/configuration-preview.png " ")

## Task 2: Create Web Credentials in Oracle APEX

Web credentials are used to authenticate connection to external REST services, or REST Enabled SQL services from APEX.

Creating Web Credentials securely stores and encrypts authentication credentials for use by Oracle APEX components and APIs. Credentials cannot be retrieved back in clear text. Credentials are stored at the workspace level and therefore are visible to all applications.

To create a Web Credential in Oracle APEX:

1. Login into your Oracle APEX workspace.

![Login into your APEX account](images/apex-login.png " ")

2. On the Workspace home page, click **App Builder**.

![Click App Builder](images/app-builder1.png " ")

3. Click **Workspace Utilities**.

![Click Workspace Utilities](images/workspace-utilities.png " ")

4. Select **Web Credentials**.

![Click Web Credentials](images/sc-web-creds.png " ")

5. Click **Create**.

![Create Web Credentials](images/create-wc.png " ")

6. Enter the following details using the configuration file you copied in the previous task.

- **Name**: apex\_ai\_cred

- **Authentication Type**: OCI Native Authentication

- **OCI User ID**: Enter the OCID of the Oracle Cloud user Account. You can find the OCID in the Configuration File Preview generated during the API Key creation.
Your OCI User ID looks similar to **ocid1.user.oc1..aaaaaaaa\*\*\*\*\*\*wj3v23yla**

- **OCI Private Key**: Open the private key (.pem file) downloaded in the previous task. Copy and paste the API Key.

![Private key file](images/private-key.png " ")

- **OCI Tenancy ID**: Enter the OCID for Tenancy. Your Tenancy ID looks similar to **ocid1.tenancy.oc1..aaaaaaaaf7ush\*\*\*\*cxx3qka**

- **OCI Public Key Fingerprint**: Enter the Fingerprint ID. Your Fingerprint ID looks similar to **a8:8e:c2:8b:fe:\*\*\*\*:ff:4d:40**

![Web Credentials page](images/web-creds.png " ")

5. Click **Create**.

## Summary

You now know how to generate API Keys using OCI console. Furthermore, you know how to create web credentials in Oracle APEX.

You may now **proceed to the next lab**.

## Acknowledgments
- **Author** - Apoorva Srinivas, Senior Product Manager
- **Last Updated By/Date** - Apoorva Srinivas, Senior Product Manager, July 2024
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added nyc-genai-lab/3-configure-oci/images/api-keys.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added nyc-genai-lab/3-configure-oci/images/profile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed nyc-genai-lab/3-using-genai/images/true-action.png
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Build a Conversational Inquiry about Schools using Generative AI

## Introduction
In this lab, you learn to build conversation Inquiry about schools using Generative AI wherein a user can ask questions about a school and the chat widget uses Generative AI to provide context sensitive answers. This lab makes use of the latest feature of APEX 24.1 called the **Open AI Assistant**.
In this lab, you learn to build a conversational inquiry about schools using Generative AI wherein a user can ask questions about a school in chat and the chat widget uses Generative AI to provide context sensitive answers. This lab makes use of the latest feature of APEX 24.1 called the **Open AI Assistant**.

**Note:** The screenshots in this workshop are taken using Dark Mode in APEX 24.1.

Expand All @@ -16,6 +16,7 @@ In this lab, you will:
- Configure a Generative AI service in your workspace
- Build a conversational chatbot using Generative AI


## Task 1: Configure Generative AI Service
To use the Generative AI service in APEX, you need to first configure it at the workspace level.

Expand All @@ -27,20 +28,33 @@ To use the Generative AI service in APEX, you need to first configure it at the

![Workspace Utilities page](images/select-genai.png ' ')

3. Click **Create** to configure a Gen AI service.
3. Click **Create** to configure a Generative AI Service.

![Gen AI services page](images/create-genai.png ' ')

4. In this workshop, you use Open AI as the AI provider. Enter/select the following:
4. In this workshop, you use OCI Generative AI Service as the AI provider. Enter/select the following:

- AI Provider: **OCI Generative AI Service**
- Name: **OCI Gen AI**
- Compartment ID: *Enter your OCI Compartment ID*. Refer to the [Documentation](https://docs.oracle.com/en-us/iaas/Content/GSG/Tasks/contactingsupport_topic-Locating_Oracle_Cloud_Infrastructure_IDs.htm#:~:text=Finding%20the%20OCID%20of%20a,displayed%20next%20to%20each%20compartment.) to fetch your Compartment ID. If you have only one compartment, then use the OCID from the configuration file you saved in Lab 3.
- Region: **us-chicago-1** (Currently, the OCI Generative AI Service is only available in limited regions)
- Model ID: **cohere.command-r-16k** (You can also select other models as per your choice. Refer to the [documentation](https://docs.oracle.com/en-us/iaas/Content/generative-ai/use-playground-chat.htm#chat))
- Used by App Builder: Enable the toggle button to **ON**. Note that the Base URL is auto generated.
- Credentials: **apex\_ai\_cred**

Click **Create**.

<!--In this workshop, you use Open AI as the AI provider. Enter/select the following:
- AI Provider: **Open AI**
- Name: **Open AI**
- Used by App Builder: Enable the toggle button to **ON**
- API Key: Enter your Open AI API key. To signup for an Open AI key, visit [platform.openai.com](https://platform.openai.com/)
Click **Create**.
Click **Create**. -->


![Gen AI services page](images/open-ai-details.png ' ')
![Gen AI services page](images/oci-gen-ai-details.png ' ')


## Task 2: Create the Chat Page
Expand Down Expand Up @@ -181,7 +195,7 @@ To use the Generative AI service in APEX, you need to first configure it at the
3. Under True action, select **Show**. In the Property Editor, enter/select the following:
- Action: **Open AI Assistant**
- Under Generative AI:
- Service: **Open AI**
- Service: **OCI Gen AI**
- System Prompt:
```
<copy>
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
16 changes: 10 additions & 6 deletions nyc-genai-lab/workshops/tenancy/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,20 @@
"filename": "../../2-schools-on-map/2-schools-on-map.md"
},
{
"title": "Lab 3: Build a Conversational Inquiry using Generative AI",
"filename": "../../3-using-genai/3-using-genai.md"
"title": "Lab 3: Configure the OCI API Keys",
"filename": "../../3-configure-oci/3-configure-oci.md"
},
{
"title": "Lab 4: Generate Email to Apply to a School using Gen AI",
"filename": "../../4-apply-to-school/4-apply-to-school.md"
"title": "Lab 4: Build a Conversational Inquiry using Generative AI",
"filename": "../../4-using-genai/4-using-genai.md"
},
{
"title": "Lab 5: Run the Application",
"filename": "../../5-run-app/5-run-app.md"
"title": "Lab 5: Generate Email to Apply to a School using Gen AI",
"filename": "../../5-apply-to-school/5-apply-to-school.md"
},
{
"title": "Lab 6: Run the Application",
"filename": "../../6-run-app/6-run-app.md"
},
{
"title": "Need Help?",
Expand Down

0 comments on commit 7eb6589

Please sign in to comment.