-
Notifications
You must be signed in to change notification settings - Fork 185
Expand file tree
/
Copy pathmeta_agent.py
More file actions
18 lines (14 loc) · 844 Bytes
/
meta_agent.py
File metadata and controls
18 lines (14 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Copyright (c) Meta Platforms, Inc. and affiliates.
from agent.base_agent import AgentSystem
from agent.llm_withtools import chat_with_agent
class MetaAgent(AgentSystem):
def forward(self, repo_path, eval_path, iterations_left=None):
"""
A meta agent that recursively self-improves.
Args:
repo_path (str): The path to the repository.
eval_path (str): The path to previously generated agents and their evaluation results.
iterations_left (int, optional): The number of remaining iterations in which the meta agent will be invoked in future. Defaults to None.
"""
instruction = f"Modify any part of the codebase at `{repo_path}`."
new_msg_history = chat_with_agent(instruction, model=self.model, msg_history=[], logging=self.log, tools_available='all')