Allowing AI to generate suggestions for the blog writer

This commit is contained in:
ajaysi
2025-09-20 22:15:17 +05:30
parent 4d153b292d
commit f98d49cea7
22 changed files with 4248 additions and 96 deletions

View File

@@ -215,3 +215,45 @@ class HallucinationCheckResponse(BaseModel):
claims: List[Dict[str, Any]] = []
suggestions: List[Dict[str, Any]] = []
# -----------------------
# Medium Blog Generation
# -----------------------
class MediumSectionOutline(BaseModel):
"""Lightweight outline payload for medium blog generation."""
id: str
heading: str
keyPoints: List[str] = []
subheadings: List[str] = []
keywords: List[str] = []
targetWords: Optional[int] = None
references: List[ResearchSource] = []
class MediumBlogGenerateRequest(BaseModel):
"""Request to generate an entire medium-length blog in one pass."""
title: str
sections: List[MediumSectionOutline]
persona: Optional[PersonaInfo] = None
tone: Optional[str] = None
audience: Optional[str] = None
globalTargetWords: Optional[int] = 1000
researchKeywords: Optional[List[str]] = None # Original research keywords for better caching
class MediumGeneratedSection(BaseModel):
id: str
heading: str
content: str
wordCount: int
sources: Optional[List[ResearchSource]] = None
class MediumBlogGenerateResult(BaseModel):
success: bool = True
title: str
sections: List[MediumGeneratedSection]
model: Optional[str] = None
generation_time_ms: Optional[int] = None
safety_flags: Optional[Dict[str, Any]] = None