🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
fix truncate.
刘棒棒05ae935d8cfa
diff --git a/metagpt/actions/execute_code.py b/metagpt/actions/execute_code.pyindex 1d20bf3f6..36e01ed0e 100644--- a/metagpt/actions/execute_code.py+++ b/metagpt/actions/execute_code.py@@ -186,14 +186,13 @@ class ExecutePyCode(ExecuteCode, Action):def truncate(result: str, keep_len: int = 2000) -> str:desc = f"Truncated to show only the last {keep_len} characters\n"if result.startswith(desc):- result = result[-len(desc) :]+ result = result[len(desc) :]if len(result) > keep_len:result = result[-keep_len:]-- if not result.startswith(desc):return desc + result- return desc++ return resultdef remove_escape_and_color_codes(input_str):