新增mood与relation的相互反馈
This commit is contained in:
@@ -137,12 +137,13 @@ class ThinkFlowChat:
|
||||
await heartflow.get_subheartflow(stream_id).do_thinking_after_reply(response_set, chat_talking_prompt)
|
||||
|
||||
async def _update_relationship(self, message, response_set):
|
||||
"""更新关系"""
|
||||
"""更新关系情绪"""
|
||||
ori_response = ",".join(response_set)
|
||||
stance, emotion = await self.gpt._get_emotion_tags(ori_response, message.processed_plain_text)
|
||||
await relationship_manager.calculate_update_relationship_value(
|
||||
chat_stream=message.chat_stream, label=emotion, stance=stance
|
||||
)
|
||||
self.mood_manager.update_mood_from_emotion(emotion, global_config.mood_intensity_factor)
|
||||
|
||||
async def process_message(self, message_data: str) -> None:
|
||||
"""处理消息并生成回复"""
|
||||
@@ -276,11 +277,11 @@ class ThinkFlowChat:
|
||||
timer2 = time.time()
|
||||
timing_results["更新心流"] = timer2 - timer1
|
||||
|
||||
# 更新关系
|
||||
# 更新关系情绪
|
||||
timer1 = time.time()
|
||||
await self._update_relationship(message, response_set)
|
||||
timer2 = time.time()
|
||||
timing_results["更新关系"] = timer2 - timer1
|
||||
timing_results["更新关系情绪"] = timer2 - timer1
|
||||
|
||||
# 输出性能计时结果
|
||||
if do_reply:
|
||||
|
||||
Reference in New Issue
Block a user