Files
socaichat/backend/app/schemas.py
T
gongzhiyongandClaude Opus 4.6 efb3c53623 feat: add backend service and Azure deployment workflow
- Add complete Python backend (Litestar + LangGraph) with chat, conversations, tickets APIs
- Add GitHub Actions workflow for auto-deploying backend to Azure Web App (soc-backend)
- Add gunicorn to requirements.txt for production serving
- Update CLAUDE.md and EXTERNAL_SERVICES.md with latest config
- Remove obsolete claudehd.md (merged into gpthd.md)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 13:31:00 +08:00

46 lines
1.0 KiB
Python

"""Request / Response Pydantic models."""
from __future__ import annotations
from pydantic import BaseModel, Field
class ChatRequest(BaseModel):
message: str = Field(..., min_length=1)
conversation_id: str = Field(..., min_length=1)
tools: list[str] = Field(default_factory=list)
model: str = Field(default="flash", pattern="^(flash|pro)$")
class ChatResponse(BaseModel):
"""Non-streaming chat response (for reference; SSE is primary)."""
conversation_id: str
content: str
class ConversationCreate(BaseModel):
title: str = Field(default="New conversation")
class ConversationUpdate(BaseModel):
title: str
class MessageOut(BaseModel):
id: str
role: str
content: str
created_at: str
class ConversationOut(BaseModel):
id: str
title: str
created_at: str
updated_at: str
class ConversationDetail(ConversationOut):
"""Conversation with messages, returned by GET /api/conversations/{id}."""
messages: list[MessageOut] = Field(default_factory=list)