0c59f83a7f
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (push) Successful in 2s
CI/CD Pipeline / Check push changed paths (push) Successful in 21s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 31s
CI/CD Pipeline / Build Staging API Image (push) Successful in 36s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 36s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 42s
CI/CD Pipeline / Validate - Python (mypy + alembic) (push) Successful in 2m51s
CI/CD Pipeline / Integration Tests (push) Successful in 2m54s
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 2m25s
CI/CD Pipeline / Frontend Unit Tests (push) Failing after 4m21s
CI/CD Pipeline / Validate - Style (push) Successful in 4m37s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 2m52s
CI/CD Pipeline / Staging API Integration Tests (push) Successful in 3m59s
CI/CD Pipeline / Validate - Security (push) Successful in 6m54s
CI/CD Pipeline / Unit Tests (push) Successful in 9m27s
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
Worker Base Image Build / Build Worker Base Image (push) Failing after 20m47s
API Base Image Build / Build API Base Image (push) Failing after 24m44s
CI/CD Pipeline / Deploy Production (push) Failing after 25h49m26s
CI/CD Pipeline / Build Production Web Image (push) Failing after 25h49m30s
CI/CD Pipeline / Frontend Lint (push) Failing after 25h58m58s
CI/CD Pipeline / PR Build API Image (push) Failing after 25h59m1s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 25h58m26s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 25h58m23s
CI/CD Pipeline / PR Build Web Image (push) Failing after 25h58m23s
CI/CD Pipeline / Retag skipped Staging Worker Image (push) Failing after 25h57m20s
CI/CD Pipeline / Retag skipped Staging API Image (push) Failing after 25h57m20s
CI/CD Pipeline / CI Gate (push) Failing after 25h48m52s
CI/CD Pipeline / Retag skipped Staging Web Image (push) Failing after 25h57m20s
CI/CD Pipeline / Canary Release to Production (push) Failing after 25h48m48s
CI/CD Pipeline / Build Production Worker Image (push) Failing after 25h48m52s
CI/CD Pipeline / Build Production API Image (push) Failing after 25h48m52s
Co-authored-by: xiaoxia <dev@xiaoxiajianji.com> Co-committed-by: xiaoxia <dev@xiaoxiajianji.com>
61 lines
2.2 KiB
Python
61 lines
2.2 KiB
Python
"""Scripts AI 能力 Pydantic schemas — Issue #1893.
|
||
|
||
抖音文案提取、AI 改写、AI 标题生成的请求/响应模型。
|
||
"""
|
||
|
||
from __future__ import annotations
|
||
|
||
from typing import List, Optional
|
||
|
||
from pydantic import BaseModel, Field
|
||
|
||
# ── 抖音文案提取 ─────────────────────────────────────────────────────────────
|
||
|
||
|
||
class ExtractFromDouyinRequest(BaseModel):
|
||
"""从抖音视频提取文案请求."""
|
||
|
||
url: str = Field(..., description="抖音视频链接(短链或长链)")
|
||
|
||
|
||
class ExtractFromDouyinResponse(BaseModel):
|
||
"""从抖音视频提取文案响应."""
|
||
|
||
text: str = Field(..., description="ASR 识别出的文案文本")
|
||
duration_seconds: float = Field(..., description="视频时长(秒)")
|
||
source_url: str = Field(..., description="原始视频链接")
|
||
|
||
|
||
# ── AI 改写 ─────────────────────────────────────────────────────────────────
|
||
|
||
|
||
class AiRewriteRequest(BaseModel):
|
||
"""AI 文案改写请求."""
|
||
|
||
content: str = Field(..., description="原文内容")
|
||
style: Optional[str] = Field("口语化", description="改写风格,如 口语化/正式/活泼")
|
||
|
||
|
||
class AiRewriteResponse(BaseModel):
|
||
"""AI 文案改写响应."""
|
||
|
||
original: str = Field(..., description="原文")
|
||
rewritten: str = Field(..., description="改写后的文案")
|
||
style: str = Field(..., description="使用的改写风格")
|
||
|
||
|
||
# ── AI 标题生成 ──────────────────────────────────────────────────────────────
|
||
|
||
|
||
class AiGenerateTitlesRequest(BaseModel):
|
||
"""AI 标题生成请求."""
|
||
|
||
content: str = Field(..., description="文案内容")
|
||
count: int = Field(3, ge=1, le=5, description="生成标题数量(1-5,默认3)")
|
||
|
||
|
||
class AiGenerateTitlesResponse(BaseModel):
|
||
"""AI 标题生成响应."""
|
||
|
||
titles: List[str] = Field(..., description="生成的标题列表")
|