mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-25 08:03:39 +00:00
docs: Fix oracle doc loader format issue (#19628)
This commit is contained in:
parent
ad77fa15ee
commit
1c27de6ce2
@ -5,18 +5,29 @@
|
|||||||
"source": [
|
"source": [
|
||||||
"# Oracle Autonomous Database\n",
|
"# Oracle Autonomous Database\n",
|
||||||
"\n",
|
"\n",
|
||||||
"This notebook covers how to load documents from oracle autonomous database, the loader supports connection with connection string or tns config.\n",
|
"Oracle autonomous database is a cloud database that uses machine learning to automate database tuning, security, backups, updates, and other routine management tasks traditionally performed by DBAs.\n",
|
||||||
|
"\n",
|
||||||
|
"This notebook covers how to load documents from oracle autonomous database, the loader supports connection with connection string or tns configuration.\n",
|
||||||
"\n",
|
"\n",
|
||||||
"## Prerequisites\n",
|
"## Prerequisites\n",
|
||||||
"1. Database runs in a 'Thin' mode.\n",
|
"1. Database runs in a 'Thin' mode:\n",
|
||||||
" https://python-oracledb.readthedocs.io/en/latest/user_guide/appendix_b.html\n",
|
" https://python-oracledb.readthedocs.io/en/latest/user_guide/appendix_b.html\n",
|
||||||
"2. `pip install oracledb`\n",
|
"2. `pip install oracledb`:\n",
|
||||||
" https://python-oracledb.readthedocs.io/en/latest/user_guide/installation.html"
|
" https://python-oracledb.readthedocs.io/en/latest/user_guide/installation.html"
|
||||||
],
|
],
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"collapsed": false
|
"collapsed": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"source": [
|
||||||
|
"## Instructions"
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"collapsed": false
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": null,
|
"execution_count": null,
|
||||||
@ -49,7 +60,7 @@
|
|||||||
{
|
{
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"source": [
|
"source": [
|
||||||
"With mutual TLS authentication (mTLS), wallet_location and wallet_password are required to create the connection, user can create connection by providing either connection string or tns config details."
|
"With mutual TLS authentication (mTLS), wallet_location and wallet_password are required to create the connection, user can create connection by providing either connection string or tns configuration details."
|
||||||
],
|
],
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"collapsed": false
|
"collapsed": false
|
||||||
@ -63,6 +74,7 @@
|
|||||||
"SQL_QUERY = \"select prod_id, time_id from sh.costs fetch first 5 rows only\"\n",
|
"SQL_QUERY = \"select prod_id, time_id from sh.costs fetch first 5 rows only\"\n",
|
||||||
"\n",
|
"\n",
|
||||||
"doc_loader_1 = OracleAutonomousDatabaseLoader(\n",
|
"doc_loader_1 = OracleAutonomousDatabaseLoader(\n",
|
||||||
|
" query=SQL_QUERY,\n",
|
||||||
" user=s.USERNAME,\n",
|
" user=s.USERNAME,\n",
|
||||||
" password=s.PASSWORD,\n",
|
" password=s.PASSWORD,\n",
|
||||||
" schema=s.SCHEMA,\n",
|
" schema=s.SCHEMA,\n",
|
||||||
@ -70,18 +82,17 @@
|
|||||||
" wallet_location=s.WALLET_LOCATION,\n",
|
" wallet_location=s.WALLET_LOCATION,\n",
|
||||||
" wallet_password=s.PASSWORD,\n",
|
" wallet_password=s.PASSWORD,\n",
|
||||||
" tns_name=s.TNS_NAME,\n",
|
" tns_name=s.TNS_NAME,\n",
|
||||||
" query=SQL_QUERY,\n",
|
|
||||||
")\n",
|
")\n",
|
||||||
"doc_1 = doc_loader_1.load()\n",
|
"doc_1 = doc_loader_1.load()\n",
|
||||||
"\n",
|
"\n",
|
||||||
"doc_loader_2 = OracleAutonomousDatabaseLoader(\n",
|
"doc_loader_2 = OracleAutonomousDatabaseLoader(\n",
|
||||||
|
" query=SQL_QUERY,\n",
|
||||||
" user=s.USERNAME,\n",
|
" user=s.USERNAME,\n",
|
||||||
" password=s.PASSWORD,\n",
|
" password=s.PASSWORD,\n",
|
||||||
" schema=s.SCHEMA,\n",
|
" schema=s.SCHEMA,\n",
|
||||||
" connection_string=s.CONNECTION_STRING,\n",
|
" connection_string=s.CONNECTION_STRING,\n",
|
||||||
" wallet_location=s.WALLET_LOCATION,\n",
|
" wallet_location=s.WALLET_LOCATION,\n",
|
||||||
" wallet_password=s.PASSWORD,\n",
|
" wallet_password=s.PASSWORD,\n",
|
||||||
" query=SQL_QUERY,\n",
|
|
||||||
")\n",
|
")\n",
|
||||||
"doc_2 = doc_loader_2.load()"
|
"doc_2 = doc_loader_2.load()"
|
||||||
],
|
],
|
||||||
@ -107,21 +118,21 @@
|
|||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"doc_loader_3 = OracleAutonomousDatabaseLoader(\n",
|
"doc_loader_3 = OracleAutonomousDatabaseLoader(\n",
|
||||||
|
" query=SQL_QUERY,\n",
|
||||||
" user=s.USERNAME,\n",
|
" user=s.USERNAME,\n",
|
||||||
" password=s.PASSWORD,\n",
|
" password=s.PASSWORD,\n",
|
||||||
" schema=s.SCHEMA,\n",
|
" schema=s.SCHEMA,\n",
|
||||||
" config_dir=s.CONFIG_DIR,\n",
|
" config_dir=s.CONFIG_DIR,\n",
|
||||||
" tns_name=s.TNS_NAME,\n",
|
" tns_name=s.TNS_NAME,\n",
|
||||||
" query=SQL_QUERY,\n",
|
|
||||||
")\n",
|
")\n",
|
||||||
"doc_3 = doc_loader_3.load()\n",
|
"doc_3 = doc_loader_3.load()\n",
|
||||||
"\n",
|
"\n",
|
||||||
"doc_loader_4 = OracleAutonomousDatabaseLoader(\n",
|
"doc_loader_4 = OracleAutonomousDatabaseLoader(\n",
|
||||||
|
" query=SQL_QUERY,\n",
|
||||||
" user=s.USERNAME,\n",
|
" user=s.USERNAME,\n",
|
||||||
" password=s.PASSWORD,\n",
|
" password=s.PASSWORD,\n",
|
||||||
" schema=s.SCHEMA,\n",
|
" schema=s.SCHEMA,\n",
|
||||||
" connection_string=s.CONNECTION_STRING,\n",
|
" connection_string=s.CONNECTION_STRING,\n",
|
||||||
" query=SQL_QUERY,\n",
|
|
||||||
")\n",
|
")\n",
|
||||||
"doc_4 = doc_loader_4.load()"
|
"doc_4 = doc_loader_4.load()"
|
||||||
],
|
],
|
||||||
|
Loading…
Reference in New Issue
Block a user