Closed
Conversation
garylin2099
reviewed
Mar 3, 2025
| def _get_file_path(self, id): | ||
| return os.path.join(self.root_path, f"round_{id}") | ||
|
|
||
| def select_node(self, k=3): |
Collaborator
There was a problem hiding this comment.
search module should take care of node selection
garylin2099
reviewed
Mar 14, 2025
| @@ -0,0 +1,558 @@ | |||
| { | |||
Collaborator
There was a problem hiding this comment.
execution output should not be committed
metagpt/ext/opt_code/memory/tree.py
Outdated
| pass | ||
|
|
||
| @abstractmethod | ||
| def select(self) -> TreeNode: |
Collaborator
There was a problem hiding this comment.
select method should belong to search algorithm?
Move 'select' to search module, and fix some directory bugs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Features
Feature Docs
python -m metagpt.ext.opt_code.main运行Update 03.21
更新内容:
MetaAgent负责控制整个流程,为了将 Agent 划分成搜索过程中的独立主体,整个搜索逻辑如下:search_algorithm/tree_search.py中的TreeSearch类派生出AFlowSearch和SelaSearch,子类中主要实现select、_prepare、_expand、_update_global_context四种方法,其中_prepare为 Agent 提供被实验的节点和上下文信息。只变动父类的select_with_strategy方法可以实现简单的搜索策略的变更。memory/tree.py中的TreeNode类派生出AFlowNode和SelaNode,子类中主要实现update_from_child、update_from_results(从 Agent 输出结果更新节点)、extend_child(针对 SELA,先有 action 后再 expand 节点)方法。Tree类派生出的AFlowMemory和SelaMemory只需要实现init_root_node方法即可。opt_roles/experimenter.py中的Experimenter类派生出AFlowRole和SelaRole,前者用ActionNode实现代码的生成,而后者利用DataInterpreter进行多步决策来生成完整的 notebook 代码,二者逻辑很难统一。需要补充的内容:
Evaluator类负责。