better:优化小问题

This commit is contained in:
SengokuCola
2025-05-12 21:55:31 +08:00
parent 65fab13f4f
commit 0985e0fc65
5 changed files with 33 additions and 83 deletions

View File

@@ -73,8 +73,10 @@ class HFCloopObservation:
last_loop = self.history_loop[-1]
start_time = last_loop.start_time
end_time = last_loop.end_time
time_diff = int(end_time - start_time)
cycle_info_block += f"\n距离你上一次阅读消息已经过去了{time_diff}分钟\n"
if start_time is not None and end_time is not None:
time_diff = int(end_time - start_time)
cycle_info_block += f"\n距离你上一次阅读消息已经过去了{time_diff}分钟\n"
else:
cycle_info_block += "\n无法获取上一次阅读消息的时间\n"
self.observe_info = cycle_info_block

View File

@@ -44,8 +44,6 @@ class MemoryObservation(Observation):
if related_memory:
for topic, memory in related_memory:
new_item = {"type": "memory", "id": topic, "content": memory, "ttl": 3}
self.structured_info.append(new_item)
# 将记忆添加到 running_memory
self.running_memory.append(
{"topic": topic, "content": memory, "timestamp": datetime.now().isoformat()}