Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -42,10 +42,10 @@ def search_similar_chats(query: str, maxResults: int = 10) -> List[Dict]:
|
|
| 42 |
conn = get_db_conn()
|
| 43 |
with conn.cursor() as cur:
|
| 44 |
cur.execute("""
|
| 45 |
-
SELECT id, metadata, content, embedding <#> %s AS distance
|
| 46 |
FROM vector_store
|
| 47 |
WHERE metadata->>'documentType' = 'chatAnalysis'
|
| 48 |
-
ORDER BY embedding <#> %s
|
| 49 |
LIMIT %s
|
| 50 |
""", (embedding, embedding, maxResults))
|
| 51 |
rows = cur.fetchall()
|
|
|
|
| 42 |
conn = get_db_conn()
|
| 43 |
with conn.cursor() as cur:
|
| 44 |
cur.execute("""
|
| 45 |
+
SELECT id, metadata, content, embedding <#> %s::vector AS distance
|
| 46 |
FROM vector_store
|
| 47 |
WHERE metadata->>'documentType' = 'chatAnalysis'
|
| 48 |
+
ORDER BY embedding <#> %s::vector
|
| 49 |
LIMIT %s
|
| 50 |
""", (embedding, embedding, maxResults))
|
| 51 |
rows = cur.fetchall()
|