# Models and Data Structures # Contains Pydantic models and data structures to avoid circular imports from pydantic import BaseModel from typing import List, Dict, Any, Optional, Literal class ExportSection(BaseModel): """Represents a section of content for export""" title: str content: str key: Optional[str] = None order: Optional[int] = None class ExportRequest(BaseModel): """Request model for document export""" sections: List[ExportSection] businessIdea: str summary: str format: Literal["pdf", "word"] = "pdf" chartImages: Optional[List[str]] = None includeCharts: bool = True includeTOC: bool = True class ExportResponse(BaseModel): """Response model for document export""" success: bool message: str filename: Optional[str] = None size: Optional[int] = None downloadUrl: Optional[str] = None documentData: Optional[str] = None class SectionJob(BaseModel): """Job model for section generation""" sectionKey: str # The server will load prompt/model defaults from GeneratePrompt. # Client MAY override but is not required to send these. prompt: Optional[str] = None promptVariables: Dict[str, str] = {} model: Optional[str] = None provider: Optional[str] = None temperature: Optional[float] = None maxTokens: Optional[int] = None class BatchGenerateRequest(BaseModel): """Request model for batch generation""" answers: List[str] planType: Optional[str] = "free" businessPlanId: Optional[str] = None countryCode: Optional[str] = None businessIdea: Optional[str] = None anonymousId: Optional[str] = None generateId: Optional[str] = None feedback: Optional[str] = None sections: List[SectionJob] format: Optional[str] = None chartImages: Optional[List[str]] = None class GenerateRequest(BaseModel): """Request model for single section generation""" answers: List[str] model: str prompt: str promptVariables: Dict[str, str] provider: str temperature: float maxTokens: int # NEW — optional, for persistence & ownership businessPlanId: Optional[str] = None planType: Optional[str] = "free" userId: Optional[str] = None # will be overridden by verified JWT anonymousId: Optional[str] = None countryCode: Optional[str] = None sectionKey: Optional[str] = None # e.g. "prompt_ExecutiveSummary" returnContent: Optional[bool] = False # NEW — default to id-only responses generateId: Optional[str] = None class CreatePlanRequest(BaseModel): """Request model for creating a new business plan""" answers: List[str] = [] planType: Optional[str] = "free" countryCode: Optional[str] = None anonymousId: Optional[str] = None businessIdea: Optional[str] = None generateId: Optional[str] = None