Google Cloud El Carro Oracle offers a way to runThis guide goes over how to use theOracle
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.
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 ownlangchain-google-el-carro
package, so we need to install it.
🔐 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.
☁ 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.
Basic Usage
Set Up Oracle Database Connection
Fill out the following variable with your Oracle database connections details.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
ElCarroEngine Connection Pool
ElCarroEngine
configures a connection pool to your Oracle database, enabling successful connections from your application and following industry best practices.
Initialize a table
TheElCarroChatMessageHistory
class requires a database table with a specific
schema in order to store the chat message history.
The ElCarroEngine
class has a
method init_chat_history_table()
that can be used to create a table with the
proper schema for you.
ElCarroChatMessageHistory
To initialize theElCarroChatMessageHistory
class you need to provide only 3
things:
elcarro_engine
- An instance of anElCarroEngine
engine.session_id
- A unique identifier string that specifies an id for the session.table_name
: The name of the table within the Oracle database to store the chat message history.