Spaces:
Running
Running
File size: 1,291 Bytes
0c591a7 3e0da39 0c591a7 53fe655 0c591a7 |
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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
"""
Pydantic models for API request/response schemas.
"""
from pydantic import BaseModel
class AnalysisRequest(BaseModel):
"""Request model for starting a SWOT analysis."""
name: str
ticker: str = ""
strategy_focus: str = "Competitive Position"
skip_cache: bool = False # If True, ignore cache and run fresh analysis
user_api_keys: dict = {} # Optional: {"groq": "key", "gemini": "key", "openrouter": "key"}
class StockSearchResult(BaseModel):
"""Single stock search result."""
symbol: str
name: str
exchange: str
match_type: str
class WorkflowStartResponse(BaseModel):
"""Response model for workflow start."""
workflow_id: str
class WorkflowStatus(BaseModel):
"""Workflow status model."""
status: str # 'running', 'completed', 'error'
current_step: str # 'starting', 'Researcher', 'Analyzer', 'Critic'
revision_count: int
score: int
class SwotData(BaseModel):
"""SWOT analysis data structure."""
strengths: list[str]
weaknesses: list[str]
opportunities: list[str]
threats: list[str]
class AnalysisResult(BaseModel):
"""Final analysis result model."""
company_name: str
score: int
revision_count: int
report_length: int
critique: str
swot_data: SwotData
|