Merge branch 'main' into feature-ssulbox
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
commit
fde48e8674
24 files changed
+793
-104
No files matched your search
@@ -2,25 +2,36 @@
|
||||
소셜 SEO 관련 Pydantic 스키마
|
||||
"""
|
||||
|
||||
from typing import Literal
|
||||
from typing import Literal, Optional
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
from pydantic import BaseModel, ConfigDict, Field, model_validator
|
||||
|
||||
|
||||
class YoutubeDescriptionRequest(BaseModel):
|
||||
"""유튜브 SEO Description 제안 요청"""
|
||||
|
||||
# 썰박스 콘텐츠의 SEO 를 요청할 때는 "ssul" + task_id 자리에 ssul_content.id.
|
||||
# 종류를 안 밝히면 video 로 간주된다 (기존 호출 호환).
|
||||
content_type: Literal["video", "ssul"] = Field(
|
||||
default="video", description="콘텐츠 종류"
|
||||
)
|
||||
task_id: str = Field(..., description="작업 고유 식별자 (ssul 이면 ssul_content.id)")
|
||||
video_id: Optional[int] = Field(
|
||||
None, description="ADO2 video.id 또는 썰박스 ssul_content.id"
|
||||
)
|
||||
task_id: Optional[str] = Field(
|
||||
None,
|
||||
description="ADO2 작업 UUID. 썰박스는 ssul_content.id 문자열도 허용",
|
||||
)
|
||||
|
||||
@model_validator(mode="after")
|
||||
def require_identifier(self) -> "YoutubeDescriptionRequest":
|
||||
if self.video_id is None and not self.task_id:
|
||||
raise ValueError("video_id 또는 task_id 가 필요합니다.")
|
||||
return self
|
||||
|
||||
model_config = ConfigDict(
|
||||
json_schema_extra={
|
||||
"example": {
|
||||
"task_id": "019c739f-65fc-7d15-8c88-b31be00e588e"
|
||||
"content_type": "video",
|
||||
"video_id": 123,
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user