This commit is contained in:
Xi Yan 2024-11-07 18:15:13 -08:00
commit 33b6d9b7b7
8 changed files with 67 additions and 304 deletions

View file

@ -74,36 +74,27 @@ class EvaluateResponse(BaseModel):
class Eval(Protocol):
@webmethod(route="/eval/run_benchmark", method="POST")
async def run_benchmark(
self,
benchmark_id: str,
benchmark_config: BenchmarkEvalTaskConfig,
) -> Job: ...
@webmethod(route="/eval/run_eval", method="POST")
async def run_eval(
self,
task: EvalTaskDef,
task_config: AppEvalTaskConfig,
task_id: str,
task_config: EvalTaskConfig,
) -> Job: ...
@webmethod(route="/eval/evaluate_rows", method="POST")
async def evaluate_rows(
self,
task_id: str,
input_rows: List[Dict[str, Any]],
scoring_functions: List[str],
task_config: EvalTaskConfig,
eval_task_id: Optional[str] = None,
) -> EvaluateResponse: ...
@webmethod(route="/eval/job/status", method="GET")
async def job_status(
self, job_id: str, eval_task_id: str
) -> Optional[JobStatus]: ...
async def job_status(self, task_id: str, job_id: str) -> Optional[JobStatus]: ...
@webmethod(route="/eval/job/cancel", method="POST")
async def job_cancel(self, job_id: str, eval_task_id: str) -> None: ...
async def job_cancel(self, task_id: str, job_id: str) -> None: ...
@webmethod(route="/eval/job/result", method="GET")
async def job_result(self, job_id: str, eval_task_id: str) -> EvaluateResponse: ...
async def job_result(self, task_id: str, job_id: str) -> EvaluateResponse: ...

View file

@ -48,7 +48,7 @@ class Scoring(Protocol):
async def score_batch(
self,
dataset_id: str,
scoring_functions: Optional[Dict[str, ScoringFnParams]] = None,
scoring_functions: Dict[str, Optional[ScoringFnParams]] = None,
save_results_dataset: bool = False,
) -> ScoreBatchResponse: ...
@ -56,5 +56,5 @@ class Scoring(Protocol):
async def score(
self,
input_rows: List[Dict[str, Any]],
scoring_functions: Optional[Dict[str, ScoringFnParams]] = None,
scoring_functions: Dict[str, Optional[ScoringFnParams]] = None,
) -> ScoreResponse: ...