mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-02 20:32:39 +02:00
add custom quick-ask actions: model, migration, schemas, CRUD routes
This commit is contained in:
parent
407059ce84
commit
041401aefc
5 changed files with 218 additions and 0 deletions
31
surfsense_backend/app/schemas/quick_ask_actions.py
Normal file
31
surfsense_backend/app/schemas/quick_ask_actions.py
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue