SurfSense/surfsense_backend/app/schemas/quick_ask_actions.py

31 lines
857 B
Python

from datetime import datetime
from pydantic import BaseModel, Field
class QuickAskActionCreate(BaseModel):
name: str = Field(..., min_length=1, max_length=200)
prompt: str = Field(..., min_length=1)
mode: str = Field(..., pattern="^(transform|explore)$")
icon: str | None = Field(None, max_length=50)
search_space_id: int | None = None
class QuickAskActionUpdate(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)$")
icon: str | None = Field(None, max_length=50)
class QuickAskActionRead(BaseModel):
id: int
name: str
prompt: str
mode: str
icon: str | None
search_space_id: int | None
created_at: datetime
class Config:
from_attributes = True