tawfik.gh
commited on
Commit
•
8749174
1
Parent(s):
366820f
update the table name
Browse files- chatbot_helper.py +4 -4
chatbot_helper.py
CHANGED
@@ -42,12 +42,12 @@ def oracle_db(query:str, top_k:int) -> list[dict]:
|
|
42 |
import oracledb
|
43 |
connection = oracledb.connect(user="ai", password="testtest",dsn="91.75.21.131:9522/FREEPDB1")
|
44 |
cursor = connection.cursor()
|
45 |
-
exist = cursor.execute("""SELECT v.
|
46 |
VECTOR_DISTANCE(v.vector,TO_VECTOR(VECTOR_EMBEDDING(ALL_MINILM_L12_V2 USING :query as data)), COSINE) AS distance
|
47 |
FROM
|
48 |
-
ai.
|
49 |
-
JOIN ai.dld_property prop ON prop.property_id = v.
|
50 |
-
JOIN ai.dld_trans t ON t.prop_id = v.
|
51 |
ORDER BY distance ASC
|
52 |
FETCH FIRST :top_k ROWS ONLY""", query=query, top_k=top_k)
|
53 |
columns = [col[0] for col in cursor.description]
|
|
|
42 |
import oracledb
|
43 |
connection = oracledb.connect(user="ai", password="testtest",dsn="91.75.21.131:9522/FREEPDB1")
|
44 |
cursor = connection.cursor()
|
45 |
+
exist = cursor.execute("""SELECT v.vector_id, prop.*, t.*,
|
46 |
VECTOR_DISTANCE(v.vector,TO_VECTOR(VECTOR_EMBEDDING(ALL_MINILM_L12_V2 USING :query as data)), COSINE) AS distance
|
47 |
FROM
|
48 |
+
ai.prop_vectors v
|
49 |
+
JOIN ai.dld_property prop ON prop.property_id = v.property_id
|
50 |
+
JOIN ai.dld_trans t ON t.prop_id = v.property_id
|
51 |
ORDER BY distance ASC
|
52 |
FETCH FIRST :top_k ROWS ONLY""", query=query, top_k=top_k)
|
53 |
columns = [col[0] for col in cursor.description]
|