Files
group_fqcd_jr/app/api/schemas/conversations.py
T

19 lines
715 B
Python
Raw Normal View History

2026-09-09 21:55:37 +08:00
from typing import Literal
from pydantic import BaseModel, ConfigDict, Field
class FeedbackRequest(BaseModel):
model_config = ConfigDict(extra="forbid")
rating: Literal[-1, 1]
# `ConversationFeedback.feedback_type` 是 `String(32)`:不设上限时超长取值
# 会穿过接口校验、在落库时才出现 500,必须在这里拦成 422。
feedback_type: str | None = Field(default=None, max_length=32)
2026-09-09 21:55:37 +08:00
feedback_content: str | None = Field(default=None, max_length=1000)
class HandoverRequest(BaseModel):
model_config = ConfigDict(extra="forbid")
reason_code: Literal["user_requested"] = "user_requested"
reason_detail: str | None = Field(default=None, max_length=500)