This commit is contained in:
didi 2023-10-04 01:52:16 +08:00
parent ba7897a2ab
commit 33fb645d5d
4 changed files with 13 additions and 3 deletions

View file

@ -3,6 +3,7 @@
# @Desc : Integration Reflect Action
import re
from metagpt.logs import logger
from examples.st_game.actions.st_action import STAction
@ -115,7 +116,7 @@ class AgentEventTriple(STAction):
def _func_fail_default_resp(self) -> str:
pass
def run(self, statements: str, role: STRole, verbose=False) -> str:
def run(self, statements: str, role: STRole, verbose=False) -> tuple:
def create_prompt_input(statements, role):
if "(" in statements:
statements = statements.split("(")[-1].split(")")[0]
@ -129,7 +130,7 @@ class AgentEventTriple(STAction):
"generate_event_triple_v1.txt")
output = self._run_v1(prompt)
output = (role.scratch.name,output[0],output[1])
output = (role.scratch.name, output[0], output[1])
logger.info(f"Run action: {self.__class__.__name__} with result: {output}")
return output

View file

@ -128,6 +128,7 @@ class AgentMemory(Memory):
"""
将MemoryBasic类存储为Nodes.json形式复现GA中的Kw Strength.json形式
这里添加一个路径即可
TODO 这里需要添加Const常量
"""
memory_json = dict()

View file

@ -0,0 +1,8 @@
from metagpt.logs import logger
from examples.st_game.memory.agent_memory import AgentMemory, BasicMemory
"""
测试思路
1.
"""