From ade33911702604d823afea84b07d78ccf2a716bb Mon Sep 17 00:00:00 2001 From: Xi Yan Date: Mon, 17 Mar 2025 17:12:28 -0700 Subject: [PATCH] revert job related --- llama_stack/apis/common/job_types.py | 14 ++++++-------- llama_stack/apis/eval/eval.py | 8 +++++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/llama_stack/apis/common/job_types.py b/llama_stack/apis/common/job_types.py index e27f19493..57775754b 100644 --- a/llama_stack/apis/common/job_types.py +++ b/llama_stack/apis/common/job_types.py @@ -12,6 +12,12 @@ from pydantic import BaseModel from llama_stack.schema_utils import json_schema_type +@json_schema_type +class Job(BaseModel): + # NOTE: this will be DEPRECATED in favour of CommonJobFields + job_id: str + + class JobType(Enum): batch_inference = "batch_inference" evaluation = "evaluation" @@ -26,14 +32,6 @@ class JobStatus(Enum): cancelled = "cancelled" -class JobArtifact(BaseModel): - """ - A job artifact is a file or directory that is produced by a job. - """ - - path: str - - @json_schema_type class CommonJobFields(BaseModel): """Common fields for all jobs. diff --git a/llama_stack/apis/eval/eval.py b/llama_stack/apis/eval/eval.py index 9bcb118cc..e215a41c1 100644 --- a/llama_stack/apis/eval/eval.py +++ b/llama_stack/apis/eval/eval.py @@ -10,7 +10,7 @@ from pydantic import BaseModel, Field from typing_extensions import Annotated from llama_stack.apis.agents import AgentConfig -from llama_stack.apis.common.job_types import CommonJobFields, JobStatus +from llama_stack.apis.common.job_types import Job, JobStatus from llama_stack.apis.inference import SamplingParams, SystemMessage from llama_stack.apis.scoring import ScoringResult from llama_stack.apis.scoring_functions import ScoringFnParams @@ -91,7 +91,7 @@ class Eval(Protocol): self, benchmark_id: str, benchmark_config: BenchmarkConfig, - ) -> CommonJobFields: + ) -> Job: """Run an evaluation on a benchmark. :param benchmark_id: The ID of the benchmark to run the evaluation on. @@ -135,7 +135,9 @@ class Eval(Protocol): """ ... - @webmethod(route="/eval/benchmarks/{benchmark_id}/jobs/{job_id}/result", method="GET") + @webmethod( + route="/eval/benchmarks/{benchmark_id}/jobs/{job_id}/result", method="GET" + ) async def job_result(self, benchmark_id: str, job_id: str) -> EvaluateResponse: """Get the result of a job.