Skip to content

🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming

Merge branch 'dev' of github.com:better629/MetaGPT into dev

better6293c07bf5622e1
diff --cc metagpt/actions/run_code.py
index 5b9e26fa9,d22aa47ce..010cab4a8
--- a/metagpt/actions/run_code.py
+++ b/metagpt/actions/run_code.py
@@@ -79,14 -79,16 +79,16 @@@ standard errors
class RunCode(Action):
name: str = "RunCode"
context: RunCodeContext = Field(default_factory=RunCodeContext)
- llm: BaseLLM = Field(default_factory=LLM)
+ llm: BaseLLM = Field(default_factory=LLM, exclude=True)
@classmethod
- @handle_exception
async def run_text(cls, code) -> Tuple[str, str]:
- # We will document_store the result in this dictionary
- namespace = {}
- exec(code, namespace)
+ try:
+ # We will document_store the result in this dictionary
+ namespace = {}
+ exec(code, namespace)
+ except Exception as e:
+ return "", str(e)
return namespace.get("result", ""), ""
@classmethod
diff --cc metagpt/actions/write_prd.py
index 17b5573ae,8e4229991..df9b7549b
--- a/metagpt/actions/write_prd.py
+++ b/metagpt/actions/write_prd.py
@@@ -66,9 -66,9 +66,9 @@@ NEW_REQ_TEMPLATE = ""
class WritePRD(Action):
- name: str = ""
+ name: str = "WritePRD"
content: Optional[str] = None
- llm: BaseLLM = Field(default_factory=LLM)
+ llm: BaseLLM = Field(default_factory=LLM, exclude=True)
async def run(self, with_messages, schema=CONFIG.prompt_schema, *args, **kwargs) -> ActionOutput | Message:
# Determine which requirement documents need to be rewritten: Use LLM to assess whether new requirements are