Files
ZNJJ-api-server/src/schemas/models.py
T

59 lines
1.9 KiB
Python
Raw Normal View History

2025-04-29 15:03:02 +08:00
from pydantic import BaseModel, Field
2026-07-28 08:41:34 +08:00
from typing import Any, Literal, Optional
ClientMode = Literal["direct", "browser_addon"]
2025-04-29 15:03:02 +08:00
class ProcessRequest_chat(BaseModel):
sessionId: str = Field(..., max_length=64)
timeStamp: str = Field(..., max_length=32)
text: str = Field(...)
2026-07-28 08:41:34 +08:00
clientMode: ClientMode = "direct"
needFormUpdate: bool = False
useTextChunk: bool = False
2025-04-29 15:03:02 +08:00
class ProcessResponse_chat(BaseModel):
sessionId: str = Field(..., max_length=64)
timeStamp: str = Field(..., max_length=32)
outputText: str = Field(...)
formUpdate: Any = Field(default_factory=dict)
2025-04-29 15:03:02 +08:00
nextStage: str = Field(..., max_length=32)
2026-07-28 08:41:34 +08:00
nextStageCode: str = Field(..., max_length=32)
2025-04-29 15:03:02 +08:00
code: str = Field(..., max_length=4)
msg: Optional[str] = None
class ProcessRequest_get(BaseModel):
sessionId: str = Field(..., max_length=64)
timeStamp: str = Field(..., max_length=32)
key: str = Field(...)
includeInputInfo: bool = False
2025-04-29 15:03:02 +08:00
class ProcessResponse_get(BaseModel):
sessionId: str = Field(..., max_length=64)
timeStamp: str = Field(..., max_length=32)
value: str = Field(...)
code: str = Field(..., max_length=4)
msg: Optional[str] = None
class ProcessRequest_set(BaseModel):
sessionId: str = Field(..., max_length=64)
timeStamp: str = Field(..., max_length=32)
key: str = Field(...)
value: str = Field(...)
includeInputInfo: bool = False
2025-04-29 15:03:02 +08:00
class ProcessResponse_set(BaseModel):
sessionId: str = Field(..., max_length=64)
timeStamp: str = Field(..., max_length=32)
code: str = Field(..., max_length=4)
msg: Optional[str] = None
class ProcessRequest_delete_session(BaseModel):
sessionId: str = Field(..., max_length=64)
timeStamp: str = Field(..., max_length=32)
class ProcessResponse_delete_session(BaseModel):
sessionId: str = Field(..., max_length=64)
timeStamp: str = Field(..., max_length=32)
code: str = Field(..., max_length=4)
msg: Optional[str] = None