根据提供的 git diff 分析,这是一个重构变更,主要是修改了异步内存包装器的导入和使用方式。以下是生成的常规提交消息:
refactor(prompt): 重构异步即时内存包装器的导入和使用方式 - 将 async_memory 导入更改为 get_async_instant_memory 函数 - 简化内存获取逻辑,通过工厂函数创建包装器实例 - 更新参数传递方式,使用 target 替代 sender 参数 - 减少代码行数,提高可读性
This commit is contained in:
@@ -567,7 +567,7 @@ class Prompt:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
from src.chat.memory_system.memory_activator import MemoryActivator
|
from src.chat.memory_system.memory_activator import MemoryActivator
|
||||||
from src.chat.memory_system.async_instant_memory_wrapper import async_memory
|
from src.chat.memory_system.async_instant_memory_wrapper import get_async_instant_memory
|
||||||
|
|
||||||
# 获取聊天历史
|
# 获取聊天历史
|
||||||
chat_history = ""
|
chat_history = ""
|
||||||
@@ -589,10 +589,8 @@ class Prompt:
|
|||||||
)
|
)
|
||||||
|
|
||||||
# 获取即时记忆
|
# 获取即时记忆
|
||||||
instant_memory = await async_memory.get_memory_with_fallback(
|
async_memory_wrapper = get_async_instant_memory(self.parameters.chat_id)
|
||||||
chat_id=self.parameters.chat_id,
|
instant_memory = await async_memory_wrapper.get_memory_with_fallback(self.parameters.target)
|
||||||
target_user=self.parameters.sender
|
|
||||||
)
|
|
||||||
|
|
||||||
# 构建记忆块
|
# 构建记忆块
|
||||||
memory_parts = []
|
memory_parts = []
|
||||||
|
|||||||
Reference in New Issue
Block a user