Files
llm-wiki/scripts/deep-research/deep_research/schemas.py
T

61 lines
1.3 KiB
Python

"""원본 5 SCHEMA 의 Pydantic v2 포팅. LLM-facing 필드는 원본 JSON 키(camelCase) 유지."""
from typing import Literal, Optional
from pydantic import BaseModel, Field
class Angle(BaseModel):
label: str
query: str
rationale: Optional[str] = None
class Scope(BaseModel):
question: str
summary: str
angles: list[Angle] = Field(min_length=3, max_length=6)
class SearchResult(BaseModel):
url: str
title: str
snippet: Optional[str] = None
relevance: Literal["high", "medium", "low"]
class Search(BaseModel):
results: list[SearchResult] = Field(max_length=6)
class Claim(BaseModel):
claim: str
quote: str
importance: Literal["central", "supporting", "tangential"]
class Extract(BaseModel):
sourceQuality: Literal["primary", "secondary", "blog", "forum", "unreliable"]
publishDate: Optional[str] = None
claims: list[Claim] = Field(max_length=5)
class Verdict(BaseModel):
refuted: bool
evidence: str
confidence: Literal["high", "medium", "low"]
counterSource: Optional[str] = None
class Finding(BaseModel):
claim: str
confidence: Literal["high", "medium", "low"]
sources: list[str]
evidence: str
vote: Optional[str] = None
class Report(BaseModel):
summary: str
findings: list[Finding]
caveats: str
openQuestions: Optional[list[str]] = None