Spaces:
Paused
Paused
Commit
·
5ece7aa
1
Parent(s):
cfadddc
fix redis
Browse files
app.py
CHANGED
|
@@ -277,7 +277,6 @@ Câu hỏi của người dùng: {query}
|
|
| 277 |
|
| 278 |
|
| 279 |
def ask_with_history_v3(query: str, conversation_id: str, isFirst,cid,mode):
|
| 280 |
-
print(cid)
|
| 281 |
parsed_conversation = retrieve_conversation(conversation_id)
|
| 282 |
weighted_query_vector = get_weighted_query(query, parsed_conversation)
|
| 283 |
|
|
@@ -308,6 +307,8 @@ def ask_with_history_v3(query: str, conversation_id: str, isFirst,cid,mode):
|
|
| 308 |
for chunk in response:
|
| 309 |
yield chunk.text
|
| 310 |
|
|
|
|
|
|
|
| 311 |
store_conversation(conversation_id, query, response.text)
|
| 312 |
|
| 313 |
# API endpoints
|
|
|
|
| 277 |
|
| 278 |
|
| 279 |
def ask_with_history_v3(query: str, conversation_id: str, isFirst,cid,mode):
|
|
|
|
| 280 |
parsed_conversation = retrieve_conversation(conversation_id)
|
| 281 |
weighted_query_vector = get_weighted_query(query, parsed_conversation)
|
| 282 |
|
|
|
|
| 307 |
for chunk in response:
|
| 308 |
yield chunk.text
|
| 309 |
|
| 310 |
+
if mode == "2" or ("Mình sẽ hỗ trợ bạn câu khác nhé?" in response.text):
|
| 311 |
+
return
|
| 312 |
store_conversation(conversation_id, query, response.text)
|
| 313 |
|
| 314 |
# API endpoints
|