55 lines
1.8 KiB
Python
55 lines
1.8 KiB
Python
from __future__ import annotations
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class KnowledgeStatusRequest(BaseModel):
|
|
open: bool
|
|
|
|
|
|
class KnowledgeLifecycleRequest(BaseModel):
|
|
status: str = Field(pattern="^(active|archived)$")
|
|
|
|
|
|
class KnowledgeMetadataUpdateRequest(BaseModel):
|
|
name: str = Field(min_length=1, max_length=100)
|
|
knowledgeType: str = Field(pattern="^(course|qa|general|fixed)$")
|
|
|
|
|
|
class KnowledgeBatchMetadataUpdateRequest(BaseModel):
|
|
knowledgeIds: list[int] = Field(min_length=1, max_length=500)
|
|
knowledgeType: str | None = Field(default=None, pattern="^(course|qa|general|fixed)$")
|
|
|
|
|
|
class KnowledgeBatchSyncRequest(BaseModel):
|
|
knowledgeIds: list[int] = Field(min_length=1, max_length=500)
|
|
|
|
|
|
class AttentionUpdateRequest(BaseModel):
|
|
status: str = Field(pattern="^(pending|processing|resolved|ignored)$")
|
|
note: str | None = Field(default=None, max_length=2000)
|
|
|
|
|
|
class AttentionRecognitionItem(BaseModel):
|
|
name: str = Field(min_length=1, max_length=50)
|
|
description: str = Field(min_length=1, max_length=500)
|
|
priority: str = Field(pattern="^(urgent|important|normal)$")
|
|
enabled: bool = True
|
|
|
|
|
|
class AttentionConfigRequest(BaseModel):
|
|
enabled: bool = True
|
|
keywordEnabled: bool = True
|
|
aiEnabled: bool = False
|
|
knowledgeMissingEnabled: bool = True
|
|
urgentTerms: list[str] = Field(default_factory=list, max_length=100)
|
|
importantTerms: list[str] = Field(default_factory=list, max_length=100)
|
|
normalTerms: list[str] = Field(default_factory=list, max_length=100)
|
|
promptTemplate: str = Field(default="", max_length=8000)
|
|
recognitionItems: list[AttentionRecognitionItem] = Field(default_factory=list, max_length=30)
|
|
|
|
|
|
class AttentionPreviewRequest(BaseModel):
|
|
messageIds: list[int] = Field(min_length=1, max_length=20)
|
|
config: AttentionConfigRequest
|