Update app.py
Browse files
app.py
CHANGED
|
@@ -1343,15 +1343,16 @@ def chat_or_recommend(req: ChatOrRecommendRequest):
|
|
| 1343 |
|
| 1344 |
# 5) ์ต์ข
์๋ต ๊ฒฐํฉ
|
| 1345 |
final_response = counseling_response + chatbot_msg
|
| 1346 |
-
|
| 1347 |
-
final_response += recommendation_msg
|
| 1348 |
|
| 1349 |
# 6) ์๋ต JSON ๊ตฌ์ฑ
|
| 1350 |
response_dict = {
|
| 1351 |
-
|
| 1352 |
-
|
| 1353 |
-
|
| 1354 |
-
|
|
|
|
|
|
|
| 1355 |
if recommendation_msg:
|
| 1356 |
response_dict["recommendations"] = recommendations_list
|
| 1357 |
|
|
|
|
| 1343 |
|
| 1344 |
# 5) ์ต์ข
์๋ต ๊ฒฐํฉ
|
| 1345 |
final_response = counseling_response + chatbot_msg
|
| 1346 |
+
|
|
|
|
| 1347 |
|
| 1348 |
# 6) ์๋ต JSON ๊ตฌ์ฑ
|
| 1349 |
response_dict = {
|
| 1350 |
+
"mode": "chat+recommend" if recommendation_msg else "chat",
|
| 1351 |
+
"response": final_response, # ๐น ์ฑ๋ด ์๋ต๋ง ํฌํจ
|
| 1352 |
+
"depression_label": depression_label,
|
| 1353 |
+
"recommendation_msg": recommendation_msg if recommendation_msg else None, # ๐น ์ถ์ฒ ๋ฉ์์ง ๋ณ๋ ํ๋
|
| 1354 |
+
"recommendations": recommendations_list if recommendations_list else None
|
| 1355 |
+
}
|
| 1356 |
if recommendation_msg:
|
| 1357 |
response_dict["recommendations"] = recommendations_list
|
| 1358 |
|