Update app.py
Browse files
app.py
CHANGED
|
@@ -1259,7 +1259,15 @@ def chat_or_recommend(req: ChatOrRecommendRequest):
|
|
| 1259 |
user_input = req.user_input
|
| 1260 |
mode = req.mode.lower() # "emotion" or "rational"
|
| 1261 |
RECOMMEND_KEYWORDS = ["์ถ์ฒ", "์ถ์ฒํด์ค", "์ทจ๋ฏธ ์ถ์ฒ"]
|
|
|
|
|
|
|
|
|
|
| 1262 |
# (A) '์ถ์ฒ' ํค์๋ ํฌํจ ์ฌ๋ถ ํ์ธ
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1263 |
is_recommend_query = any(keyword in user_input for keyword in RECOMMEND_KEYWORDS)
|
| 1264 |
|
| 1265 |
# (B) '์ถ์ฒ' ํค์๋๊ฐ ์์ผ๋ฉด โ ์ถ์ฒ๋ง ์ํ (์ฑ๋ด/์ฐ์ธ๋ถ์ X)
|
|
|
|
| 1259 |
user_input = req.user_input
|
| 1260 |
mode = req.mode.lower() # "emotion" or "rational"
|
| 1261 |
RECOMMEND_KEYWORDS = ["์ถ์ฒ", "์ถ์ฒํด์ค", "์ทจ๋ฏธ ์ถ์ฒ"]
|
| 1262 |
+
HI_KEYWORDS = ["์๋
","์๋
!","์๋
~","์๋
?"]
|
| 1263 |
+
is_hi_query = any(keyword in user_input for keyword in HI_KEYWORDS)
|
| 1264 |
+
|
| 1265 |
# (A) '์ถ์ฒ' ํค์๋ ํฌํจ ์ฌ๋ถ ํ์ธ
|
| 1266 |
+
if is_hi_query:
|
| 1267 |
+
return {
|
| 1268 |
+
"mode": "chat",
|
| 1269 |
+
"response": "์๋
! ๋ง๋์ ๋ฐ๊ฐ์. ์ค๋ ๋์ ๊ธฐ๋ถ์ ์ด๋ ์ด?"
|
| 1270 |
+
}
|
| 1271 |
is_recommend_query = any(keyword in user_input for keyword in RECOMMEND_KEYWORDS)
|
| 1272 |
|
| 1273 |
# (B) '์ถ์ฒ' ํค์๋๊ฐ ์์ผ๋ฉด โ ์ถ์ฒ๋ง ์ํ (์ฑ๋ด/์ฐ์ธ๋ถ์ X)
|