Spaces:
Sleeping
Sleeping
hafidhsoekma
commited on
Commit
•
1567f56
1
Parent(s):
6eaf265
fix bug for check message has ended
Browse files- app.py +1 -1
- utils/functional.py +0 -4
app.py
CHANGED
@@ -78,7 +78,7 @@ def bot(chat_openai, questions, id_interview, history):
|
|
78 |
bot_message = F.get_bot_message(chat_openai, history_messages)
|
79 |
|
80 |
if not bot_message == prompts.END_CHATBOT_PROMPTS:
|
81 |
-
check_if_end_of_message =
|
82 |
if check_if_end_of_message:
|
83 |
bot_message = bot_message.replace(f'ID Interview: "{id_interview}"', "")
|
84 |
bot_message = (
|
|
|
78 |
bot_message = F.get_bot_message(chat_openai, history_messages)
|
79 |
|
80 |
if not bot_message == prompts.END_CHATBOT_PROMPTS:
|
81 |
+
check_if_end_of_message = id_interview in bot_message
|
82 |
if check_if_end_of_message:
|
83 |
bot_message = bot_message.replace(f'ID Interview: "{id_interview}"', "")
|
84 |
bot_message = (
|
utils/functional.py
CHANGED
@@ -53,10 +53,6 @@ def get_bot_message(
|
|
53 |
return result_ai_message.content
|
54 |
|
55 |
|
56 |
-
def check_if_end_of_message(message: str) -> bool:
|
57 |
-
return configs.END_OF_INTERVIEW_MESSAGE in message
|
58 |
-
|
59 |
-
|
60 |
def remove_html_tags(text: str) -> str:
|
61 |
clean = re.compile("<.*?>")
|
62 |
return re.sub(clean, "", text)
|
|
|
53 |
return result_ai_message.content
|
54 |
|
55 |
|
|
|
|
|
|
|
|
|
56 |
def remove_html_tags(text: str) -> str:
|
57 |
clean = re.compile("<.*?>")
|
58 |
return re.sub(clean, "", text)
|