Files
wecom_it_smart_desk/backend/app/schemas/conversation_annotation.py
T

47 lines
1.6 KiB
Python

# =============================================================================
# 企微IT智能服务台 — 会话标注 Pydantic Schema
# =============================================================================
from datetime import datetime
from typing import Optional
from pydantic import BaseModel, Field
# --------------------------------------------------------------------------
# 创建会话标注 Schema
# --------------------------------------------------------------------------
class AnnotationCreate(BaseModel):
"""创建会话标注请求 Schema。"""
conversation_id: str = Field(..., description="会话ID")
message_id: str = Field(..., description="被标注的消息ID")
feedback: str = Field(..., description="useful=有用/useless=无用")
comment: Optional[str] = Field(None, description="备注")
# --------------------------------------------------------------------------
# 会话标注响应 Schema
# --------------------------------------------------------------------------
class AnnotationResponse(BaseModel):
"""会话标注响应 Schema。"""
id: str
conversation_id: str
agent_id: str
message_id: str
feedback: str
comment: Optional[str] = None
created_at: datetime
model_config = {"from_attributes": True}
# --------------------------------------------------------------------------
# 会话标注列表响应 Schema
# --------------------------------------------------------------------------
class AnnotationListResponse(BaseModel):
"""会话标注列表响应 Schema。"""
items: list[AnnotationResponse]