Idiomatic REST API: Evals (#782)

# What does this PR do?

Changes Evals API to follow more idiomatic REST


## Test Plan

TBD, once i get an approval for rest endpoints
This commit is contained in:
Dinesh Yeduguru 2025-01-16 11:02:42 -08:00 committed by GitHub
parent 678ab29129
commit 8d30ecb91a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -74,14 +74,14 @@ class EvaluateResponse(BaseModel):
class Eval(Protocol):
@webmethod(route="/eval/run", method="POST")
@webmethod(route="/eval/tasks/{task_id}/jobs", method="POST")
async def run_eval(
self,
task_id: str,
task_config: EvalTaskConfig,
) -> Job: ...
@webmethod(route="/eval/evaluate-rows", method="POST")
@webmethod(route="/eval/tasks/{task_id}/evaluations", method="POST")
async def evaluate_rows(
self,
task_id: str,
@ -90,11 +90,11 @@ class Eval(Protocol):
task_config: EvalTaskConfig,
) -> EvaluateResponse: ...
@webmethod(route="/eval/jobs/{job_id}", method="GET")
async def job_status(self, job_id: str, task_id: str) -> Optional[JobStatus]: ...
@webmethod(route="/eval/tasks/{task_id}/jobs/{job_id}", method="GET")
async def job_status(self, task_id: str, job_id: str) -> Optional[JobStatus]: ...
@webmethod(route="/eval/jobs/cancel", method="POST")
async def job_cancel(self, job_id: str, task_id: str) -> None: ...
@webmethod(route="/eval/tasks/{task_id}/jobs/{job_id}", method="DELETE")
async def job_cancel(self, task_id: str, job_id: str) -> None: ...
@webmethod(route="/eval/jobs/{job_id}/result", method="GET")
@webmethod(route="/eval/tasks/{task_id}/jobs/{job_id}/result", method="GET")
async def job_result(self, job_id: str, task_id: str) -> EvaluateResponse: ...