Skip to content

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

minor update

yzlin7aa89a320464
diff --git a/metagpt/roles/code_interpreter.py b/metagpt/roles/code_interpreter.py
index 026fec562..d1136a1d4 100644
--- a/metagpt/roles/code_interpreter.py
+++ b/metagpt/roles/code_interpreter.py
@@ -79,7 +79,11 @@ class CodeInterpreter(Role):
if ReviewConst.CHANGE_WORD[0] in review:
counter = 0 # redo the task again with help of human suggestions
- return code["code"] if code.get("language") != "markdown" else "", result, success
+ py_code = (
+ code["code"] if code.get("language") != "markdown" else ""
+ ) # use python code as final code; for markdown, return the rendered result instead of the code itself
+
+ return py_code, result, success
async def _write_code(self):
todo = WriteCodeByGenerate() if not self.use_tools else WriteCodeWithTools(selected_tools=self.tools)