File size: 1,538 Bytes
9c84f9d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
from typing import Any

from solar_eval.models.base import CustomBaseModel
from solar_eval.models.enums import RunStatus


class RunCreate(CustomBaseModel):
    task: str
    prompt_id: str
    config: dict[str, Any] | None = None  # workers, delay, etc.


class RunResponse(CustomBaseModel):
    id: str
    project_id: str
    task: str
    prompt_id: str
    status: RunStatus
    total_samples: int
    completed_samples: int
    config: dict[str, Any] | None = None
    started_at: str | None = None
    completed_at: str | None = None
    created_at: str


class RunResultResponse(CustomBaseModel):
    id: str
    run_id: str
    sample_idx: int
    input: dict[str, Any]
    output: str
    golden: Any
    input_tokens: int
    output_tokens: int
    inference_time_ms: float


class EvaluationResponse(CustomBaseModel):
    id: str
    run_id: str
    scores: dict[str, float]
    overall_score: float
    eval_model: str
    evaluated_at: str


class EvalDetailResponse(CustomBaseModel):
    id: str
    evaluation_id: str
    sample_idx: int
    category_scores: dict[str, float] | None = None
    error_counts: dict[str, int] | None = None
    severity: str | None = None
    feedback: str | None = None


class DashboardResponse(CustomBaseModel):
    project_id: str
    task: str
    runs: list[dict[str, Any]]  # [{run_id, prompt_version, model, overall_score, date}]


class TrendResponse(CustomBaseModel):
    project_id: str
    task: str
    data_points: list[dict[str, Any]]  # [{date, score, prompt_version, model}]