plan report 이름 통일 및 코드 정리
This commit is contained in:
1 parent
9b4e99abf9
commit
42e09ae2d1
9 files changed
+312
-135
No files matched your search
@@ -0,0 +1,10 @@
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
def _to_camel(s: str) -> str:
|
||||
head, *tail = s.split("_")
|
||||
return head + "".join(w.capitalize() for w in tail)
|
||||
|
||||
|
||||
class CamelModel(BaseModel):
|
||||
model_config = ConfigDict(populate_by_name=True, alias_generator=_to_camel)
|
||||
+196
-15
@@ -1,19 +1,200 @@
|
||||
from pydantic import BaseModel
|
||||
from integrations.llm.schemas.plan import (
|
||||
BrandGuide, ChannelStrategyCard, ContentStrategyData,
|
||||
CalendarData, AssetCollectionData, RepurposingProposalItem,
|
||||
)
|
||||
from typing import Literal
|
||||
from models.common import CamelModel
|
||||
|
||||
|
||||
class PlanApiResponse(BaseModel):
|
||||
class BrandPlanInconsistencyValue(CamelModel):
|
||||
channel: str
|
||||
value: str
|
||||
is_correct: bool
|
||||
|
||||
|
||||
class BrandPlanInconsistency(CamelModel):
|
||||
field: str
|
||||
values: list[BrandPlanInconsistencyValue]
|
||||
impact: str
|
||||
recommendation: str
|
||||
|
||||
|
||||
# --- BrandGuide ---
|
||||
|
||||
class ColorSwatch(CamelModel):
|
||||
name: str
|
||||
hex: str
|
||||
usage: str
|
||||
|
||||
|
||||
class FontSpec(CamelModel):
|
||||
family: str
|
||||
weight: str
|
||||
usage: str
|
||||
sample_text: str
|
||||
|
||||
|
||||
class LogoUsageRule(CamelModel):
|
||||
rule: str
|
||||
description: str
|
||||
correct: bool
|
||||
|
||||
|
||||
class ToneOfVoice(CamelModel):
|
||||
personality: list[str]
|
||||
communication_style: str
|
||||
do_examples: list[str]
|
||||
dont_examples: list[str]
|
||||
|
||||
|
||||
class ChannelBrandingRule(CamelModel):
|
||||
channel: str
|
||||
icon: str
|
||||
profile_photo: str
|
||||
banner_spec: str
|
||||
bio_template: str
|
||||
current_status: Literal["correct", "incorrect", "missing"]
|
||||
|
||||
|
||||
class BrandGuide(CamelModel):
|
||||
colors: list[ColorSwatch]
|
||||
fonts: list[FontSpec]
|
||||
logo_rules: list[LogoUsageRule]
|
||||
tone_of_voice: ToneOfVoice
|
||||
channel_branding: list[ChannelBrandingRule]
|
||||
brand_inconsistencies: list[BrandPlanInconsistency]
|
||||
|
||||
|
||||
# --- ChannelStrategy ---
|
||||
|
||||
class ChannelStrategyCard(CamelModel):
|
||||
channel_id: str
|
||||
channel_name: str
|
||||
icon: str
|
||||
current_status: str
|
||||
target_goal: str
|
||||
content_types: list[str]
|
||||
posting_frequency: str
|
||||
tone: str
|
||||
format_guidelines: list[str]
|
||||
priority: Literal["P0", "P1", "P2"]
|
||||
customer_journey_stage: Literal["awareness", "interest", "consideration", "conversion", "loyalty"] | None = None
|
||||
|
||||
|
||||
# --- ContentStrategy ---
|
||||
|
||||
class ContentPillar(CamelModel):
|
||||
title: str
|
||||
description: str
|
||||
related_usp: str
|
||||
example_topics: list[str]
|
||||
color: str
|
||||
|
||||
|
||||
class ContentTypeRow(CamelModel):
|
||||
format: str
|
||||
channels: list[str]
|
||||
frequency: str
|
||||
purpose: str
|
||||
|
||||
|
||||
class WorkflowStep(CamelModel):
|
||||
step: int
|
||||
name: str
|
||||
description: str
|
||||
owner: str
|
||||
duration: str
|
||||
|
||||
|
||||
class RepurposingOutput(CamelModel):
|
||||
format: str
|
||||
channel: str
|
||||
description: str
|
||||
|
||||
|
||||
class ContentStrategyData(CamelModel):
|
||||
pillars: list[ContentPillar]
|
||||
type_matrix: list[ContentTypeRow]
|
||||
workflow: list[WorkflowStep]
|
||||
repurposing_source: str
|
||||
repurposing_outputs: list[RepurposingOutput]
|
||||
|
||||
|
||||
# --- Calendar ---
|
||||
|
||||
class CalendarEntry(CamelModel):
|
||||
day_of_week: int
|
||||
channel: str
|
||||
channel_icon: str
|
||||
content_type: Literal["video", "blog", "social", "ad"]
|
||||
title: str
|
||||
id: str | None = None
|
||||
description: str | None = None
|
||||
pillar: str | None = None
|
||||
status: Literal["draft", "approved", "published"] | None = None
|
||||
is_manual_edit: bool | None = None
|
||||
ai_prompt_seed: str | None = None
|
||||
|
||||
|
||||
class CalendarWeek(CamelModel):
|
||||
week_number: int
|
||||
label: str
|
||||
entries: list[CalendarEntry]
|
||||
|
||||
|
||||
class ContentCountSummary(CamelModel):
|
||||
type: Literal["video", "blog", "social", "ad"]
|
||||
label: str
|
||||
count: int
|
||||
color: str
|
||||
|
||||
|
||||
class CalendarData(CamelModel):
|
||||
weeks: list[CalendarWeek]
|
||||
monthly_summary: list[ContentCountSummary]
|
||||
|
||||
|
||||
# --- AssetCollection ---
|
||||
|
||||
class AssetCard(CamelModel):
|
||||
id: str
|
||||
clinicName: str | None = None
|
||||
clinicNameEn: str | None = None
|
||||
createdAt: str
|
||||
targetUrl: str
|
||||
brandGuide: BrandGuide
|
||||
channelStrategies: list[ChannelStrategyCard]
|
||||
contentStrategy: ContentStrategyData
|
||||
source: Literal["homepage", "naver_place", "blog", "social", "youtube"]
|
||||
source_label: str
|
||||
type: Literal["photo", "video", "text"]
|
||||
title: str
|
||||
description: str
|
||||
repurposing_suggestions: list[str]
|
||||
status: Literal["collected", "pending", "needs_creation"]
|
||||
|
||||
|
||||
class YouTubeRepurposeItem(CamelModel):
|
||||
title: str
|
||||
views: int
|
||||
type: Literal["Short", "Long"]
|
||||
repurpose_as: list[str]
|
||||
|
||||
|
||||
class AssetCollectionData(CamelModel):
|
||||
assets: list[AssetCard]
|
||||
youtube_repurpose: list[YouTubeRepurposeItem]
|
||||
|
||||
|
||||
# --- Repurposing ---
|
||||
|
||||
class RepurposingProposalItem(CamelModel):
|
||||
source_video: YouTubeRepurposeItem
|
||||
outputs: list[RepurposingOutput]
|
||||
estimated_effort: Literal["low", "medium", "high"]
|
||||
priority: Literal["high", "medium", "low"]
|
||||
|
||||
|
||||
# --- PlanApiResponse ---
|
||||
|
||||
class PlanApiResponse(CamelModel):
|
||||
id: str
|
||||
clinic_name: str | None = None
|
||||
clinic_name_en: str | None = None
|
||||
created_at: str
|
||||
target_url: str
|
||||
brand_guide: BrandGuide
|
||||
channel_strategies: list[ChannelStrategyCard]
|
||||
content_strategy: ContentStrategyData
|
||||
calendar: CalendarData
|
||||
assetCollection: AssetCollectionData
|
||||
repurposingProposals: list[RepurposingProposalItem] | None = None
|
||||
asset_collection: AssetCollectionData
|
||||
repurposing_proposals: list[RepurposingProposalItem] | None = None
|
||||
+2
-13
@@ -1,17 +1,6 @@
|
||||
from __future__ import annotations
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
from integrations.llm.schemas.report import (
|
||||
Severity, ChannelStatus, DataSource, Language, VideoType, AnnotationType,
|
||||
)
|
||||
|
||||
|
||||
def _to_camel(s: str) -> str:
|
||||
head, *tail = s.split("_")
|
||||
return head + "".join(w.capitalize() for w in tail)
|
||||
|
||||
|
||||
class CamelModel(BaseModel):
|
||||
model_config = ConfigDict(populate_by_name=True, alias_generator=_to_camel)
|
||||
from models.common import CamelModel
|
||||
from models.status import Severity, ChannelStatus, DataSource, Language, VideoType, AnnotationType
|
||||
|
||||
|
||||
class ScreenshotAnnotation(CamelModel):
|
||||
|
||||
@@ -14,3 +14,39 @@ class TaskStatus(StrEnum):
|
||||
START = "start"
|
||||
PROCESSING = "processing"
|
||||
DONE = "done"
|
||||
|
||||
|
||||
class Severity(StrEnum):
|
||||
CRITICAL = "critical"
|
||||
WARNING = "warning"
|
||||
GOOD = "good"
|
||||
EXCELLENT = "excellent"
|
||||
UNKNOWN = "unknown"
|
||||
|
||||
|
||||
class ChannelStatus(StrEnum):
|
||||
ACTIVE = "active"
|
||||
INACTIVE = "inactive"
|
||||
UNKNOWN = "unknown"
|
||||
NOT_FOUND = "not_found"
|
||||
|
||||
|
||||
class DataSource(StrEnum):
|
||||
REGISTRY = "registry"
|
||||
SCRAPE = "scrape"
|
||||
|
||||
|
||||
class Language(StrEnum):
|
||||
KR = "KR"
|
||||
EN = "EN"
|
||||
|
||||
|
||||
class VideoType(StrEnum):
|
||||
SHORT = "Short"
|
||||
LONG = "Long"
|
||||
|
||||
|
||||
class AnnotationType(StrEnum):
|
||||
HIGHLIGHT = "highlight"
|
||||
ARROW = "arrow"
|
||||
TEXT = "text"
|
||||
Reference in new issue
Block a user