Skip to content

SWE-agent takes a GitHub issue and tries to automatically fix it, using your LM of choice. It can also be employed for offensive cybersecurity or competitive coding challenges. [NeurIPS 2024]

Doc: Document DefaultAgentConfig; remove cruft (#918)

Kilian Lieret8ed382c1af1a
diff --git a/docs/reference/agent_config.md b/docs/reference/agent_config.md
index 66e5df61..4f6e804b 100644
--- a/docs/reference/agent_config.md
+++ b/docs/reference/agent_config.md
@@ -13,6 +13,11 @@ It might be easiest to simply look at some of our example configurations in the
```
</details>
-::: sweagent.agent.agents.AgentConfig
+Currently, there are two main agent classes:
-::: sweagent.agent.agents.RetryAgentConfig
\ No newline at end of file
+* `DefaultAgentConfig`: This is the default agent.
+* `RetryAgentConfig`: A "meta agent" that instantiates multiple agents for multiple attempts and then picks the best solution.
+
+::: sweagent.agent.agents.RetryAgentConfig
+
+::: sweagent.agent.agents.DefaultAgentConfig
\ No newline at end of file
diff --git a/sweagent/agent/README.md b/sweagent/agent/README.md
deleted file mode 100644
index fed45913..00000000
--- a/sweagent/agent/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-# Agents
-The `agent` folder contains the logic for handling model inference and facilitating their interaction with `SWEEnv`.
-The following documentation describing the purpose and classes of each file.
-
-#### `agents.py`
-This file defines the `Agent` class, which facilitates the interaction between an agent and the environment. The `AgentConfig` and `AgentArguments` data classes compile all arguments into a single file.
-- `Agent`: Main class for handling model behavior + interaction with environment
- - `__init__`: Sets up model, assistant, configurations, and arguments
- - `state_command`: Getter for bash command for extracting env. state
- - `setup`: Resets cost stats, initializes system message (+ demonstrations), and returns full list of bash commands to define within environment.
- - `forward`: Main inference call to model.
- - `forward_model`: Determines appropriate observation template, then makes inference call to model
- - `forward_with_format_check`: Invokes `forward_model`, with retry calls to handle blocked or malformed actions.
- - `forward_with_error_check`: Wraps `forward_with_format_check` with exception handling.
-
-#### `commands.py`
-This file defines the abstraction for custom commands (non-native functions that are implemented in bash) that agents can invoke in `swe-agent` environment. On top of the abstraction, helper functions to extract commands' documentation and compile `.sh` files into separate `Command` objects are provided. There are also fields for establishing the input/output of each action and control flow of actions via templates.
-- `AssistantMetadata`: Defines templates for formatting input/output to sub-assistant calls
-- `Command`: Defines fields of a custom command
-- `ControlMetadata` (WIP): Defines template fields that format the observations for the next agent `forward` inference call
-- `generate_command_docs`: Extracts docstrings from each command to form comprehensive documentation.
-- `parse_command_file`: Converts bash file content to separate `Command` objects
-
-#### `models.py`
-This file defines the abstraction for running inference on API models. In addition, the `BaseModel` abstraction also defines a set of cost-related fields for tracking instance-level and total expenses accumulated across a single model run.
-- `AnthropicModel`: Handles inference + cost logging for Anthropic Models
-- `BedrockModel`: handles inference + cost logging for Amazon Bedrock-provided models (Anthropic Claude only)
-- `APIStats`: Cost tracking fields that are updated per model inference
-- `BaseModel`: Abstract class that defines the common logic for updating cost stats
-- `get_model`: Returns initialized `[Anthropic|Bedrock|Human|OpenAI]Model` based on given arguments + commands
-- `HumanModel`: Handles inference for human task worker
-- `ModelArguments`: Model name, hyperparameter, and cost limit arguments
-- `OpenAIModel`: Handles inference + cost logging for OpenAI models
-
-#### `parsing.py`
-This file defines the abstraction for parsing the output of the model inference. The `Parsing` class is used to extract the relevant information from the model's output and format it into a response that can be used by the `Agent` class.
-- `Parsing`: Abstract class that defines the common logic for parsing model output
-
-#### `history_processors.py`
-This file defines the abstraction for processing the history of the environment. The `HistoryProcessor` class is used to extract the relevant information from the history of the environment and format it into a response that can be used by the `Agent` class.
-- `HistoryProcessor`: Abstract class that defines the common logic for processing the history of the environment
-- `DefaultHistoryProcessor`: Default implementation of `HistoryProcessor` that processes the history of the environment
-
-### Environment Usage
-* To skip over a task instance, use the `skip` keyword
-* To submit for evaluation, use the `submit` keyword
-* To exit the `SWEEnv` environment, perform a keyboard interrupt (`^ c`)
\ No newline at end of file