-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: +Reverse engineering related logic #800
Conversation
feat: +retry
fixbug: method type, feat: add compotition&aggregation
fixbug: IndexableDocument.from_path error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- should tests/data/graph_db/networkx.json be ignored?
- could you provide some readme or comments for the files?
- how to use the results as context, any design here?
- could we use vector search to search the symbols?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe here can be some docs/flows to better understand the logic inside actions.
And some docstring or example can be provided.
feat: ver+
fixbug: llm not answering the question
fixbug: add METAGPT model calc usage logic
fixbug: METAGPT model is None
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The generated annotations do not actually reduce the cost of reading, but in a sense increase the cost of reading
- Lack of tests and examples makes it difficult to understand if a feature is appropriate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Overall, there are a lot of useless comments generated and need to be cleared.
- There needs to be a clear design document explaining how to use it.
from metagpt.utils.di_graph_repository import DiGraphRepository | ||
from metagpt.utils.graph_repository import GraphKeyword, GraphRepository | ||
|
||
|
||
class RebuildClassView(Action): | ||
""" | ||
Reconstructs a graph repository about class diagram from a source code project. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need more explicit functional description and design. Its function description is vague. The run interface has no real input parameters, and all input and output parameters are implicit.
Reconstructs a graph repository about class diagram from a source code project. | ||
|
||
Attributes: | ||
graph_db (Optional[GraphRepository]): The optional graph repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a simple duplication of variables, and since this class is actually pydantic.BaseModel, I don't think the annotation here is needed and should be explained by the fields themselves.
async def run(self, with_messages=None, format=config.prompt_schema): | ||
""" | ||
Implementation of `Action`'s `run` method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Class
is not a current specification and is recommended to be removed
Implementation of `Action`'s `run` method. | ||
|
||
Args: | ||
with_messages (Optional[Type]): An optional argument specifying messages to react to. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This value requires appropriate type annotation and comments, rather than LLM generating text with no additional information
# - gpt-4-turbo-vision: "gpt-4-vision-preview" | ||
# - gpt-4 8k: "gpt-4" | ||
# See for more: https://azure.microsoft.com/en-us/pricing/details/cognitive-services/openai-service/ | ||
# pricing_plan: "gpt-4-turbo-preview" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It requires very clear annotations to explain its use and scenarios to reduce the cost of understanding.
None | ||
|
||
Raises: | ||
SomeException: Describe any exceptions that might be raised during the saving process. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These comments, if they have no actual meaning, should be deleted. Please check other sections
Note: | ||
The JSON file should contain node-link data compatible with the format produced by the 'json' method. | ||
|
||
""" | ||
data = await aread(filename=pathname, encoding="utf-8") | ||
m = json.loads(data) | ||
self._repo = networkx.node_link_graph(m) | ||
|
||
@staticmethod | ||
async def load_from(pathname: str | Path) -> GraphRepository: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally speaking, this is more appropriately named from_json_file
# Retrieves the root directory path for the graph repository files. | ||
|
||
Note: | ||
This property provides the directory path where graph repository files are saved or loaded. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
251-263 seems to be reduced to one or three lines.
Note: | ||
This property provides the full path, including the filename, to the graph repository file. | ||
|
||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
268-280 seems to be reduced to one or three lines.
Note: | ||
This property provides direct access to the networkx.DiGraph instance used by the graph repository. | ||
|
||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
285-298 seems to be reduced to one or three lines.
Features