Spaces:
Running
Running
File size: 712 Bytes
9a2420b 876b12f 9a2420b 876b12f 9a2420b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
from pydantic import BaseModel, HttpUrl
from typing import Dict, Any, List
class AnalyzeRequest(BaseModel):
url: HttpUrl
def get_url_str(self) -> str:
# Convert HttpUrl to string safely
return str(self.url)
class MediaScoreDetails(BaseModel):
headline_analysis: Dict[str, Any]
sentiment_analysis: Dict[str, Any]
bias_analysis: Dict[str, Any]
evidence_analysis: Dict[str, Any]
class MediaScore(BaseModel):
media_unmasked_score: float
rating: str
details: MediaScoreDetails
class AnalysisResponse(BaseModel):
headline: str
content: str
sentiment: str
bias: str
bias_score: float
bias_percentage: float
media_score: MediaScore |