Spaces:
Runtime error
Runtime error
File size: 547 Bytes
549c270 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | from abc import ABC, abstractmethod
from typing import Dict, Any
from .types import Task, StepResult
class BaseAgent(ABC):
name: str = "base"
@abstractmethod
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) |