关系计算函数迁移

This commit is contained in:
meng_xi_pan
2025-03-14 16:38:52 +08:00
parent aa5bc85e31
commit 6a5316bcf8
2 changed files with 71 additions and 12 deletions

View File

@@ -342,18 +342,22 @@ class ChatBot:
emotion = await self.gpt._get_emotion_tags(raw_content)
logger.debug(f"'{response}' 获取到的情感标签为:{emotion}")
valuedict = {
"happy": 0.5,
"angry": -1,
"sad": -0.5,
"surprised": 0.2,
"disgusted": -1.5,
"fearful": -0.7,
"neutral": 0.1,
}
await relationship_manager.update_relationship_value(
chat_stream=chat, relationship_value=valuedict[emotion[0]]
)
await relationship_manager.calculate_update_relationship_value(chat_stream=chat,label=emotion[0])
# emotion = await self.gpt._get_emotion_tags(raw_content)
# logger.debug(f"为 '{response}' 获取到的情感标签为:{emotion}")
# valuedict = {
# "happy": 0.5,
# "angry": -1,
# "sad": -0.5,
# "surprised": 0.2,
# "disgusted": -1.5,
# "fearful": -0.7,
# "neutral": 0.1,
# }
# await relationship_manager.update_relationship_value(
# chat_stream=chat, relationship_value=valuedict[emotion[0]]
# )
# 使用情绪管理器更新情绪
self.mood_manager.update_mood_from_emotion(emotion[0], global_config.mood_intensity_factor)