mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-06 22:12:12 +02:00
Rename schemas/search_space.py -> schemas/workspace.py, the SearchSpace* classes -> Workspace* (incl. UserSearchSpaceAccess -> UserWorkspaceAccess), and the search_space_id / search_space_name fields -> workspace_id / workspace_name across all schema modules. Under hard cutover the serialized JSON keys change outright (no alias). Re-exports in schemas/__init__.py updated.
36 lines
878 B
Python
36 lines
878 B
Python
from datetime import datetime
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class PromptCreate(BaseModel):
|
|
name: str = Field(..., min_length=1, max_length=200)
|
|
prompt: str = Field(..., min_length=1)
|
|
mode: str = Field(..., pattern="^(transform|explore)$")
|
|
workspace_id: int | None = None
|
|
is_public: bool = False
|
|
|
|
|
|
class PromptUpdate(BaseModel):
|
|
name: str | None = Field(None, min_length=1, max_length=200)
|
|
prompt: str | None = Field(None, min_length=1)
|
|
mode: str | None = Field(None, pattern="^(transform|explore)$")
|
|
is_public: bool | None = None
|
|
|
|
|
|
class PromptRead(BaseModel):
|
|
id: int
|
|
name: str
|
|
prompt: str
|
|
mode: str
|
|
workspace_id: int | None
|
|
is_public: bool
|
|
version: int
|
|
created_at: datetime
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
class PublicPromptRead(PromptRead):
|
|
author_name: str | None = None
|