diff --git a/config/config.yaml b/config/config.yaml index 444f55efd..a13068639 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -7,7 +7,7 @@ ## Or, you can configure OPENAI_PROXY to access official OPENAI_API_BASE. OPENAI_API_BASE: "https://api.openai.com/v1" #OPENAI_PROXY: "http://127.0.0.1:8118" -#OPENAI_API_KEY: "YOUR_API_KEY" +OPENAI_API_KEY: "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" OPENAI_API_MODEL: "gpt-4" MAX_TOKENS: 1500 RPM: 10 diff --git a/examples/st_game/actions/run_reflect_action.py b/examples/st_game/actions/run_reflect_action.py index 4f53e5647..40bb54d7b 100644 --- a/examples/st_game/actions/run_reflect_action.py +++ b/examples/st_game/actions/run_reflect_action.py @@ -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 diff --git a/examples/st_game/memory/agent_memory.py b/examples/st_game/memory/agent_memory.py index 5c23c9e24..1db2566f6 100644 --- a/examples/st_game/memory/agent_memory.py +++ b/examples/st_game/memory/agent_memory.py @@ -128,6 +128,7 @@ class AgentMemory(Memory): """ 将MemoryBasic类存储为Nodes.json形式。复现GA中的Kw Strength.json形式 这里添加一个路径即可 + TODO 这里需要添加Const常量 """ memory_json = dict() diff --git a/examples/st_game/tests/test_reflect.py b/examples/st_game/tests/test_reflect.py new file mode 100644 index 000000000..54544f051 --- /dev/null +++ b/examples/st_game/tests/test_reflect.py @@ -0,0 +1,8 @@ + +from metagpt.logs import logger +from examples.st_game.memory.agent_memory import AgentMemory, BasicMemory + +""" +测试思路 +1. +""" \ No newline at end of file