from pydantic import BaseModel, Field from typing import List # Input 정의 class MarketingPromptInput(BaseModel): customer_name : str = Field(..., description = "마케팅 대상 사업체 이름") region : str = Field(..., description = "마케팅 대상 지역") detail_region_info : str = Field(..., description = "마케팅 대상 지역 상세") industry : str = Field(default="", description = "업종 분류 (stay|restaurant|cafe|salon|clinic|fitness|academy|attraction|general). 통합 프롬프트가 이 값으로 내부 분기") category : str = Field(default="", description = "네이버 지도 원본 카테고리 텍스트 (예: 펜션, 한식). industry 모듈 선택에는 관여하지 않고 세부 묘사의 참고 정보로만 사용") facility_info : str = Field(default="", description = "편의시설 정보 (네이버 지도 크롤링, 없으면 빈 문자열)") voted_keywords : str = Field(default="", description = "방문자 키워드 투표 상위 5개 (쉼표 구분, 없으면 빈 문자열)") # 메뉴 전달은 잠정 보류 (사이드 메뉴가 분석에 과도한 영향을 주는 문제). 재도입 시 주석 해제. # menu_info : str = Field(default="", description = "메뉴/상품 목록 (네이버 지도 크롤링, 쉼표 구분, 없으면 빈 문자열). 실제 판매 품목 기반 셀링포인트 작성에 사용") # Output 정의 class BrandIdentity(BaseModel): location_feature_analysis: str = Field(..., description="입지 특성 분석 (80자 이상 150자 이하)", min_length = 80, max_length = 150) # min/max constraint는 현재 openai json schema 등에서 작동하지 않는다는 보고가 있음. concept_scalability: str = Field(..., description="컨셉 확장성 (80자 이상 150자 이하)", min_length = 80, max_length = 150) class MarketPositioning(BaseModel): category_definition: str = Field(..., description="마케팅 카테고리") core_value: str = Field(..., description="마케팅 포지션 핵심 가치") class AgeRange(BaseModel): min_age : int = Field(..., ge=0, le=100) max_age : int = Field(..., ge=0, le=100) class TargetPersona(BaseModel): persona: str = Field(..., description="타겟 페르소나 이름/설명") age: AgeRange = Field(..., description="타겟 페르소나 나이대") favor_target: List[str] = Field(..., description="페르소나의 선호 요소") decision_trigger: str = Field(..., description="구매 결정 트리거") class SellingPoint(BaseModel): english_category: str = Field(..., description="셀링포인트 카테고리(영문)") korean_category: str = Field(..., description="셀링포인트 카테고리(한글)") description: str = Field(..., description="상세 설명") score: int = Field(..., ge=0, le=100, description="점수 (100점 만점)") class MarketingPromptOutput(BaseModel): brand_identity: BrandIdentity = Field(..., description="브랜드 아이덴티티") market_positioning: MarketPositioning = Field(..., description="시장 포지셔닝") target_persona: List[TargetPersona] = Field(..., description="타겟 페르소나") selling_points: List[SellingPoint] = Field(..., description="셀링 포인트") target_keywords: List[str] = Field(..., description="타겟 키워드 리스트")