mirror of https://github.com/Mai-with-u/MaiBot.git
🤖 自动格式化代码 [skip ci]
parent
0dad4a1d46
commit
087f4a6cbf
|
|
@ -94,6 +94,7 @@ class RealTimeInfoProcessor(BaseProcessor):
|
||||||
)
|
)
|
||||||
|
|
||||||
from src.chat.message_receive.chat_stream import get_chat_manager
|
from src.chat.message_receive.chat_stream import get_chat_manager
|
||||||
|
|
||||||
name = get_chat_manager().get_stream_name(self.subheartflow_id)
|
name = get_chat_manager().get_stream_name(self.subheartflow_id)
|
||||||
self.log_prefix = f"[{name}] 实时信息"
|
self.log_prefix = f"[{name}] 实时信息"
|
||||||
|
|
||||||
|
|
@ -270,13 +271,15 @@ class RealTimeInfoProcessor(BaseProcessor):
|
||||||
info_type = content_json.get("info_type")
|
info_type = content_json.get("info_type")
|
||||||
if info_type:
|
if info_type:
|
||||||
# 记录信息获取请求
|
# 记录信息获取请求
|
||||||
self.info_fetching_cache.append({
|
self.info_fetching_cache.append(
|
||||||
"person_id": get_person_info_manager().get_person_id_by_person_name(sender),
|
{
|
||||||
"person_name": sender,
|
"person_id": get_person_info_manager().get_person_id_by_person_name(sender),
|
||||||
"info_type": info_type,
|
"person_name": sender,
|
||||||
"start_time": time.time(),
|
"info_type": info_type,
|
||||||
"forget": False,
|
"start_time": time.time(),
|
||||||
})
|
"forget": False,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
# 限制缓存大小
|
# 限制缓存大小
|
||||||
if len(self.info_fetching_cache) > 20:
|
if len(self.info_fetching_cache) > 20:
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
from src.chat.heart_flow.observation.chatting_observation import ChattingObservation
|
from src.chat.heart_flow.observation.chatting_observation import ChattingObservation
|
||||||
from src.chat.heart_flow.observation.observation import Observation
|
from src.chat.heart_flow.observation.observation import Observation
|
||||||
from src.llm_models.utils_model import LLMRequest
|
|
||||||
from src.config.config import global_config
|
from src.config.config import global_config
|
||||||
import time
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
|
|
@ -446,6 +445,7 @@ class RelationshipBuildProcessor(BaseProcessor):
|
||||||
segments = self.person_engaged_cache[person_id]
|
segments = self.person_engaged_cache[person_id]
|
||||||
# 异步执行关系构建
|
# 异步执行关系构建
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
asyncio.create_task(self.update_impression_on_segments(person_id, self.subheartflow_id, segments))
|
asyncio.create_task(self.update_impression_on_segments(person_id, self.subheartflow_id, segments))
|
||||||
# 移除已处理的用户缓存
|
# 移除已处理的用户缓存
|
||||||
del self.person_engaged_cache[person_id]
|
del self.person_engaged_cache[person_id]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue