Add judge_language config plumbing (settings + scenario + ScoreRequest)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -48,6 +48,15 @@ class DistributionBin(BaseModel):
|
||||
count: int
|
||||
|
||||
|
||||
class SampleHistoryEntry(BaseModel):
|
||||
"""One past evaluation of the same question, for the history comparison table."""
|
||||
|
||||
run_id: str
|
||||
scenario_name: str = ""
|
||||
finished_at: str = ""
|
||||
metrics: dict[str, float | None] = Field(default_factory=dict)
|
||||
|
||||
|
||||
class SampleScore(BaseModel):
|
||||
"""Per-sample row used for the lowest-score review table."""
|
||||
|
||||
@@ -62,6 +71,10 @@ class SampleScore(BaseModel):
|
||||
metrics: dict[str, float | None] = Field(default_factory=dict)
|
||||
mean_score: float | None = None
|
||||
error: str = ""
|
||||
history: list[SampleHistoryEntry] = Field(
|
||||
default_factory=list,
|
||||
description="同一问题在以往运行中的评分(按时间倒序),用于历史对比。",
|
||||
)
|
||||
|
||||
|
||||
class ReportData(BaseModel):
|
||||
@@ -460,6 +473,10 @@ class ScoreRequest(BaseModel):
|
||||
default=None,
|
||||
description="Embedding 模型名称;为 null 时使用 .env 中的 RAGAS_EMBEDDING_MODEL。",
|
||||
)
|
||||
judge_language: str | None = Field(
|
||||
default=None,
|
||||
description="评判 prompt 语言;'zh' 启用中文评判,为 null 时使用 RAGAS_JUDGE_LANGUAGE(默认 en)。",
|
||||
)
|
||||
|
||||
@field_validator("metrics")
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user