revert sweagent to use bash

This commit is contained in:
garylin2099 2024-09-05 19:16:39 +08:00
parent 33ac8c5109
commit 42544806bd

View file

@ -11,7 +11,7 @@ from metagpt.prompts.di.swe_agent import (
from metagpt.roles.di.role_zero import RoleZero
from metagpt.schema import Message
from metagpt.tools.libs.git import git_create_pull
from metagpt.tools.libs.terminal import Terminal
from metagpt.tools.libs.terminal import Bash
class SWEAgent(RoleZero):
@ -19,8 +19,13 @@ class SWEAgent(RoleZero):
profile: str = "Issue Solver"
goal: str = "Resolve GitHub issue or bug in any existing codebase"
_instruction: str = NEXT_STEP_TEMPLATE
tools: list[str] = ["Browser:goto,scroll", "RoleZero", "git_create_pull", "Editor", "Terminal"]
terminal: Terminal = Field(default_factory=Terminal, exclude=True)
tools: list[str] = [
"Bash",
"Browser:goto,scroll",
"RoleZero",
"git_create_pull",
]
terminal: Bash = Field(default_factory=Bash, exclude=True)
output_diff: str = ""
max_react_loop: int = 40
run_eval: bool = False
@ -33,6 +38,7 @@ class SWEAgent(RoleZero):
def _update_tool_execution(self):
self.tool_execution_map.update(
{
"Bash.run": self.terminal.run,
"git_create_pull": git_create_pull,
}
)