6188617037
Environment Corruption Check / test-python-versions (3.12.8) (push) Failing after 2s
Environment Corruption Check / test-python-versions (3.11.11) (push) Failing after 1s
Pre-commit checks / pre-commit-check (push) Failing after 1s
Environment Corruption Check / test-python-versions (3.13.2) (push) Failing after 4s
25 lines
771 B
Python
25 lines
771 B
Python
from typing import List
|
|
|
|
from pydantic import Field
|
|
|
|
from app.agent.toolcall import ToolCallAgent
|
|
from app.prompt.swe import SYSTEM_PROMPT
|
|
from app.tool import Bash, StrReplaceEditor, Terminate, ToolCollection
|
|
|
|
|
|
class SWEAgent(ToolCallAgent):
|
|
"""An agent that implements the SWEAgent paradigm for executing code and natural conversations."""
|
|
|
|
name: str = "swe"
|
|
description: str = "an autonomous AI programmer that interacts directly with the computer to solve tasks."
|
|
|
|
system_prompt: str = SYSTEM_PROMPT
|
|
next_step_prompt: str = ""
|
|
|
|
available_tools: ToolCollection = ToolCollection(
|
|
Bash(), StrReplaceEditor(), Terminate()
|
|
)
|
|
special_tool_names: List[str] = Field(default_factory=lambda: [Terminate().name])
|
|
|
|
max_steps: int = 20
|