-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathSelectAI4Py -0- Prerequisites and Setup.dsnb
More file actions
1 lines (1 loc) · 50.1 KB
/
SelectAI4Py -0- Prerequisites and Setup.dsnb
File metadata and controls
1 lines (1 loc) · 50.1 KB
1
[{"layout":"jupyter","isRunnable":true,"template":null,"templateConfig":null,"isEditable":true,"name":"SelectAI4Py -0- Prerequisites and Setup","description":null,"type":"low","paragraphs":[{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":null,"title":null,"message":[],"enabled":true,"result":{"startTime":1760327449267,"interpreter":"md.low","endTime":1760327449718,"results":[],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":true,"width":0,"hideResult":true,"dynamicFormParams":"{}","row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":null,"message":["%md","# Oracle Select AI for Python: Setting up the environment","","This notebook prepares your Autonomous Database instance to use Oracle Select AI for Python.","","This setup must be completed before using NL2SQL, RAG, Synthetic Data Generation, and other Select AI features.","","#### What is Select AI?","","Select AI enables SQL, PL/SQL, and Python access to Large Language Models (LLMs) and transformers from a range of AI providers from your database. ","It supports SQL query generation from natural language prompts against your database data (NL2SQL), retrieval augmented generation (RAG), and synthetic data generation (SDG), among other features. ","","See this <a href=\"https://www.youtube.com/watch?v=rnsnIYYZzr4\" target=\"_blank\">video<\/a> for an introduction to Select AI.","","#### Setup Overview","","To configure Select AI, both the ADMIN and a non-ADMIN users are required. You will need to specify access credentials to the AI provider(s) you want to use and, for RAG, cloud storage. ","Note that you can also use private endpoints to host your LLMs. ","","**ADMIN Tasks:**","- Grant permissions to OML users","- Configure network access (if needed)","","**Select AI User Tasks:**","- Create cloud authentication credentials","- Create AI profiles","- Create vector indexes as needed in support of RAG","","","> **Note:** This notebook includes examples based on OCI Generative AI Service. However multiple other AI providers are supported. ","Users must have an account with a compatible AI provider API and provide access to Autonomous Database via database credentials.","Consult the <a href=\"https://docs.oracle.com/en-us/iaas/autonomous-database-serverless/doc/sql-generation-ai-autonomous.html\" target=\"_blank\">Select AI documentation<\/a> for details.","","Copyright (c) 2025 Oracle Corporation ","###### <a href=\"https://oss.oracle.com/licenses/upl/\" target=\"_blank\">The Universal Permissive License (UPL), Version 1.0<\/a>","---"],"enabled":true,"result":{"startTime":1760327450070,"interpreter":"md.low","endTime":1760327450440,"results":[{"message":"<h1 id=\"oracle-select-ai-for-python-setting-up-the-environment\">Oracle Select AI for Python: Setting up the environment<\/h1>\n<p>This notebook prepares your Autonomous Database instance to use Oracle Select AI for Python.<\/p>\n<p>This setup must be completed before using NL2SQL, RAG, Synthetic Data Generation, and other Select AI features.<\/p>\n<h4 id=\"what-is-select-ai\">What is Select AI?<\/h4>\n<p>Select AI enables SQL, PL/SQL, and Python access to Large Language Models (LLMs) and transformers from a range of AI providers from your database.\nIt supports SQL query generation from natural language prompts against your database data (NL2SQL), retrieval augmented generation (RAG), and synthetic data generation (SDG), among other features.<\/p>\n<p>See this <a href=\"https://www.youtube.com/watch?v=rnsnIYYZzr4\" target=\"_blank\">video<\/a> for an introduction to Select AI.<\/p>\n<h4 id=\"setup-overview\">Setup Overview<\/h4>\n<p>To configure Select AI, both the ADMIN and a non-ADMIN users are required. You will need to specify access credentials to the AI provider(s) you want to use and, for RAG, cloud storage.\nNote that you can also use private endpoints to host your LLMs.<\/p>\n<p><strong>ADMIN Tasks:<\/strong><\/p>\n<ul>\n<li>Grant permissions to OML users<\/li>\n<li>Configure network access (if needed)<\/li>\n<\/ul>\n<p><strong>Select AI User Tasks:<\/strong><\/p>\n<ul>\n<li>Create cloud authentication credentials<\/li>\n<li>Create AI profiles<\/li>\n<li>Create vector indexes as needed in support of RAG<\/li>\n<\/ul>\n<blockquote>\n<p><strong>Note:<\/strong> This notebook includes examples based on OCI Generative AI Service. However multiple other AI providers are supported.\nUsers must have an account with a compatible AI provider API and provide access to Autonomous Database via database credentials.\nConsult the <a href=\"https://docs.oracle.com/en-us/iaas/autonomous-database-serverless/doc/sql-generation-ai-autonomous.html\" target=\"_blank\">Select AI documentation<\/a> for details.<\/p>\n<\/blockquote>\n<p>Copyright (c) 2025 Oracle Corporation<\/p>\n<h6 id=\"the-universal-permissive-license-upl-version-10\"><a href=\"https://oss.oracle.com/licenses/upl/\" target=\"_blank\">The Universal Permissive License (UPL), Version 1.0<\/a><\/h6>\n<hr />\n","type":"HTML"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":null,"message":["%md","### For more information...","","<a href=\"https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/pysai/index.html\" target=\"_blank\">Select AI for Python documentation<\/a>"],"enabled":true,"result":{"startTime":1760327450806,"interpreter":"md.low","endTime":1760327451144,"results":[{"message":"<h3 id=\"for-more-information\">For more information...<\/h3>\n<p><a href=\"https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/pysai/index.html\" target=\"_blank\">Select AI for Python documentation<\/a><\/p>\n","type":"HTML"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":null,"message":["%md","### ADMIN: Grant 'EXECUTE' on DBMS_CLOUD packages","","The `ADMIN` user must grant execute privileges on `DBMS_CLOUD`, `DBMS_CLOUD_AI`, and `DBMS_CLOUD_PIPELINE` packages to the Select AI user. In SelectAI4Py, use ","`select_ai.enable_provider` to grant these privileges to a single user or list of users. Replace `SELECT_AI_USER` with your username.","","`select_ai.enable_provider` also enables users to invoke the AI (LLM) endpoint by adding them to the Access Control List (ACL).","","**Note:** This privilege is not required for OCI GenAI."],"enabled":true,"result":{"startTime":1760327451722,"interpreter":"md.low","endTime":1760327452062,"results":[{"message":"<h3 id=\"admin-grant-execute-on-dbms_cloud-packages\">ADMIN: Grant 'EXECUTE' on DBMS_CLOUD packages<\/h3>\n<p>The <code>ADMIN<\/code> user must grant execute privileges on <code>DBMS_CLOUD<\/code>, <code>DBMS_CLOUD_AI<\/code>, and <code>DBMS_CLOUD_PIPELINE<\/code> packages to the Select AI user. In SelectAI4Py, use\n<code>select_ai.enable_provider<\/code> to grant these privileges to a single user or list of users. Replace <code>SELECT_AI_USER<\/code> with your username.<\/p>\n<p><code>select_ai.enable_provider<\/code> also enables users to invoke the AI (LLM) endpoint by adding them to the Access Control List (ACL).<\/p>\n<p><strong>Note:<\/strong> This privilege is not required for OCI GenAI.<\/p>\n","type":"HTML"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"raw","title":null,"message":["%python","","import select_ai","","# This grants EXECUTE on DBMS_CLOUD, DBMS_CLOUD_AI, and DBMS_CLOUD_PIPELINE","select_ai.enable_provider(users = [\"SELECT_AI_USER\"])"],"enabled":false,"result":{"startTime":1759775045287,"interpreter":"python.low","endTime":1759775048082,"results":null,"taskStatus":null,"forms":null,"status":null},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":false,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":null,"message":["%md","### Select AI User: Create cloud authentication credential","","The Select AI user must establish authentication credentials to their AI provider. Here, we are using Oracle Cloud Infrastructure (OCI) services. To enable","Select AI to use other AI providers, see <a href=\"https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/select-ai-manage-profiles.html#GUID-0B631791-3627-4C2D-B527-396A55C72021\" target=\"_blank\" rel=\"noopener noreferrer\">the Select AI documentation<\/a>.","","The `select_ai.create_credential()` function securely stores your OCI identity information (user OCID, tenancy OCID, private key, and API key fingerprint). ","","The parameters include:","- `credential_name`: A unique identifier for this set of credentials (\"OCI_CRED2\" in this example)","- `user_ocid`: Your OCI user's unique identifier","- `tenancy_ocid`: Your OCI tenancy's unique identifier ","- `private_key`: Your RSA private key (in PEM format) that authenticates API requests","- `fingerprint`: The fingerprint of the public key uploaded to your OCI user account","","This credential can be referenced in subsequent operations that require OCI authentication, such as when accessing Cloud Object Storage buckets for data loading, ","external tables, or data movement operations. For Select AI, this enables secure access to your data stored in OCI Cloud Storage via a built-in automated pipeline.","","This is a standard pattern for setting up secure API access to Oracle Cloud services from within an Oracle Database. The credentials are stored securely within the ","database and can be managed using various `select_ai` functions.","",">Note: Replace all placeholder values with your specific values."],"enabled":true,"result":{"startTime":1760327452480,"interpreter":"md.low","endTime":1760327452816,"results":[{"message":"<h3 id=\"select-ai-user-create-cloud-authentication-credential\">Select AI User: Create cloud authentication credential<\/h3>\n<p>The Select AI user must establish authentication credentials to their AI provider. Here, we are using Oracle Cloud Infrastructure (OCI) services. To enable\nSelect AI to use other AI providers, see <a href=\"https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/select-ai-manage-profiles.html#GUID-0B631791-3627-4C2D-B527-396A55C72021\" target=\"_blank\" rel=\"noopener noreferrer\">the Select AI documentation<\/a>.<\/p>\n<p>The <code>select_ai.create_credential()<\/code> function securely stores your OCI identity information (user OCID, tenancy OCID, private key, and API key fingerprint).<\/p>\n<p>The parameters include:<\/p>\n<ul>\n<li><code>credential_name<\/code>: A unique identifier for this set of credentials ("OCI_CRED2" in this example)<\/li>\n<li><code>user_ocid<\/code>: Your OCI user's unique identifier<\/li>\n<li><code>tenancy_ocid<\/code>: Your OCI tenancy's unique identifier<\/li>\n<li><code>private_key<\/code>: Your RSA private key (in PEM format) that authenticates API requests<\/li>\n<li><code>fingerprint<\/code>: The fingerprint of the public key uploaded to your OCI user account<\/li>\n<\/ul>\n<p>This credential can be referenced in subsequent operations that require OCI authentication, such as when accessing Cloud Object Storage buckets for data loading,\nexternal tables, or data movement operations. For Select AI, this enables secure access to your data stored in OCI Cloud Storage via a built-in automated pipeline.<\/p>\n<p>This is a standard pattern for setting up secure API access to Oracle Cloud services from within an Oracle Database. The credentials are stored securely within the\ndatabase and can be managed using various <code>select_ai<\/code> functions.<\/p>\n<blockquote>\n<p>Note: Replace all placeholder values with your specific values.<\/p>\n<\/blockquote>\n","type":"HTML"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":null,"title":"Create a cloud authentication credential for OCI GenAI Services - template example","message":["%python","","import select_ai","","credential = {"," \"credential_name\": \"OCI_CRED2\","," \"user_ocid\": \"ocid1.user.oc1...\", # Replace with your user OCID"," \"tenancy_ocid\": \"ocid1.tenancy.oc1...\", # Replace with your tenancy OCID"," \"private_key\": \"MIIEogIBAAK...\", # Replace with your private key"," \"fingerprint\": \"12:34:56:78:9a:bc:...\" # Replace with your fingerprint","}","","# Create the credential, replacing it if it exists","select_ai.create_credential(credential = credential, replace = True)"],"enabled":false,"result":null,"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":null,"row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":null},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"table","title":"Verify the cloud credential is defined","message":["%sql","","SELECT OWNER, CREDENTIAL_NAME, ENABLED ","FROM ALL_CREDENTIALS ","WHERE CREDENTIAL_NAME = 'OCI_CRED2';"],"enabled":true,"result":{"startTime":1760327453191,"interpreter":"sql.low","endTime":1760327455056,"results":[{"message":"OWNER\tCREDENTIAL_NAME\tENABLED\nSELECT_AI_USER\tOCI_CRED2\tTRUE\n","type":"TABLE"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":null,"message":["%md","","### AI Profile Overview","","Users can create different profiles for various Select AI scenarios, such as using different credentials, AI providers, transformers, or configuration parameters.","","Here, we create three profile objects:","","1. **OCI_GENAI_PY_DEMO:** A primary profile for chat, NL2SQL, and SDG","2. **OCI_GENAI_RAG_PY_DEMO:** A profile for RAG ","3. **IN_DB_TRANSFORMER_RAG_DEMO:** A profile for RAG using an in-database transformer for embeddings","","These profile objects allow you to invoke Select AI operations using their specific configurations. You'll need to create a proxy object to leverage these profiles in the chat, NL2SQL, SDG, and RAG notebooks, as those will be separate database sessions.","","> Note: The annotations feature referenced in each profile requires Autonomous Database 23ai. Select AI RAG also requires 23ai."],"enabled":true,"result":{"startTime":1760327455425,"interpreter":"md.low","endTime":1760327455774,"results":[{"message":"<h3 id=\"ai-profile-overview\">AI Profile Overview<\/h3>\n<p>Users can create different profiles for various Select AI scenarios, such as using different credentials, AI providers, transformers, or configuration parameters.<\/p>\n<p>Here, we create three profile objects:<\/p>\n<ol>\n<li><strong>OCI_GENAI_PY_DEMO:<\/strong> A primary profile for chat, NL2SQL, and SDG<\/li>\n<li><strong>OCI_GENAI_RAG_PY_DEMO:<\/strong> A profile for RAG<\/li>\n<li><strong>IN_DB_TRANSFORMER_RAG_DEMO:<\/strong> A profile for RAG using an in-database transformer for embeddings<\/li>\n<\/ol>\n<p>These profile objects allow you to invoke Select AI operations using their specific configurations. You'll need to create a proxy object to leverage these profiles in the chat, NL2SQL, SDG, and RAG notebooks, as those will be separate database sessions.<\/p>\n<blockquote>\n<p>Note: The annotations feature referenced in each profile requires Autonomous Database 23ai. Select AI RAG also requires 23ai.<\/p>\n<\/blockquote>\n","type":"HTML"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":null,"message":["%md","### Create an AI profile for chat, NL2SQL, and SDG","","We'll create an AI profile named `OCI_GENAI_PY_DEMO` to support chat interactions, querying the database using natural language, and generating synthetic data.","","This profile uses OCI Generative AI Service as the AI provider and the `meta.llama-3.1-70b-instruct` LLM.","","In this profile, we enable Select AI features including conversation support, comments, constraints, and annotations.","","The object_list in the profile can be specified to determine which database tables the AI features can access. It highlights the owner field (e.g., SH) to specify","the schema. You can optionally list individual tables, as shown here with `CUSTOMERS`, `SALES`, `PRODUCTS`, and `COUNTRIES`.","","With this profile, you'll be able to:","","* Run natural language queries like 'Show me the top 3 baby boomer big spending customers' and have it generate the corresponding SQL query (NL2SQL)","* Engage in interactive chat conversations with the LLM (Chat)","* Generate realistic synthetic data based on your existing table structures and data patterns (SDG)","","> Note, Select AI also enables automated selection of schema metadata for augmented NL2SQL prompts, supporting schemas with a large number of tables and views, ","simplifying AI profile specification, and can reduce the metadata volume sent to the LLM. Specify `\"object_list_mode\": \"automated\"` in the `DBMS_CLOUD_AI.CREATE_PROFILE` attributes list to enable this feature. See <a href=\"https://docs.oracle.com/en-us/iaas/autonomous-database-serverless/doc/select-ai-examples.html#GUID-F9C4BEFB-1570-430F-AB36-347F1A4B8A71\" target=\"_blank\" rel=\"noopener noreferrer\">\"Automatically Detect Relevant Table Metadata\" in Example: Improve SQL Query Generation for details<\/a>."],"enabled":true,"result":{"startTime":1760327456133,"interpreter":"md.low","endTime":1760327456455,"results":[{"message":"<h3 id=\"create-an-ai-profile-for-chat-nl2sql-and-sdg\">Create an AI profile for chat, NL2SQL, and SDG<\/h3>\n<p>We'll create an AI profile named <code>OCI_GENAI_PY_DEMO<\/code> to support chat interactions, querying the database using natural language, and generating synthetic data.<\/p>\n<p>This profile uses OCI Generative AI Service as the AI provider and the <code>meta.llama-3.1-70b-instruct<\/code> LLM.<\/p>\n<p>In this profile, we enable Select AI features including conversation support, comments, constraints, and annotations.<\/p>\n<p>The object_list in the profile can be specified to determine which database tables the AI features can access. It highlights the owner field (e.g., SH) to specify\nthe schema. You can optionally list individual tables, as shown here with <code>CUSTOMERS<\/code>, <code>SALES<\/code>, <code>PRODUCTS<\/code>, and <code>COUNTRIES<\/code>.<\/p>\n<p>With this profile, you'll be able to:<\/p>\n<ul>\n<li>Run natural language queries like 'Show me the top 3 baby boomer big spending customers' and have it generate the corresponding SQL query (NL2SQL)<\/li>\n<li>Engage in interactive chat conversations with the LLM (Chat)<\/li>\n<li>Generate realistic synthetic data based on your existing table structures and data patterns (SDG)<\/li>\n<\/ul>\n<blockquote>\n<p>Note, Select AI also enables automated selection of schema metadata for augmented NL2SQL prompts, supporting schemas with a large number of tables and views,\nsimplifying AI profile specification, and can reduce the metadata volume sent to the LLM. Specify <code>"object_list_mode": "automated"<\/code> in the <code>DBMS_CLOUD_AI.CREATE_PROFILE<\/code> attributes list to enable this feature. See <a href=\"https://docs.oracle.com/en-us/iaas/autonomous-database-serverless/doc/select-ai-examples.html#GUID-F9C4BEFB-1570-430F-AB36-347F1A4B8A71\" target=\"_blank\" rel=\"noopener noreferrer\">"Automatically Detect Relevant Table Metadata" in Example: Improve SQL Query Generation for details<\/a>.<\/p>\n<\/blockquote>\n","type":"HTML"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"raw","title":"Select AI user: OCI_GENAI_PY_DEMO profile definition","message":["%python","","# OCI GenAI uses the default model if \"model\" is not set in attributes ","","import select_ai","","provider = select_ai.OCIGenAIProvider()","","profile_attributes = select_ai.ProfileAttributes("," provider = provider,"," credential_name = \"OCI_CRED2\","," conversation = True,"," comments = True,"," constraints = True,"," annotations = True,"," object_list =["," {\"owner\": \"SH\", \"name\": \"CUSTOMERS\"},"," {\"owner\": \"SH\", \"name\": \"SALES\"},"," {\"owner\": \"SH\", \"name\": \"PRODUCTS\"},"," {\"owner\": \"SH\", \"name\": \"COUNTRIES\"}"," ])","","profile = select_ai.Profile("," profile_name = \"OCI_GENAI_PY_DEMO \","," attributes = profile_attributes,"," description = \"Profile for chat, NL2SQL, and SDG\","," replace = True)","","print(profile.profile_name + \" profile has been successfully created\")"],"enabled":true,"result":{"startTime":1760327456816,"interpreter":"python.low","endTime":1760327460181,"results":[{"message":"OCI_GENAI_PY_DEMO profile has been successfully created\n","type":"TEXT"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":null,"message":["%md","### Create an AI profile for RAG","","We'll create an AI profile named `OCI_GENAI_RAG_PY_DEMO` that also uses OCI Generative AI Service as the provider and the same LLM. ","But we also can specify the embedding model (or transformer) we want to use for generating vectors. ","","Additionally, we'll specify a vector index named `MY_VECTOR_INDEX2` to enable RAG. This profile will be used in the corresponding RAG notebook. ","",">Note, we haven't created `MY_VECTOR_INDEX2` yet. That will be done in the notebook that covers RAG. ","","In this profile, we enable conversations and set it as the current profile after creation. ","","The RAG profile will allow you to ask questions about customer documentation in your vector store, such as 'What are our service level agreements for high-value customers ","in the Asia Pacific region?' and receive answers enhanced with information derived from your object storage documents."],"enabled":true,"result":{"startTime":1760327460554,"interpreter":"md.low","endTime":1760327460886,"results":[{"message":"<h3 id=\"create-an-ai-profile-for-rag\">Create an AI profile for RAG<\/h3>\n<p>We'll create an AI profile named <code>OCI_GENAI_RAG_PY_DEMO<\/code> that also uses OCI Generative AI Service as the provider and the same LLM.\nBut we also can specify the embedding model (or transformer) we want to use for generating vectors.<\/p>\n<p>Additionally, we'll specify a vector index named <code>MY_VECTOR_INDEX2<\/code> to enable RAG. This profile will be used in the corresponding RAG notebook.<\/p>\n<blockquote>\n<p>Note, we haven't created <code>MY_VECTOR_INDEX2<\/code> yet. That will be done in the notebook that covers RAG.<\/p>\n<\/blockquote>\n<p>In this profile, we enable conversations and set it as the current profile after creation.<\/p>\n<p>The RAG profile will allow you to ask questions about customer documentation in your vector store, such as 'What are our service level agreements for high-value customers\nin the Asia Pacific region?' and receive answers enhanced with information derived from your object storage documents.<\/p>\n","type":"HTML"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"raw","title":"Select AI user: OCI_GENAI_RAG_PY_DEMO profile definition","message":["%python","","provider = select_ai.OCIGenAIProvider("," model = \"meta.llama-4-maverick-17b-128e-instruct-fp8\","," embedding_model = \"cohere.embed-english-v3.0\")","","profile_attributes = select_ai.ProfileAttributes("," provider = provider,"," credential_name = \"OCI_CRED2\","," vector_index_name = \"MY_VECTOR_INDEX2\","," enable_source_offsets = True,"," conversation = True)","","profile = select_ai.Profile("," profile_name = \"OCI_GENAI_RAG_PY_DEMO\","," attributes = profile_attributes,"," description = \"Supports RAG with semantic search to augment prompts using a vector store\","," replace = True)","","print(profile.profile_name + \" profile has been successfully created\")"],"enabled":true,"result":{"startTime":1760327461267,"interpreter":"python.low","endTime":1760327462524,"results":[{"message":"OCI_GENAI_RAG_PY_DEMO profile has been successfully created\n","type":"TEXT"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":null,"message":["%md","","#### Transformer model selection ","The `embedding_model` parameter allows you to choose between different text embedding models and deployment approaches. You can use third-party hosted transformer ","models from providers like OpenAI or Cohere, or use in-database transformers as described below.","","Oracle provides pre-built ONNX transformer models that have been augmented through a specialized pipeline to generate embeddings directly within the database. The following models are available for download.","<span style=\"color: #00008B;\">[Right-click link ? Save As to download]<\/span>:","","- <a href=\"https://adwc4pm.objectstorage.us-ashburn-1.oci.customer-oci.com/p/qXfE9JKYR_w7UP-473agAv_c9b0rQC6vo8_K6bCsaBpSXO0CFzFp7HHx_H7P8HGf/n/adwc4pm/b/OML-ai-models/o/all_MiniLM_L12_v2.onnx\" target=\"_blank\">ALL_MINILM_L12_V2<\/a> (384 dimensions) - Optimized for English content. ","- <a href=\"https://adwc4pm.objectstorage.us-ashburn-1.oci.customer-oci.com/p/k0BGCbupcnBQfLPWX5egR0M7fqKEE3jWqyRDio6Um_AU_N6BheP7yiQgn_0SfmfR/n/adwc4pm/b/OML-ai-models/o/multilingual_e5_small.onnx\" target=\"_blank\">MULTILINGUAL_E5_SMALL<\/a> (384 dimensions) - Supports 100+ languages. ","- <a href=\"https://adwc4pm.objectstorage.us-ashburn-1.oci.customer-oci.com/p/VvKu-Ab2FxWRXrONLXwMclTw0iYAtsUJOVn_m4p1R8rNF4ea8o9ytSPMVf4r3Oid/n/adwc4pm/b/OML-ai-models/o/clip_vit_base_patch32_img.onnx\" target=\"_blank\">CLIP_VIT_BASE_PATCH32_IMG<\/a> (512 dimensions) - CLIP model for image embeddings. ","- <a href=\"https://adwc4pm.objectstorage.us-ashburn-1.oci.customer-oci.com/p/YjeKIRvRbFsq6g5gWFlxazvUxbELCG161GFMEegfYRz7a3gHABeE5m6iQ3fChXYD/n/adwc4pm/b/OML-ai-models/o/clip_vit_base_patch32_txt.onnx\" target=\"_blank\">CLIP_VIT_BASE_PATCH32_TXT<\/a> (512 dimensions) - CLIP model for text embeddings. ","","Each model offers different capabilities and embedding dimensions. Third-party hosted models may provide specialized capabilities or larger embedding dimensions, while ","in-database models provide efficient embedding generation without external API calls. You can switch the active embedding model at any time by updating the profile with `profile.set_attribute()`, as demonstrated below in this section.","","In the following steps, we'll load these embedding models into the database. For additional information on these models, refer to these blogs:","","<a href=\"https://blogs.oracle.com/machinelearning/post/use-our-prebuilt-onnx-model-now-available-for-embedding-generation-in-oracle-database-23ai\" target=\"_blank\">Prebuilt ONNX Models for Embedding Generation<\/a>","<br>","<a href=\"https://blogs.oracle.com/machinelearning/post/enhance-your-semantic-similarity-search-with-multilingual-support\" target=\"_blank\">Multilingual Support for Semantic Similarity Search<\/a>"],"enabled":true,"result":{"startTime":1760327462903,"interpreter":"md.low","endTime":1760327463238,"results":[{"message":"<h4 id=\"transformer-model-selection\">Transformer model selection<\/h4>\n<p>The <code>embedding_model<\/code> parameter allows you to choose between different text embedding models and deployment approaches. You can use third-party hosted transformer\nmodels from providers like OpenAI or Cohere, or use in-database transformers as described below.<\/p>\n<p>Oracle provides pre-built ONNX transformer models that have been augmented through a specialized pipeline to generate embeddings directly within the database. The following models are available for download.\n<span style=\"color: #00008B;\">[Right-click link ? Save As to download]<\/span>:<\/p>\n<ul>\n<li><a href=\"https://adwc4pm.objectstorage.us-ashburn-1.oci.customer-oci.com/p/qXfE9JKYR_w7UP-473agAv_c9b0rQC6vo8_K6bCsaBpSXO0CFzFp7HHx_H7P8HGf/n/adwc4pm/b/OML-ai-models/o/all_MiniLM_L12_v2.onnx\" target=\"_blank\">ALL_MINILM_L12_V2<\/a> (384 dimensions) - Optimized for English content.<\/li>\n<li><a href=\"https://adwc4pm.objectstorage.us-ashburn-1.oci.customer-oci.com/p/k0BGCbupcnBQfLPWX5egR0M7fqKEE3jWqyRDio6Um_AU_N6BheP7yiQgn_0SfmfR/n/adwc4pm/b/OML-ai-models/o/multilingual_e5_small.onnx\" target=\"_blank\">MULTILINGUAL_E5_SMALL<\/a> (384 dimensions) - Supports 100+ languages.<\/li>\n<li><a href=\"https://adwc4pm.objectstorage.us-ashburn-1.oci.customer-oci.com/p/VvKu-Ab2FxWRXrONLXwMclTw0iYAtsUJOVn_m4p1R8rNF4ea8o9ytSPMVf4r3Oid/n/adwc4pm/b/OML-ai-models/o/clip_vit_base_patch32_img.onnx\" target=\"_blank\">CLIP_VIT_BASE_PATCH32_IMG<\/a> (512 dimensions) - CLIP model for image embeddings.<\/li>\n<li><a href=\"https://adwc4pm.objectstorage.us-ashburn-1.oci.customer-oci.com/p/YjeKIRvRbFsq6g5gWFlxazvUxbELCG161GFMEegfYRz7a3gHABeE5m6iQ3fChXYD/n/adwc4pm/b/OML-ai-models/o/clip_vit_base_patch32_txt.onnx\" target=\"_blank\">CLIP_VIT_BASE_PATCH32_TXT<\/a> (512 dimensions) - CLIP model for text embeddings.<\/li>\n<\/ul>\n<p>Each model offers different capabilities and embedding dimensions. Third-party hosted models may provide specialized capabilities or larger embedding dimensions, while\nin-database models provide efficient embedding generation without external API calls. You can switch the active embedding model at any time by updating the profile with <code>profile.set_attribute()<\/code>, as demonstrated below in this section.<\/p>\n<p>In the following steps, we'll load these embedding models into the database. For additional information on these models, refer to these blogs:<\/p>\n<p><a href=\"https://blogs.oracle.com/machinelearning/post/use-our-prebuilt-onnx-model-now-available-for-embedding-generation-in-oracle-database-23ai\" target=\"_blank\">Prebuilt ONNX Models for Embedding Generation<\/a>\n<br>\n<a href=\"https://blogs.oracle.com/machinelearning/post/enhance-your-semantic-similarity-search-with-multilingual-support\" target=\"_blank\">Multilingual Support for Semantic Similarity Search<\/a><\/p>\n","type":"HTML"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"raw","title":"Load Hugging Face all-MiniLM-L12-v2 model","message":["%python","","import oml","cursor = oml.cursor()","","model_name = 'ALL_MINILM_L12_V2'","onnx_file = 'all_MiniLM_L12_v2.onnx'","location_uri = 'https://adwc4pm.objectstorage.us-ashburn-1.oci.customer-oci.com/p/qXfE9JKYR_w7UP-473agAv_c9b0rQC6vo8_K6bCsaBpSXO0CFzFp7HHx_H7P8HGf/n/adwc4pm/b/OML-ai-models/o/'","","cursor.execute(f\"\"\"","BEGIN"," BEGIN "," DBMS_DATA_MINING.DROP_MODEL('{model_name}');"," EXCEPTION WHEN OTHERS THEN NULL; "," END;"," "," DBMS_CLOUD.GET_OBJECT("," credential_name => 'OCI_CRED2',"," directory_name => 'DATA_PUMP_DIR',"," object_uri => '{location_uri}{onnx_file}');"," "," DBMS_VECTOR.LOAD_ONNX_MODEL("," directory => 'DATA_PUMP_DIR',"," file_name => '{onnx_file}',"," model_name => '{model_name}');","END;","\"\"\")","","print(model_name + \" model successfully loaded\")"],"enabled":true,"result":{"startTime":1760327463601,"interpreter":"python.low","endTime":1760327475976,"results":[{"message":"ALL_MINILM_L12_V2 model successfully loaded\n","type":"TEXT"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":0,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"raw","title":"Load Hugging Face multilingual-e5-small model","message":["%python","","model_name = 'MULTILINGUAL_E5_SMALL'","onnx_file = 'multilingual_e5_small.onnx'","location_uri = 'https://adwc4pm.objectstorage.us-ashburn-1.oci.customer-oci.com/p/k0BGCbupcnBQfLPWX5egR0M7fqKEE3jWqyRDio6Um_AU_N6BheP7yiQgn_0SfmfR/n/adwc4pm/b/OML-ai-models/o/'","","cursor.execute(f\"\"\"","BEGIN"," BEGIN "," DBMS_DATA_MINING.DROP_MODEL('{model_name}');"," EXCEPTION WHEN OTHERS THEN NULL; "," END;"," "," DBMS_CLOUD.GET_OBJECT("," credential_name => 'OCI_CRED2',"," directory_name => 'DATA_PUMP_DIR',"," object_uri => '{location_uri}{onnx_file}');"," "," DBMS_VECTOR.LOAD_ONNX_MODEL("," directory => 'DATA_PUMP_DIR',"," file_name => '{onnx_file}',"," model_name => '{model_name}');","END;","\"\"\")","","print(model_name + \" model successfully loaded\")"],"enabled":true,"result":{"startTime":1760327476335,"interpreter":"python.low","endTime":1760327488102,"results":[{"message":"MULTILINGUAL_E5_SMALL model successfully loaded\n","type":"TEXT"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":0,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"raw","title":"Load the Hugging Face CLIP ViT-B/32 text model","message":["%python","","model_name = 'CLIP_VIT_BASE_PATCH32_TXT'","onnx_file = 'clip_vit_base_patch32_txt.onnx'","location_uri = 'https://adwc4pm.objectstorage.us-ashburn-1.oci.customer-oci.com/p/YjeKIRvRbFsq6g5gWFlxazvUxbELCG161GFMEegfYRz7a3gHABeE5m6iQ3fChXYD/n/adwc4pm/b/OML-ai-models/o/'","","cursor.execute(f\"\"\"","BEGIN"," BEGIN "," DBMS_DATA_MINING.DROP_MODEL('{model_name}');"," EXCEPTION WHEN OTHERS THEN NULL; "," END;"," "," DBMS_CLOUD.GET_OBJECT("," credential_name => NULL,"," directory_name => 'DATA_PUMP_DIR',"," object_uri => '{location_uri}{onnx_file}');"," "," DBMS_VECTOR.LOAD_ONNX_MODEL("," directory => 'DATA_PUMP_DIR',"," file_name => '{onnx_file}',"," model_name => '{model_name}',"," metadata => JSON('{{\"function\" : \"embedding\", \"embeddingOutput\" : \"embedding\", \"input\": {{\"input\": [\"DATA\"]}}}}'));","END;","\"\"\")","","print(model_name + \" model successfully loaded\")"],"enabled":true,"result":{"startTime":1760327488468,"interpreter":"python.low","endTime":1760327510555,"results":[{"message":"CLIP_VIT_BASE_PATCH32_TXT model successfully loaded\n","type":"TEXT"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":0,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"raw","title":"Load the Hugging Face CLIP ViT-B/32 image model","message":["%python","","model_name = 'CLIP_VIT_BASE_PATCH32_IMG'","onnx_file = 'clip_vit_base_patch32_img.onnx'","location_uri = 'https://adwc4pm.objectstorage.us-ashburn-1.oci.customer-oci.com/p/VvKu-Ab2FxWRXrONLXwMclTw0iYAtsUJOVn_m4p1R8rNF4ea8o9ytSPMVf4r3Oid/n/adwc4pm/b/OML-ai-models/o/'","","cursor.execute(f\"\"\"","BEGIN"," BEGIN "," DBMS_DATA_MINING.DROP_MODEL('{model_name}');"," EXCEPTION WHEN OTHERS THEN NULL; "," END;"," "," DBMS_CLOUD.GET_OBJECT("," credential_name => NULL,"," directory_name => 'DATA_PUMP_DIR',"," object_uri => '{location_uri}{onnx_file}');"," "," DBMS_VECTOR.LOAD_ONNX_MODEL("," directory => 'DATA_PUMP_DIR',"," file_name => '{onnx_file}',"," model_name => '{model_name}',"," metadata => JSON('{{\"function\" : \"embedding\", \"embeddingOutput\" : \"embedding\", \"input\": {{\"input\": [\"DATA\"]}}}}'));","END;","\"\"\")","","print(model_name + \" model successfully loaded\")"],"enabled":true,"result":{"startTime":1760327510930,"interpreter":"python.low","endTime":1760327540934,"results":[{"message":"CLIP_VIT_BASE_PATCH32_IMG model successfully loaded\n","type":"TEXT"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":0,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"raw","title":"List imported transformer models available for use with in-database ONNX Runtime","message":["%python","","df = oml.sync(query = \"\"\""," SELECT MODEL_NAME"," FROM user_mining_models"," WHERE mining_function = 'EMBEDDING'\"\"\")","","print(df)"],"enabled":true,"result":{"startTime":1760327541298,"interpreter":"python.low","endTime":1760327541689,"results":[{"message":" MODEL_NAME\n0 MULTILINGUAL_E5_SMALL\n1 ALL_MINILM_L12_V2\n2 CLIP_VIT_BASE_PATCH32_IMG\n3 CLIP_VIT_BASE_PATCH32_TXT\n","type":"TEXT"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":0,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"raw","title":"Select AI user: IN_DB_TRANSFORMER_RAG_DEMO profile definition","message":["%python","","provider = select_ai.OCIGenAIProvider("," embedding_model = \"database:MULTILINGUAL_E5_SMALL\")","","profile_attributes = select_ai.ProfileAttributes("," provider = provider,"," credential_name = \"OCI_CRED2\","," vector_index_name = \"MY_VECTOR_INDEX3\","," enable_source_offsets = True,"," conversation = True)","","profile = select_ai.Profile("," profile_name = \"IN_DB_TRANSFORMER_RAG_DEMO\","," attributes = profile_attributes,"," description = \"Supports RAG with semantic search to augment prompts using a vector store using in-database transformer\","," replace = True)","","print(profile.profile_name + \" profile has been successfully created\")"],"enabled":true,"result":{"startTime":1760327542039,"interpreter":"python.low","endTime":1760327543405,"results":[{"message":"IN_DB_TRANSFORMER_RAG_DEMO profile has been successfully created\n","type":"TEXT"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"raw","title":"Optionally specify in-database transformer","message":["%python","","profile = select_ai.Profile(profile_name = \"IN_DB_TRANSFORMER_RAG_DEMO\")","","embedding_model = \"database:MULTILINGUAL_E5_SMALL\"","# embedding_model = \"database:CLIP_VIT_BASE_PATCH32_TXT\"","# embedding_model = \"database:CLIP_VIT_BASE_PATCH32_IMG\"","# embedding_model = \"database:ALL_MINILM_L12_V2\"","","profile.set_attribute("," attribute_name = \"embedding_model\","," attribute_value = embedding_model)","","print(\"Updated \" + profile.profile_name + \" to use transformer: \" + embedding_model)"],"enabled":true,"result":{"startTime":1760327543754,"interpreter":"python.low","endTime":1760327544186,"results":[{"message":"Updated IN_DB_TRANSFORMER_RAG_DEMO to use transformer: database:MULTILINGUAL_E5_SMALL\n","type":"TEXT"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":"Review profile configurations","message":["%md","","Once the profiles are defined, we can list and review their configurations. The following paragraph prints each profile's name and description, providing a ","summary of the defined profiles. The second retrieves and displays all profile attributes,such as model type, schema handling options, and object list settings.","","Together, these steps verify that each profile is correctly configured before being used in Select AI queries."],"enabled":true,"result":{"startTime":1760327544532,"interpreter":"md.low","endTime":1760327544856,"results":[{"message":"<p>Once the profiles are defined, we can list and review their configurations. The following paragraph prints each profile's name and description, providing a\nsummary of the defined profiles. The second retrieves and displays all profile attributes,such as model type, schema handling options, and object list settings.<\/p>\n<p>Together, these steps verify that each profile is correctly configured before being used in Select AI queries.<\/p>\n","type":"HTML"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":true,"width":0,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"raw","title":"View the profile listings","message":["%python","","for profile_name in [\"OCI_GENAI_PY_DEMO\", \"OCI_GENAI_RAG_PY_DEMO\", \"IN_DB_TRANSFORMER_RAG_DEMO\"]:"," profile = select_ai.Profile(profile_name = profile_name)"," print(\"Profile: \" + profile.profile_name)"," print(\"Description: \" + (profile.description or \"\"))"," print(\"-\" * 10)"],"enabled":true,"result":{"startTime":1760327545214,"interpreter":"python.low","endTime":1760327545606,"results":[{"message":"Profile: OCI_GENAI_PY_DEMO\nDescription: Profile for chat, NL2SQL, and SDG\n----------\nProfile: OCI_GENAI_RAG_PY_DEMO\nDescription: Supports RAG with semantic search to augment prompts using a vector store\n----------\nProfile: IN_DB_TRANSFORMER_RAG_DEMO\nDescription: Supports RAG with semantic search to augment prompts using a vector store using in-database transformer\n----------\n","type":"TEXT"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"raw","title":"View profile attributes","message":["%python","","from pprint import pprint","","profile_names = [\"OCI_GENAI_PY_DEMO\", \"OCI_GENAI_RAG_PY_DEMO\", \"IN_DB_TRANSFORMER_RAG_DEMO\"]","","for i, profile_name in enumerate(profile_names):"," try:"," profile = select_ai.Profile(profile_name = profile_name)"," attributes = profile.get_attributes()"," print(\"\\nProfile: \" + profile_name)"," pprint(attributes.dict(exclude_null=False))"," "," # Add dashes between profiles (not after the last one)"," if i < len(profile_names) - 1:"," print(\"-\" * 50)"," except:"," pass"],"enabled":true,"result":{"startTime":1760327545974,"interpreter":"python.low","endTime":1760327546508,"results":[{"message":"\nProfile: OCI_GENAI_PY_DEMO\n{'annotations': 'true',\n 'case_sensitive_values': None,\n 'comments': 'true',\n 'constraints': 'true',\n 'conversation': 'true',\n 'credential_name': 'OCI_CRED2',\n 'enable_source_offsets': None,\n 'enable_sources': None,\n 'enforce_object_list': None,\n 'max_tokens': '1024',\n 'object_list': '[{\"owner\":\"SH\",\"name\":\"CUSTOMERS\"},{\"owner\":\"SH\",\"name\":\"SALES\"},{\"owner\":\"SH\",\"name\":\"PRODUCTS\"},{\"owner\":\"SH\",\"name\":\"COUNTRIES\"}]',\n 'object_list_mode': None,\n 'provider': OCIGenAIProvider(embedding_model=None,\n model=None,\n provider_name='oci',\n provider_endpoint=None,\n region=None,\n oci_apiformat=None,\n oci_compartment_id=None,\n oci_endpoint_id=None,\n oci_runtimetype=None),\n 'seed': None,\n 'stop_tokens': None,\n 'streaming': None,\n 'temperature': None,\n 'vector_index_name': None}\n--------------------------------------------------\n\nProfile: OCI_GENAI_RAG_PY_DEMO\n{'annotations': None,\n 'case_sensitive_values': None,\n 'comments': None,\n 'constraints': None,\n 'conversation': 'true',\n 'credential_name': 'OCI_CRED2',\n 'enable_source_offsets': 'true',\n 'enable_sources': None,\n 'enforce_object_list': None,\n 'max_tokens': '1024',\n 'object_list': None,\n 'object_list_mode': None,\n 'provider': OCIGenAIProvider(embedding_model='cohere.embed-english-v3.0',\n model='meta.llama-4-maverick-17b-128e-instruct-fp8',\n provider_name='oci',\n provider_endpoint=None,\n region=None,\n oci_apiformat=None,\n oci_compartment_id=None,\n oci_endpoint_id=None,\n oci_runtimetype=None),\n 'seed': None,\n 'stop_tokens': None,\n 'streaming': None,\n 'temperature': None,\n 'vector_index_name': 'MY_VECTOR_INDEX2'}\n--------------------------------------------------\n\nProfile: IN_DB_TRANSFORMER_RAG_DEMO\n{'annotations': None,\n 'case_sensitive_values': None,\n 'comments': None,\n 'constraints': None,\n 'conversation': 'true',\n 'credential_name': 'OCI_CRED2',\n 'enable_source_offsets': 'true',\n 'enable_sources': None,\n 'enforce_object_list': None,\n 'max_tokens': '1024',\n 'object_list': None,\n 'object_list_mode': None,\n 'provider': OCIGenAIProvider(embedding_model='database:MULTILINGUAL_E5_SMALL',\n model=None,\n provider_name='oci',\n provider_endpoint=None,\n region=None,\n oci_apiformat=None,\n oci_compartment_id=None,\n oci_endpoint_id=None,\n oci_runtimetype=None),\n 'seed': None,\n 'stop_tokens': None,\n 'streaming': None,\n 'temperature': None,\n 'vector_index_name': 'MY_VECTOR_INDEX3'}\n","type":"TEXT"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":false,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":true,"hideVizConfig":false,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":null,"message":["%md","### Next Steps","","After completing this setup, you're ready to use Select AI's features through the following companion notebooks:","","- **SelectAI4Py -1- Chat**","- **SelectAI4Py -2- Natural Language to SQL (NL2SQL)** ","- **SelectAI4Py -3- Retrieval Augmented Generation (RAG)** ","- **SelectAI4Py -4- Synthetic Data Generation (SDG)** ","","These notebooks provide step-by-step instructions for using each feature with the profiles you've configured."],"enabled":true,"result":{"startTime":1760327546868,"interpreter":"md.low","endTime":1760327547201,"results":[{"message":"<h3 id=\"next-steps\">Next Steps<\/h3>\n<p>After completing this setup, you're ready to use Select AI's features through the following companion notebooks:<\/p>\n<ul>\n<li><strong>SelectAI4Py -1- Chat<\/strong><\/li>\n<li><strong>SelectAI4Py -2- Natural Language to SQL (NL2SQL)<\/strong><\/li>\n<li><strong>SelectAI4Py -3- Retrieval Augmented Generation (RAG)<\/strong><\/li>\n<li><strong>SelectAI4Py -4- Synthetic Data Generation (SDG)<\/strong><\/li>\n<\/ul>\n<p>These notebooks provide step-by-step instructions for using each feature with the profiles you've configured.<\/p>\n","type":"HTML"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"},{"col":0,"visualizationConfig":null,"hideInIFrame":false,"selectedVisualization":"html","title":null,"message":["%md","# End of Script"],"enabled":true,"result":{"startTime":1760327547557,"interpreter":"md.low","endTime":1760327547886,"results":[{"message":"<h1 id=\"end-of-script\">End of Script<\/h1>\n","type":"HTML"}],"taskStatus":"SUCCESS","forms":"[]","status":"SUCCESS"},"sizeX":0,"hideCode":true,"width":12,"hideResult":false,"dynamicFormParams":"{}","row":0,"hasTitle":false,"hideVizConfig":true,"hideGutter":true,"relations":[],"forms":"[]"}],"version":"7","snapshot":false,"tags":null}]