Spaces:
Runtime error
Runtime error
Download src/agents/base.py from mickey1976/cove-api: direct link, hf CLI and curl.
- Browser
- Download file 547 Bytes
-
https://huggingface.co/spaces/mickey1976/cove-api/resolve/main/src/agents/base.py
- Command line
-
hf download hf://spaces/mickey1976/cove-api/src/agents/base.py
-
curl -L -o base.py https://huggingface.co/spaces/mickey1976/cove-api/resolve/main/src/agents/base.py
547 Bytes
| from abc import ABC, abstractmethod | |
| from typing import Dict, Any | |
| from .types import Task, StepResult | |
| class BaseAgent(ABC): | |
| name: str = "base" | |
| def run(self, task: Task) -> StepResult: | |
| ... | |
| def ok(self, detail: str = "", **artifacts) -> StepResult: | |
| return StepResult(name=self.name, status="succeeded", detail=detail, artifacts=artifacts) | |
| def fail(self, detail: str = "", **artifacts) -> StepResult: | |
| return StepResult(name=self.name, status="failed", detail=detail, artifacts=artifacts) |