Skip to content

Commit 360129f

Browse files
committed
Merge branch 'main' into cdb-fix
2 parents f5a37fa + c6911aa commit 360129f

File tree

3 files changed

+26
-21
lines changed

3 files changed

+26
-21
lines changed

app/requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ langchain-cohere==0.3.1
2020
langchain-community==0.3.7
2121
langchain-huggingface==0.1.2
2222
langchain-ollama==0.2.0
23-
langchain-openai==0.2.8
24-
langgraph==0.2.48
25-
llama_index==0.11.23
23+
langchain-openai==0.2.9
24+
langgraph==0.2.53
25+
llama_index==0.12.1
2626
lxml==5.3.0
2727
matplotlib==3.9.2
2828
oci>=2.0.0

app/src/modules/utilities.py

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -235,19 +235,24 @@ def init_vs(db_conn, embedding_function, store_table, distance_metric):
235235

236236
def get_vs_table(model, chunk_size, chunk_overlap, distance_metric, embed_alias=None):
237237
"""Return the concatenated VS Table name and comment"""
238-
chunk_overlap_ceil = math.ceil(chunk_overlap)
239-
table_string = f"{model}_{chunk_size}_{chunk_overlap_ceil}_{distance_metric}"
240-
if embed_alias:
241-
table_string = f"{embed_alias}_{table_string}"
242-
store_table = re.sub(r"\W", "_", table_string.upper())
243-
store_comment = (
244-
f'{{"alias": "{embed_alias}",'
245-
f'"model": "{model}",'
246-
f'"chunk_size": {chunk_size},'
247-
f'"chunk_overlap": {chunk_overlap_ceil},'
248-
f'"distance_metric": "{distance_metric}"}}'
249-
)
250-
logger.info("Vector Store Table: %s; Comment: %s", store_table, store_comment)
238+
store_table = None
239+
store_comment = None
240+
try:
241+
chunk_overlap_ceil = math.ceil(chunk_overlap)
242+
table_string = f"{model}_{chunk_size}_{chunk_overlap_ceil}_{distance_metric}"
243+
if embed_alias:
244+
table_string = f"{embed_alias}_{table_string}"
245+
store_table = re.sub(r"\W", "_", table_string.upper())
246+
store_comment = (
247+
f'{{"alias": "{embed_alias}",'
248+
f'"model": "{model}",'
249+
f'"chunk_size": {chunk_size},'
250+
f'"chunk_overlap": {chunk_overlap_ceil},'
251+
f'"distance_metric": "{distance_metric}"}}'
252+
)
253+
logger.info("Vector Store Table: %s; Comment: %s", store_table, store_comment)
254+
except TypeError:
255+
logger.fatal("Not all required values provided to get Vector Store Table name.")
251256
return store_table, store_comment
252257

253258

@@ -332,7 +337,8 @@ def json_to_doc(file: str):
332337
# Build the Index
333338
logger.info("Creating index on: %s", store_table)
334339
try:
335-
LangchainVS.create_index(db_conn, vectorstore)
340+
params = {"idx_name": f"{store_table}_HNSW_IDX", "idx_type": "HNSW"}
341+
LangchainVS.create_index(db_conn, vectorstore, params)
336342
except Exception as ex:
337343
logger.error("Unable to create vector index: %s", ex)
338344

@@ -370,7 +376,6 @@ def get_vs_tables(conn, enabled_embed):
370376

371377
return json.dumps(output, indent=4)
372378

373-
374379
###############################################################################
375380
# Oracle Cloud Infrastructure
376381
###############################################################################

docs/content/walkthrough/_index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ To start Oracle Database 23ai Free:
114114

115115
alter session set container=FREEPDB1;
116116

117-
CREATE USER "WALKTHROUGH" IDENTIFIED BY ORA_41_M_SANDBOX
117+
CREATE USER "WALKTHROUGH" IDENTIFIED BY OrA_41_M_SANDBOX
118118
DEFAULT TABLESPACE "USERS"
119119
TEMPORARY TABLESPACE "TEMP";
120120
GRANT "DB_DEVELOPER_ROLE" TO "WALKTHROUGH";
@@ -215,7 +215,7 @@ To configure the On-Premises Embedding Model, navigate back to the _Configuratio
215215
To configure Oracle Database 23ai Free, navigate to the _Configuration -> Database_ screen:
216216

217217
1. Enter the Database Username: `WALKTHROUGH`
218-
1. Enter the Database Password for `WALKTHROUGH`: `ORA_41_M_SANDBOX`
218+
1. Enter the Database Password for `WALKTHROUGH`: `OrA_41_M_SANDBOX`
219219
1. Enter the Database Connection String: `//localhost:1521/FREEPDB1`
220220
1. Save
221221

@@ -256,7 +256,7 @@ From the command line:
256256
1. Connect to the Oracle Database 23ai Database:
257257

258258
```bash
259-
podman exec -it oaim-db sqlplus 'WALKTHROUGH/ORA_41_M_SANDBOX@FREEPDB1'
259+
podman exec -it oaim-db sqlplus 'WALKTHROUGH/OrA_41_M_SANDBOX@FREEPDB1'
260260
```
261261

262262
1. Query the Vector Store:

0 commit comments

Comments
 (0)