mirror of
https://github.com/aimingmed/aimingmed-ai.git
synced 2026-01-25 08:23:37 +08:00
23 lines
666 B
Python
23 lines
666 B
Python
from pydantic import BaseModel, Field
|
|
|
|
|
|
class GradeDocuments(BaseModel):
|
|
"""Binary score for relevance check on retrieved documents."""
|
|
|
|
binary_score: str = Field(
|
|
description="Documents are relevant to the question, 'yes' or 'no'"
|
|
)
|
|
|
|
class GradeHallucinations(BaseModel):
|
|
"""Binary score for hallucination present in generation answer."""
|
|
|
|
binary_score: str = Field(
|
|
description="Answer is grounded in the facts, 'yes' or 'no'"
|
|
)
|
|
|
|
class GradeAnswer(BaseModel):
|
|
"""Binary score to assess answer addresses question."""
|
|
|
|
binary_score: str = Field(
|
|
description="Answer addresses the question, 'yes' or 'no'"
|
|
) |