mbochniak01
Add typed client library, unit + integration tests, mypy, ruff, NOTES.md
10aced5
raw
history blame contribute delete
701 Bytes
from pydantic import BaseModel, Field
class QueryRequest(BaseModel):
query: str
client: str
class MetricResult(BaseModel):
passed: bool
score: float = Field(ge=0.0, le=1.0)
detail: str
class EvaluationResult(BaseModel):
overall_pass: bool
metrics: dict[str, MetricResult]
class Source(BaseModel):
id: str
title: str
score: float = Field(ge=0.0, le=1.0)
class QueryResponse(BaseModel):
query: str
client: str
client_display: str
answer: str
sources: list[Source]
evaluation: EvaluationResult
class ClientInfo(BaseModel):
id: str
display: str
class ConfigResponse(BaseModel):
domains: dict[str, list[ClientInfo]]