mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-26 01:06:23 +02:00
44 lines
1.1 KiB
Python
44 lines
1.1 KiB
Python
import uuid
|
|
from datetime import datetime
|
|
|
|
from pydantic import BaseModel, ConfigDict
|
|
|
|
from .base import IDModel, TimestampModel
|
|
|
|
|
|
class SearchSpaceBase(BaseModel):
|
|
name: str
|
|
description: str | None = None
|
|
|
|
|
|
class SearchSpaceCreate(SearchSpaceBase):
|
|
citations_enabled: bool = True
|
|
qna_custom_instructions: str | None = None
|
|
|
|
|
|
class SearchSpaceUpdate(BaseModel):
|
|
name: str | None = None
|
|
description: str | None = None
|
|
citations_enabled: bool | None = None
|
|
qna_custom_instructions: str | None = None
|
|
shared_memory_md: str | None = None
|
|
ai_file_sort_enabled: bool | None = None
|
|
|
|
|
|
class SearchSpaceRead(SearchSpaceBase, IDModel, TimestampModel):
|
|
id: int
|
|
created_at: datetime
|
|
user_id: uuid.UUID
|
|
citations_enabled: bool
|
|
qna_custom_instructions: str | None = None
|
|
shared_memory_md: str | None = None
|
|
ai_file_sort_enabled: bool = False
|
|
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
|
|
class SearchSpaceWithStats(SearchSpaceRead):
|
|
"""Extended search space info with member count and ownership status."""
|
|
|
|
member_count: int = 1
|
|
is_owner: bool = False
|