add sweagent to env

This commit is contained in:
garylin2099 2024-07-04 17:33:55 +08:00
parent caaf42987d
commit 715e25f9b1
2 changed files with 6 additions and 2 deletions

View file

@ -4,14 +4,13 @@ import os
from pydantic import Field
from metagpt.logs import logger
from metagpt.prompts.di.swe import (
from metagpt.prompts.di.swe_agent import (
MINIMAL_EXAMPLE,
NEXT_STEP_TEMPLATE,
SWE_AGENT_SYSTEM_TEMPLATE,
)
from metagpt.roles.di.role_zero import RoleZero
from metagpt.tools.libs.terminal import Bash
from metagpt.tools.swe_agent_commands.swe_agent_utils import extract_patch
class SWEAgent(RoleZero):
@ -72,6 +71,9 @@ class SWEAgent(RoleZero):
This function is specifically added for SWE bench evaluation.
"""
# only import when evaluation is needed
from metagpt.tools.swe_agent_commands.swe_agent_utils import extract_patch
commands, ok = await self._parse_commands()
if not ok:
return