Update relationship_manager.py

This commit is contained in:
SengokuCola
2025-06-03 18:27:05 +08:00
parent c1b8ec8912
commit 51f5e610d7

View File

@@ -6,7 +6,7 @@ import time
import random import random
from src.llm_models.utils_model import LLMRequest from src.llm_models.utils_model import LLMRequest
from src.config.config import global_config from src.config.config import global_config
from src.chat.utils.chat_message_builder import get_raw_msg_by_timestamp_with_chat_users from src.chat.utils.chat_message_builder import get_raw_msg_by_timestamp_with_chat
from src.chat.utils.chat_message_builder import build_readable_messages from src.chat.utils.chat_message_builder import build_readable_messages
from src.manager.mood_manager import mood_manager from src.manager.mood_manager import mood_manager
from src.individuality.individuality import individuality from src.individuality.individuality import individuality
@@ -300,20 +300,38 @@ class RelationshipManager:
# logger.debug(f"更新印象的person_id: {person_id}, chat_id: {chat_id}, reason: {reason}, timestamp: {timestamp}, user_id: {user_id}") # logger.debug(f"更新印象的person_id: {person_id}, chat_id: {chat_id}, reason: {reason}, timestamp: {timestamp}, user_id: {user_id}")
# 获取时间戳前后的消息 # 获取时间戳前后的消息
messages_before = get_raw_msg_by_timestamp_with_chat_users( # messages_before = get_raw_msg_by_timestamp_with_chat_users(
# chat_id=chat_id,
# timestamp_start=timestamp - 600, # 前10分钟
# timestamp_end=timestamp,
# person_ids=[user_id],
# limit=200,
# limit_mode="latest"
# )
# messages_after = get_raw_msg_by_timestamp_with_chat_users(
# chat_id=chat_id,
# timestamp_start=timestamp,
# timestamp_end=timestamp + 600, # 后10分钟
# person_ids=[user_id],
# limit=200,
# limit_mode="earliest"
# )
messages_before = get_raw_msg_by_timestamp_with_chat(
chat_id=chat_id, chat_id=chat_id,
timestamp_start=timestamp - 600, # 前10分钟 timestamp_start=timestamp - 600, # 前10分钟
timestamp_end=timestamp, timestamp_end=timestamp,
person_ids=[user_id], # person_ids=[user_id],
limit=200, limit=200,
limit_mode="latest" limit_mode="latest"
) )
messages_after = get_raw_msg_by_timestamp_with_chat_users( messages_after = get_raw_msg_by_timestamp_with_chat(
chat_id=chat_id, chat_id=chat_id,
timestamp_start=timestamp, timestamp_start=timestamp,
timestamp_end=timestamp + 600, # 后10分钟 timestamp_end=timestamp + 600, # 后10分钟
person_ids=[user_id], # person_ids=[user_id],
limit=200, limit=200,
limit_mode="earliest" limit_mode="earliest"
) )