- Replace bare score badge with rich ScoreCard component showing color-coded score (green/amber/red), label, and hover tooltip explaining what the 0-100 Attention Focus score means - Add AI Design Effectiveness Score (1-10) from Claude alongside qualitative insights, with score_reason explanation - Fix image/png media type error by converting all images to PNG before sending to Claude API - Save ai_score and ai_score_reason to DB - Display AI score badge in InsightsPanel with color coding Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
54 lines
1.1 KiB
Python
54 lines
1.1 KiB
Python
from datetime import datetime
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class AnalysisSummary(BaseModel):
|
|
id: str
|
|
name: str
|
|
model_used: str
|
|
status: str
|
|
original_filename: str
|
|
image_width: int
|
|
image_height: int
|
|
overall_score: float | None = None
|
|
created_at: datetime
|
|
|
|
model_config = {"from_attributes": True}
|
|
|
|
|
|
class GazePoint(BaseModel):
|
|
rank: int
|
|
x: int
|
|
y: int
|
|
x_pct: float
|
|
y_pct: float
|
|
probability: float
|
|
|
|
|
|
class Insight(BaseModel):
|
|
type: str # "info" | "success" | "warning"
|
|
title: str
|
|
description: str
|
|
|
|
|
|
class AnalysisDetail(AnalysisSummary):
|
|
file_format: str
|
|
gaze_sequence: list[GazePoint] | None = None
|
|
hotspots: list[dict] | None = None
|
|
insights: list[Insight] | None = None
|
|
ai_insights: list[Insight] | None = None
|
|
ai_score: int | None = None
|
|
ai_score_reason: str | None = None
|
|
ai_cost_usd: float | None = None
|
|
aoi_count: int = 0
|
|
|
|
|
|
class AnalysisCreate(BaseModel):
|
|
name: str | None = None
|
|
model: str = "deepgaze_iie"
|
|
|
|
|
|
class AnalysisStatus(BaseModel):
|
|
id: str
|
|
status: str
|