mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-17 15:35:21 +02:00
fix
This commit is contained in:
parent
ba7897a2ab
commit
33fb645d5d
4 changed files with 13 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -128,6 +128,7 @@ class AgentMemory(Memory):
|
|||
"""
|
||||
将MemoryBasic类存储为Nodes.json形式。复现GA中的Kw Strength.json形式
|
||||
这里添加一个路径即可
|
||||
TODO 这里需要添加Const常量
|
||||
"""
|
||||
|
||||
memory_json = dict()
|
||||
|
|
|
|||
8
examples/st_game/tests/test_reflect.py
Normal file
8
examples/st_game/tests/test_reflect.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
from metagpt.logs import logger
|
||||
from examples.st_game.memory.agent_memory import AgentMemory, BasicMemory
|
||||
|
||||
"""
|
||||
测试思路
|
||||
1.
|
||||
"""
|
||||
Loading…
Add table
Add a link
Reference in a new issue