better:PFC 更好的对话结束
This commit is contained in:
@@ -16,6 +16,8 @@ class Waiter:
|
||||
self.chat_observer = ChatObserver.get_instance(stream_id)
|
||||
self.personality_info = Individuality.get_instance().get_prompt(type="personality", x_person=2, level=2)
|
||||
self.name = global_config.BOT_NICKNAME
|
||||
|
||||
self.wait_accumulated_time = 0
|
||||
|
||||
async def wait(self, conversation_info: ConversationInfo) -> bool:
|
||||
"""等待
|
||||
@@ -34,10 +36,12 @@ class Waiter:
|
||||
return False
|
||||
|
||||
# 检查是否超时
|
||||
if time.time() - wait_start_time > 15:
|
||||
if time.time() - wait_start_time > 300:
|
||||
self.wait_accumulated_time += 300
|
||||
|
||||
logger.info("等待超过300秒,结束对话")
|
||||
wait_goal = {
|
||||
"goal": "你等待了5分钟,思考接下来要做什么",
|
||||
"goal": f"你等待了{self.wait_accumulated_time/60}分钟,思考接下来要做什么",
|
||||
"reason": "对方很久没有回复你的消息了"
|
||||
}
|
||||
conversation_info.goal_list.append(wait_goal)
|
||||
@@ -65,10 +69,11 @@ class Waiter:
|
||||
return False
|
||||
|
||||
# 检查是否超时
|
||||
if time.time() - wait_start_time > 30:
|
||||
if time.time() - wait_start_time > 300:
|
||||
self.wait_accumulated_time += 300
|
||||
logger.info("等待超过300秒,结束对话")
|
||||
wait_goal = {
|
||||
"goal": "你等待了5分钟,思考接下来要做什么",
|
||||
"goal": f"你等待了{self.wait_accumulated_time/60}分钟,思考接下来要做什么",
|
||||
"reason": "对方话说一半消失了,很久没有回复"
|
||||
}
|
||||
conversation_info.goal_list.append(wait_goal)
|
||||
|
||||
Reference in New Issue
Block a user