Skip to content

Commit

Permalink
WMS ID 11694: updated changes and screenshots (#138)
Browse files Browse the repository at this point in the history
* updated changes and screenshots

* updated instructions
ramumg authored Aug 21, 2024
1 parent 7f732e4 commit 27e76a8
Showing 9 changed files with 47 additions and 38 deletions.
64 changes: 34 additions & 30 deletions adb-graph/graph-ml-23ai/genai-setup/genai-setup.md
Original file line number Diff line number Diff line change
@@ -71,10 +71,9 @@ Learn how to
<tenancy> can be found in the text file as 'tenancy'
<private_key> can be found as the contents .pem file that does not have the '_public' extension.
<fingerprint> can be found in the text file as 'fingerprint'
```
Copy and paste the following code, and make the necessary changes:
Copy and paste the following code, and make the necessary changes.
```
<copy>
@@ -90,7 +89,7 @@ Learn how to
/</copy>
```
Here is an example of how it should look:
Here is **an example** of how it should look. Then run the the script using the **Run Statement** button to create the DBMS Cloud Credential.
```
BEGIN
@@ -104,38 +103,43 @@ Learn how to
/
```
Run the the script using the **Run Statement** button to create the DBMS Cloud Credential.
![Create the DBMS Cloud Credential.](images/dbms-credentials.png " ")
3. Then, create a Gen AI profile using the default llama model. Copy and run this script using the **Run Script** button.
3. Then, create a Gen AI profile using the default llama model. You will need this information:
```
<copy>begin
-- drops the profile if it already exists
DBMS_CLOUD_AI.drop_profile(profile_name => 'genai', force => true);
-- Create an AI profile that uses the default LLAMA model on OCI
dbms_cloud_ai.create_profile(
profile_name => 'genai',
attributes =>
'{"provider": "oci",
"credential_name": "GRAPH_OCW_CREDENTIAL",
"comments":"true",
"object_list": [
{"owner": "MOVIESTREAM", "name": "MOVIE"},
{"owner": "MOVIESTREAM", "name": "CUSTOMER"},
{"owner": "MOVIESTREAM", "name": "WATCHED"},
{"owner": "MOVIESTREAM", "name": "WATCHED_WITH"}
]
}'
);
end;
/</copy>
<oci_compartment_id> can be found in the text file as 'Compartment_ocid'
```
Copy and paste the following code, and make the necessary changes. Then run this script using the **Run Script** button.
```
![Create a GenAI profile using thte default llama model.](images/genai-profile.png " ")
<copy>begin
-- drops the profile if it already exists
DBMS_CLOUD_AI.drop_profile(profile_name => 'genai', force => true);
-- Create an AI profile that uses the default LLAMA model on OCI
dbms_cloud_ai.create_profile(
profile_name => 'genai',
attributes =>
'{"provider": "oci",
"credential_name": "GRAPH_OCW_CREDENTIAL",
"comments":"true",
"oci_compartment_id": "<compartment_ocid>",
"object_list": [
{"owner": "MOVIESTREAM", "name": "MOVIE"},
{"owner": "MOVIESTREAM", "name": "CUSTOMER"},
{"owner": "MOVIESTREAM", "name": "WATCHED"},
{"owner": "MOVIESTREAM", "name": "WATCHED_WITH"}
]
}'
);
end;
/</copy>
```
![Create a GenAI profile using the default llama model.](images/genai-profile.png " ")
This concludes this lab. **You may now proceed to the next lab.**
Binary file modified adb-graph/graph-ml-23ai/genai-setup/images/dbms-credentials.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified adb-graph/graph-ml-23ai/genai-setup/images/genai-profile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified adb-graph/graph-ml-23ai/query-graph/images/call-genai.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.
Binary file modified adb-graph/graph-ml-23ai/query-graph/images/create-sql-graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified adb-graph/graph-ml-23ai/query-graph/images/genai-answer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified adb-graph/graph-ml-23ai/query-graph/images/watch-party.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 13 additions & 8 deletions adb-graph/graph-ml-23ai/query-graph/query-graph.md
Original file line number Diff line number Diff line change
@@ -23,8 +23,6 @@ In this workshop, we on the development team at Oracle MovieStream, a fictitious

One of our customers, Adriana Osborne, is exploring the watch party feature. She wants to see what 2024 adventure movie she might be interested in watching and which of her friends she could invite to a party. MovieStream includes an option to personalize an email to Adriana's invitees to her watch party.

In this task, we will explore the data that is available in the MovieStream database, and search for movies that were recently released.

>**Note:** Click the **Run Paragraph** button to run the query.
![The environment is loading because it's not ready ](images/run-paragraph.png " ")
*Execute the relevant paragraph after reading the description in each of the steps below*.
@@ -33,6 +31,15 @@ If the compute environment is not ready just yet and the code cannot be executed

1. Users can use the LLM to ask general questions about movies. Let's ask the LLM to give us the top 10 adventure movies released in the past 2 years.

```
<copy>%sql
SELECT DBMS_CLOUD_AI.GENERATE(
prompt => 'what are the top 10 adventure movies',
profile_name => 'genai',
action => 'chat')
FROM dual;</copy>
```
![Submit question to Generative AI.](images/submit-question.png " ")
GenAI Answer:
@@ -52,13 +59,11 @@ If the compute environment is not ready just yet and the code cannot be executed
vector_embedding(doc_model_bert using 'ADVENTURE' as data), COSINE)</copy>
```
Looks like the 'The Fall Guy' has the highest score for ADVENTURE movies in 2024 that we have available for our customers to watch.
Our search result gives 'The Fall Guy' the highest score for 'Adventure' movies in 2024 that we have available for our customers to watch.
![Adventure movies released in 2024](images/db-adventure-movies.png " ")
2. Our search result gives 'The Fall Guy' the highest score for 'Adventure' movies in 2024 that we have available for our customers to watch.
Adriana wants to know which movies it's similar to to help her decide if she'd like to watch it. Let's run another vector search to find out.
3. Adriana wants to know which movies it's similar to to help her decide if she'd like to watch it. Let's run another vector search to find out.
```
<copy>%sql
@@ -107,10 +112,10 @@ Knowing what movies are similar to 'The Fall Guy' is a good start, but it doesn'
SELECT CUST_ID FROM CUSTOMER WHERE FIRST_NAME ='Adriana'AND LAST_NAME = 'Osborne';</copy>
```
![Identify Adriana Osborne's CUST_ID](images/cust-id.png " ")
Now that we know Adriana's CUST_ID, let's look at some sample queries.
![Identify Adriana Osborne's CUST_ID](images/cust-id.png " ")
3. This query returns all the movies Adriana has watched.
```

0 comments on commit 27e76a8

Please sign in to comment.