-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstructures.py
More file actions
17 lines (14 loc) · 778 Bytes
/
Copy pathstructures.py
File metadata and controls
17 lines (14 loc) · 778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from typing import TypedDict, List, Annotated
from pydantic import BaseModel, Field
class FactCheckInfo(BaseModel):
"""Details of individual fact-checking results"""
matching_text: str = Field(description="Exact text excerpt from the document that supports the claim.")
document_name: str = Field(description="Name of the document where the matching text was found.")
class FactCheck(BaseModel): # TODO add validation
"""Fact check details"""
reasoning: str = Field(description="Explanation of the reasoning behind the fact-checking result.")
details: List[FactCheckInfo] = Field(description="List of detailed fact-checking results, including matching texts and document names.")
class State(TypedDict):
claim: str
context: str
answer: str