Update app.py
Browse files
app.py
CHANGED
@@ -140,7 +140,7 @@ def retrieve_from_rag(user_query):
|
|
140 |
print("Searching in RAG with history context...")
|
141 |
|
142 |
query_embedding = embedding_model.encode(user_query)
|
143 |
-
results = collection.query(query_embeddings=[query_embedding], n_results=
|
144 |
|
145 |
if not results or not results.get('documents'):
|
146 |
return None
|
|
|
140 |
print("Searching in RAG with history context...")
|
141 |
|
142 |
query_embedding = embedding_model.encode(user_query)
|
143 |
+
results = collection.query(query_embeddings=[query_embedding], n_results=5) # Get top 5 first
|
144 |
|
145 |
if not results or not results.get('documents'):
|
146 |
return None
|