SurfSense/surfsense_backend/app/schemas/prompts.py
CREDO23 0c53d884eb refactor(schemas): rename SearchSpace -> Workspace in Pydantic schemas (Phase 2 Wave C)
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.
2026-06-26 18:23:43 +02:00

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