Files
AIcreat/app/schemas.py

75 lines
1.5 KiB
Python
Raw Permalink 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 = ""
writing_style: 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
class AuthCredentialRequest(BaseModel):
username: str
password: str
remember_me: bool = False
class ChangePasswordRequest(BaseModel):
old_password: str
new_password: str
class ForgotPasswordResetRequest(BaseModel):
username: str
reset_key: str
new_password: str
class WechatBindingRequest(BaseModel):
account_name: str = ""
appid: str
secret: str
author: str = ""
thumb_media_id: str = ""
thumb_image_path: str = ""
class WechatSwitchRequest(BaseModel):
account_id: int