Google El Carro Oracle
Google Cloud El Carro Oracle offers a way to run
Oracle
databases inKubernetes
as a portable, open source, community-driven, no vendor lock-in container orchestration system.El Carro
provides a powerful declarative API for comprehensive and consistent configuration and deployment as well as for real-time operations and monitoring. Extend yourOracle
database's capabilities to build AI-powered experiences by leveraging theEl Carro
Langchain integration.
This guide goes over how to use the El Carro
Langchain integration to store chat message history with the ElCarroChatMessageHistory
class. This integration works for any Oracle
database, regardless of where it is running.
Learn more about the package on GitHub.
Before You Begin
To run this notebook, you will need to do the following:
- Complete the Getting Started section if you would like to run your Oracle database with El Carro.
🦜🔗 Library Installation
The integration lives in its own langchain-google-el-carro
package, so we need to install it.
%pip install --upgrade --quiet langchain-google-el-carro langchain-google-vertexai langchain
Colab only: Uncomment the following cell to restart the kernel or use the button to restart the kernel. For Vertex AI Workbench you can restart the terminal using the button on top.
# # Automatically restart kernel after installs so that your environment can access the new packages
# import IPython
# app = IPython.Application.instance()
# app.kernel.do_shutdown(True)
🔐 Authentication
Authenticate to Google Cloud as the IAM user logged into this notebook in order to access your Google Cloud Project.
- If you are using Colab to run this notebook, use the cell below and continue.
- If you are using Vertex AI Workbench, check out the setup instructions here.
# from google.colab import auth
# auth.authenticate_user()
☁ Set Your Google Cloud Project
Set your Google Cloud project so that you can leverage Google Cloud resources within this notebook.
If you don't know your project ID, try the following:
- Run
gcloud config list
. - Run
gcloud projects list
. - See the support page: Locate the project ID.
# @markdown Please fill in the value below with your Google Cloud project ID and then run the cell.
PROJECT_ID = "my-project-id" # @param {type:"string"}
# Set the project id
!gcloud config set project {PROJECT_ID}
Basic Usage
Set Up Oracle Database Connection
Fill out the following variable with your Oracle database connections details.
# @title Set Your Values Here { display-mode: "form" }
HOST = "127.0.0.1" # @param {type: "string"}
PORT = 3307 # @param {type: "integer"}
DATABASE = "my-database" # @param {type: "string"}
TABLE_NAME = "message_store" # @param {type: "string"}
USER = "my-user" # @param {type: "string"}
PASSWORD = input("Please provide a password to be used for the database user: ")
If you are using El Carro
, you can find the hostname and port values in the
status of the El Carro
Kubernetes instance.
Use the user password you created for your PDB.
Example
kubectl get -w instances.oracle.db.anthosapis.com -n db NAME DB ENGINE VERSION EDITION ENDPOINT URL DB NAMES BACKUP ID READYSTATUS READYREASON DBREADYSTATUS DBREADYREASON mydb Oracle 18c Express mydb-svc.db 34.71.69.25:6021 False CreateInProgress