(prompt, response) pair and whose output is a score. Use int with ge and le so validated scores stay on scale.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Score model outputs against a rubric. The same machinery as labeling, applied to evaluation.
(prompt, response) pair and whose output is a score. Use int with ge and le so validated scores stay on scale.
from agno.agent import Agent
from agno.models.google import Gemini
from pydantic import BaseModel, Field
class Score(BaseModel):
overall: int = Field(
..., ge=1, le=5, description="Overall quality, 5 is excellent"
)
agent = Agent(
model=Gemini(id="gemini-3.5-flash"),
instructions=(
"Score the response on overall quality from 1 (unusable) to 5 "
"(excellent). Use the full scale. Reserve 5 for genuinely "
"excellent responses."
),
output_schema=Score,
)
def build_input(prompt: str, response: str) -> str:
return f"Prompt:\n{prompt}\n\nResponse:\n{response}"
prompt = "Explain why the sky is blue, in one sentence."
result = agent.run(build_input(prompt, "It just is.")).content
# Score(overall=1)
from pydantic import BaseModel, Field
class Score(BaseModel):
overall: int = Field(..., ge=1, le=5, description="Overall quality")
rationale: str = Field(..., description="Why this score, citing the response")
from pydantic import BaseModel, Field
class RubricScore(BaseModel):
correctness: int = Field(..., ge=1, le=5, description="Factually correct")
completeness: int = Field(..., ge=1, le=5, description="Covers what was asked")
clarity: int = Field(..., ge=1, le=5, description="Easy to follow")
concision: int = Field(..., ge=1, le=5, description="No padding")
overall: int = Field(..., ge=1, le=5, description="Holistic quality")
| You need | Schema |
|---|---|
| One quality number | int with ge=1, le=5 |
| Number plus justification | Add a rationale field |
| Per-criterion breakdown | One bounded int field per dimension |
| Pairwise comparison | Preference data |
| Task | Guide |
|---|---|
| Rank two responses | Preference data |
| Reduce single-model bias | Quality pipeline |
Was this page helpful?