add custom quick-ask actions: model, migration, schemas, CRUD routes

This commit is contained in:
CREDO23 2026-03-27 21:02:36 +02:00
parent 407059ce84
commit 041401aefc
5 changed files with 218 additions and 0 deletions

View 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