Merge remote-tracking branch 'upstream/develop' into feature/app-message-log
This commit is contained in:
@@ -149,18 +149,26 @@ class FileUploadConfig(BaseModel):
|
||||
)
|
||||
# 通用文件:PDF/DOCX/XLSX/TXT/CSV/JSON,最大 100MB
|
||||
document_enabled: bool = Field(default=False)
|
||||
document_max_size_mb: int = Field(default=100)
|
||||
document_max_size_mb: int = Field(default=50)
|
||||
document_allowed_extensions: List[str] = Field(
|
||||
default=["pdf", "docx", "xlsx", "txt", "csv", "json", "md"]
|
||||
default=["pdf", "docx", "doc", "xlsx", "xls", "txt", "csv", "json", "md"]
|
||||
)
|
||||
# 视频文件:MP4/MOV/AVI/WebM,最大 500MB
|
||||
video_enabled: bool = Field(default=False)
|
||||
video_max_size_mb: int = Field(default=500)
|
||||
video_max_size_mb: int = Field(default=50)
|
||||
video_allowed_extensions: List[str] = Field(
|
||||
default=["mp4", "mov"]
|
||||
default=["mp4"]
|
||||
)
|
||||
# 最大文件数量
|
||||
max_file_count: int = Field(default=5, ge=1, le=20)
|
||||
max_file_count: int = Field(default=5, ge=1)
|
||||
|
||||
@field_validator("max_file_count")
|
||||
@classmethod
|
||||
def validate_max_file_count(cls, v: int) -> int:
|
||||
from app.core.config import settings
|
||||
if v > settings.MAX_FILE_COUNT:
|
||||
raise ValueError(f"max_file_count 不能超过 {settings.MAX_FILE_COUNT}")
|
||||
return v
|
||||
|
||||
|
||||
class OpeningStatementConfig(BaseModel):
|
||||
|
||||
@@ -21,7 +21,7 @@ class MemoryWriteRequest(BaseModel):
|
||||
"""
|
||||
end_user_id: str = Field(..., description="End user ID (required)")
|
||||
message: str = Field(..., description="Message content to store")
|
||||
config_id: Optional[str] = Field(None, description="Memory configuration ID")
|
||||
config_id: str = Field(..., description="Memory configuration ID (required)")
|
||||
storage_type: str = Field("neo4j", description="Storage type: neo4j or rag")
|
||||
user_rag_memory_id: Optional[str] = Field(None, description="RAG memory ID")
|
||||
|
||||
@@ -68,7 +68,7 @@ class MemoryReadRequest(BaseModel):
|
||||
"0",
|
||||
description="Search mode: 0=verify, 1=direct, 2=context"
|
||||
)
|
||||
config_id: Optional[str] = Field(None, description="Memory configuration ID")
|
||||
config_id: str = Field(..., description="Memory configuration ID (required)")
|
||||
storage_type: str = Field("neo4j", description="Storage type: neo4j or rag")
|
||||
user_rag_memory_id: Optional[str] = Field(None, description="RAG memory ID")
|
||||
|
||||
@@ -132,3 +132,79 @@ class MemoryReadResponse(BaseModel):
|
||||
description="Intermediate retrieval outputs"
|
||||
)
|
||||
end_user_id: str = Field(..., description="End user ID")
|
||||
|
||||
|
||||
class CreateEndUserRequest(BaseModel):
|
||||
"""Request schema for creating an end user.
|
||||
|
||||
Attributes:
|
||||
workspace_id: Workspace ID (required)
|
||||
other_id: External user identifier (required)
|
||||
other_name: Display name for the end user
|
||||
"""
|
||||
workspace_id: str = Field(..., description="Workspace ID (required)")
|
||||
other_id: str = Field(..., description="External user identifier (required)")
|
||||
other_name: Optional[str] = Field("", description="Display name")
|
||||
|
||||
@field_validator("workspace_id")
|
||||
@classmethod
|
||||
def validate_workspace_id(cls, v: str) -> str:
|
||||
"""Validate that workspace_id is not empty."""
|
||||
if not v or not v.strip():
|
||||
raise ValueError("workspace_id is required and cannot be empty")
|
||||
return v.strip()
|
||||
|
||||
@field_validator("other_id")
|
||||
@classmethod
|
||||
def validate_other_id(cls, v: str) -> str:
|
||||
"""Validate that other_id is not empty."""
|
||||
if not v or not v.strip():
|
||||
raise ValueError("other_id is required and cannot be empty")
|
||||
return v.strip()
|
||||
|
||||
|
||||
class CreateEndUserResponse(BaseModel):
|
||||
"""Response schema for end user creation.
|
||||
|
||||
Attributes:
|
||||
id: Created end user UUID
|
||||
other_id: External user identifier
|
||||
other_name: Display name
|
||||
workspace_id: Workspace the user belongs to
|
||||
"""
|
||||
id: str = Field(..., description="End user UUID")
|
||||
other_id: str = Field(..., description="External user identifier")
|
||||
other_name: str = Field("", description="Display name")
|
||||
workspace_id: str = Field(..., description="Workspace ID")
|
||||
|
||||
|
||||
class MemoryConfigItem(BaseModel):
|
||||
"""Schema for a single memory config in the list response.
|
||||
|
||||
Attributes:
|
||||
config_id: Configuration UUID
|
||||
config_name: Configuration name
|
||||
config_desc: Configuration description
|
||||
is_default: Whether this is the workspace default config
|
||||
scene_name: Associated ontology scene name
|
||||
created_at: Creation timestamp
|
||||
updated_at: Last update timestamp
|
||||
"""
|
||||
config_id: str = Field(..., description="Configuration ID")
|
||||
config_name: str = Field(..., description="Configuration name")
|
||||
config_desc: Optional[str] = Field(None, description="Configuration description")
|
||||
is_default: bool = Field(False, description="Whether this is the workspace default")
|
||||
scene_name: Optional[str] = Field(None, description="Associated ontology scene name")
|
||||
created_at: Optional[str] = Field(None, description="Creation timestamp")
|
||||
updated_at: Optional[str] = Field(None, description="Last update timestamp")
|
||||
|
||||
|
||||
class ListConfigsResponse(BaseModel):
|
||||
"""Response schema for listing memory configs.
|
||||
|
||||
Attributes:
|
||||
configs: List of memory config items
|
||||
total: Total number of configs
|
||||
"""
|
||||
configs: List[MemoryConfigItem] = Field(default_factory=list, description="List of configs")
|
||||
total: int = Field(0, description="Total number of configs")
|
||||
|
||||
Reference in New Issue
Block a user