🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
feat: parse class view
莘权 马9d080e22d6c2
diff --cc .gitignoreindex 350df1514,6dd3608f1..c10191dcc--- a/.gitignore+++ b/.gitignore@@@ -171,6 -172,6 +172,8 @@@ tests/metagpt/utils/file_repo_gi*.pnghtmlcovhtmlcov.*+*.dot*.pkl+ *-structure.csv+ *-structure.json+diff --cc metagpt/repo_parser.pyindex 465f40d63,5e4d67940..9863a29ae--- a/metagpt/repo_parser.py+++ b/metagpt/repo_parser.py@@@ -12,16 -12,14 +12,14 @@@ import jsoimport reimport subprocessfrom pathlib import Path- from pprint import pformat-from typing import Dict, List, Optional, Tuple+from typing import Dict, List, Optional-import aiofilesimport pandas as pdfrom pydantic import BaseModel, Field- from metagpt.config import CONFIG+from metagpt.const import AGGREGATION, COMPOSITION, GENERALIZATIONfrom metagpt.logs import logger-from metagpt.utils.common import any_to_str+from metagpt.utils.common import any_to_str, areadfrom metagpt.utils.exceptions import handle_exception@@@ -117,11 -107,10 +115,12 @@@ class RepoParser(BaseModel)self.generate_json_structure(output_path)elif mode == "csv":self.generate_dataframe_structure(output_path)+ return output_path@staticmethod- def node_to_str(node) -> (int, int, str, str | Tuple):+ def node_to_str(node) -> CodeBlockInfo | None:+ if isinstance(node, ast.Try):+ return Noneif any_to_str(node) == any_to_str(ast.Expr):return CodeBlockInfo(lineno=node.lineno,diff --cc tests/conftest.pyindex 4caecc8ee,1f4a73030..419ac7d0c--- a/tests/conftest.py+++ b/tests/conftest.py@@@ -7,10 -7,11 +7,12 @@@"""import asyncio+ import jsonimport logging+ import osimport re+import uuid- from unittest.mock import Mock+ from typing import Optionalimport pytest