refactor(report): build_overrides + patch_report 통합 / list wholesale merge

- _build_overrides 가 result 받아 deep_merge 까지 처리, _patch_report 제거
- _deep_merge: list by-index → wholesale 치환 (EN 슬롯 누락/라벨 섞임 차단)
- build_facebook_audit: template-copy 대신 LLM logo/logo_description 만 두 페이지에 공통 적용
- _page_patch: language/label 명시 박음 (KR/EN 교차 오염 방지)
- FacebookPage/InstagramAccount/YouTubeAudit: 불필요한 Optional 제거, has_whatsapp/top_content_type 만 Optional 유지
- build_instagram_audit/build_facebook_audit: dict 반환 (overrides[k] = patch 단순 박기)
This commit is contained in:
minaChoi committed 2026-06-02 17:04:33 +09:00
1 parent 9a9ce1319f
commit 5504f79a9d
10 files changed
+144 -173

No files matched your search

+44 -48
View File
@@ -123,42 +123,39 @@ class TopVideo(BaseModel):
class YouTubeAudit(BaseModel):
# YouTube 미수집 병원에서 _build_youtube_audit가 채울 수 없는 필드 빔.
# required면 ValidationError로 리포트 실패 → Optional로 받아 부분 응답 허용.
channel_name: str | None = None
handle: str | None = None
subscribers: int | None = None
total_videos: int | None = None
total_views: int | None = None
weekly_view_growth: WeeklyViewGrowth | None = None
estimated_monthly_revenue: EstimatedRevenue | None = None
avg_video_length: str | None = None
upload_frequency: str | None = None
channel_created_date: str | None = None
channel_description: str | None = None
linked_urls: list[LinkedUrl] = []
playlists: list[str] = []
top_videos: list[TopVideo] = []
diagnosis: list[DiagnosisItem] = []
channel_name: str
handle: str
subscribers: int
total_videos: int
total_views: int
weekly_view_growth: WeeklyViewGrowth
estimated_monthly_revenue: EstimatedRevenue
avg_video_length: str
upload_frequency: str
channel_created_date: str
channel_description: str
linked_urls: list[LinkedUrl]
playlists: list[str]
top_videos: list[TopVideo]
diagnosis: list[DiagnosisItem]
# --- Instagram ---
class InstagramAccount(BaseModel):
# LLM이 누락 가능 — Optional로 받아 ValidationError 차단.
handle: str | None = None
language: Language | None = None
label: str | None = None
posts: int | None = None
followers: int | None = None
following: int | None = None
category: str | None = None
profile_link: str | None = None
highlights: list[str] = []
reels_count: int | None = None
content_format: str | None = None
profile_photo: str | None = None
bio: str | None = None
handle: str
language: Language
label: str
posts: int
followers: int
following: int
category: str
profile_link: str
highlights: list[str]
reels_count: int
content_format: str
profile_photo: str
bio: str
class InstagramAudit(BaseModel):
@@ -182,25 +179,24 @@ class BrandInconsistency(BaseModel):
class FacebookPage(BaseModel):
# LLM이 누락 가능 (page 1·2개 모두 language/label/logo/has_whatsapp 빼먹는 경우 관찰됨).
url: str | None = None
page_name: str | None = None
language: Language | None = None
label: str | None = None
followers: int | None = None
following: int | None = None
category: str | None = None
bio: str | None = None
logo: str | None = None
logo_description: str | None = None
link: str | None = None
linked_domain: str | None = None
reviews: int | None = None
recent_post_age: str | None = None
url: str
page_name: str
language: Language
label: str
followers: int
following: int
category: str
bio: str
logo: str
logo_description: str
link: str
linked_domain: str
reviews: int
recent_post_age: str
has_whatsapp: bool | None = None
post_frequency: str | None = None
post_frequency: str
top_content_type: str | None = None
engagement: str | None = None
engagement: str
class FacebookAudit(BaseModel):