mirror of
https://github.com/aimingmed/aimingmed-ai.git
synced 2026-01-19 21:37:31 +08:00
26 lines
669 B
Python
26 lines
669 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'"
|
|
)
|