Download adapters/base.py from smlflg/AgentArena: direct link, hf CLI and curl.
- Browser
- Download file 1.27 kB
-
https://huggingface.co/smlflg/AgentArena/resolve/main/adapters/base.py
- Command line
-
hf download hf://smlflg/AgentArena/adapters/base.py
-
curl -L -o base.py https://huggingface.co/smlflg/AgentArena/resolve/main/adapters/base.py
1.27 kB
| from abc import ABC, abstractmethod | |
| from dataclasses import dataclass, field | |
| from models import RunStatus | |
| class RunContext: | |
| work_dir: str # path inside container | |
| task_prompt: str # full task description for the agent | |
| success_cmd: str # command to verify success | |
| time_limit_s: int = 300 | |
| token_limit: int = 200000 | |
| repo_url: str = "" # repo URL for host-side adapters (e.g. ClaudeCode) | |
| repo_ref: str = "main" # git branch/tag to clone | |
| class RunResult: | |
| status: RunStatus | |
| duration_s: float = 0.0 | |
| tokens_input: int = 0 | |
| tokens_output: int = 0 | |
| cost_usd: float = 0.0 | |
| tests_total: int = 0 | |
| tests_passed: int = 0 | |
| diff_text: str = "" | |
| trajectory: list = field(default_factory=list) | |
| errors_count: int = 0 | |
| tool_calls: int = 0 | |
| raw_output: str = "" | |
| class AgentAdapter(ABC): | |
| def __init__(self, config: dict = None): | |
| self.config = config or {} | |
| def name(self) -> str: ... | |
| async def run(self, ctx: RunContext, sandbox) -> RunResult: | |
| """Run the agent in the given sandbox. sandbox is a core.sandbox.Sandbox instance.""" | |
| ... | |
| def is_available(self) -> bool: ... | |