From d79ed767e2a28e0fd66ab8a46659403d253a0c63 Mon Sep 17 00:00:00 2001 From: didi <2020201387@ruc.edu.cn> Date: Thu, 5 Oct 2023 01:28:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E4=BE=9D=E8=B5=96=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/st_game/memory/retrieve.py | 2 +- examples/st_game/reflect/reflect.py | 1 + examples/st_game/tests/test_agent_memory.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/st_game/memory/retrieve.py b/examples/st_game/memory/retrieve.py index ffba5dcbb..9478b1f9f 100644 --- a/examples/st_game/memory/retrieve.py +++ b/examples/st_game/memory/retrieve.py @@ -70,7 +70,7 @@ def new_agent_retrieve(role, focus_points: list, n_count=30) -> dict: for i in role.memory.storage: if i.memory_id == n: i.last_accessed = role.scratch.curr_time - final_result.append(i.content) + final_result.append(i) retrieved[focal_pt] = final_result diff --git a/examples/st_game/reflect/reflect.py b/examples/st_game/reflect/reflect.py index d32d64200..761f3d943 100644 --- a/examples/st_game/reflect/reflect.py +++ b/examples/st_game/reflect/reflect.py @@ -105,6 +105,7 @@ def run_reflect(role: "STRole"): # For each of the focal points, generate thoughts and save it in the # agent's memory. for focal_pt, nodes in retrieved.items(): + xx = [i.embedding_key for i in nodes] for xxx in xx: logger.info(xxx) diff --git a/examples/st_game/tests/test_agent_memory.py b/examples/st_game/tests/test_agent_memory.py index f487218ea..9596f97d4 100644 --- a/examples/st_game/tests/test_agent_memory.py +++ b/examples/st_game/tests/test_agent_memory.py @@ -67,7 +67,7 @@ class TestAgentMemory: for i in agent_memory.storage: if i.memory_id == n: i.last_accessed = datetime.now()-timedelta(days=120) - final_result.append(i.content) + final_result.append(i) retrieved[focal_pt] = final_result logger.info(f"检索结果为{retrieved}") \ No newline at end of file