5c009bc368
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
41 lines
918 B
Python
41 lines
918 B
Python
import uuid
|
|
from datetime import datetime
|
|
from typing import Any
|
|
|
|
from pydantic import BaseModel
|
|
|
|
from app.models.prompt_template import TemplateType
|
|
|
|
|
|
class TemplateCreate(BaseModel):
|
|
name: str
|
|
description: str = ""
|
|
type: TemplateType = TemplateType.custom
|
|
system_prompt: str
|
|
user_prompt: str
|
|
output_schema: dict[str, Any] = {}
|
|
is_default: bool = False
|
|
|
|
|
|
class TemplateUpdate(BaseModel):
|
|
name: str | None = None
|
|
description: str | None = None
|
|
system_prompt: str | None = None
|
|
user_prompt: str | None = None
|
|
output_schema: dict[str, Any] | None = None
|
|
is_default: bool | None = None
|
|
|
|
|
|
class TemplateResponse(BaseModel):
|
|
id: uuid.UUID
|
|
name: str
|
|
description: str
|
|
type: TemplateType
|
|
system_prompt: str
|
|
user_prompt: str
|
|
output_schema: dict[str, Any]
|
|
is_default: bool
|
|
created_at: datetime
|
|
|
|
model_config = {"from_attributes": True}
|