Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -42,7 +42,7 @@ def search_similar_chats(query: str, maxResults: int = 10) -> List[Dict]:
|
|
| 42 |
with conn.cursor() as cur:
|
| 43 |
cur.execute("""
|
| 44 |
SELECT id, metadata, content, embedding <#> %s AS distance
|
| 45 |
-
FROM
|
| 46 |
WHERE metadata->>'documentType' = 'chatAnalysis'
|
| 47 |
ORDER BY embedding <#> %s
|
| 48 |
LIMIT %s
|
|
@@ -74,7 +74,7 @@ def search_chats_by_category(category: str, maxResults: int = 10) -> List[Dict]:
|
|
| 74 |
with conn.cursor() as cur:
|
| 75 |
cur.execute("""
|
| 76 |
SELECT id, metadata, content
|
| 77 |
-
FROM
|
| 78 |
WHERE metadata->>'documentType' = 'chatAnalysis'
|
| 79 |
AND metadata->>'category' = %s
|
| 80 |
LIMIT %s
|
|
@@ -105,7 +105,7 @@ def search_chats_by_date(startDate: str = None, endDate: str = None, maxResults:
|
|
| 105 |
conn = get_db_conn()
|
| 106 |
query = """
|
| 107 |
SELECT id, metadata, content
|
| 108 |
-
FROM
|
| 109 |
WHERE metadata->>'documentType' = 'chatAnalysis'
|
| 110 |
"""
|
| 111 |
params = []
|
|
|
|
| 42 |
with conn.cursor() as cur:
|
| 43 |
cur.execute("""
|
| 44 |
SELECT id, metadata, content, embedding <#> %s AS distance
|
| 45 |
+
FROM vector_store
|
| 46 |
WHERE metadata->>'documentType' = 'chatAnalysis'
|
| 47 |
ORDER BY embedding <#> %s
|
| 48 |
LIMIT %s
|
|
|
|
| 74 |
with conn.cursor() as cur:
|
| 75 |
cur.execute("""
|
| 76 |
SELECT id, metadata, content
|
| 77 |
+
FROM vector_store
|
| 78 |
WHERE metadata->>'documentType' = 'chatAnalysis'
|
| 79 |
AND metadata->>'category' = %s
|
| 80 |
LIMIT %s
|
|
|
|
| 105 |
conn = get_db_conn()
|
| 106 |
query = """
|
| 107 |
SELECT id, metadata, content
|
| 108 |
+
FROM vector_store
|
| 109 |
WHERE metadata->>'documentType' = 'chatAnalysis'
|
| 110 |
"""
|
| 111 |
params = []
|