Files
AIcreat/app/schemas.py
2026-04-06 15:28:15 +08:00

44 lines
966 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
from typing import Any
from pydantic import BaseModel, Field
class RewriteRequest(BaseModel):
source_text: str = Field(..., min_length=20)
title_hint: str = ""
tone: str = "专业、可信、可读性强"
audience: str = "公众号读者"
keep_points: str = ""
avoid_words: str = ""
class RewriteResponse(BaseModel):
title: str
summary: str
body_markdown: str
mode: str = "ai"
quality_notes: list[str] = []
trace: dict[str, Any] | None = Field(
default=None,
description="改写链路追踪:请求 ID、耗时、模型、质检与降级原因便于监测与回溯",
)
class WechatPublishRequest(BaseModel):
title: str
summary: str = ""
body_markdown: str
author: str = ""
thumb_media_id: str = ""
class IMPublishRequest(BaseModel):
title: str
body_markdown: str
class PublishResponse(BaseModel):
ok: bool
detail: str
data: dict | None = None