5b92553148
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
29 lines
1004 B
Python
29 lines
1004 B
Python
import enum
|
|
|
|
from sqlalchemy import Boolean, Enum, String, Text
|
|
from sqlalchemy.dialects.postgresql import JSONB
|
|
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
|
|
from app.models.base import Base, TimestampMixin, UUIDMixin
|
|
|
|
|
|
class TemplateType(str, enum.Enum):
|
|
client_survey = "client_survey"
|
|
client_intro = "client_intro"
|
|
internal = "internal"
|
|
custom = "custom"
|
|
|
|
|
|
class PromptTemplate(UUIDMixin, TimestampMixin, Base):
|
|
__tablename__ = "prompt_templates"
|
|
|
|
name: Mapped[str] = mapped_column(String(255))
|
|
description: Mapped[str] = mapped_column(String(1000), default="")
|
|
type: Mapped[TemplateType] = mapped_column(Enum(TemplateType))
|
|
system_prompt: Mapped[str] = mapped_column(Text)
|
|
user_prompt: Mapped[str] = mapped_column(Text)
|
|
output_schema: Mapped[dict] = mapped_column(JSONB, default=dict)
|
|
is_default: Mapped[bool] = mapped_column(Boolean, default=False)
|
|
|
|
protocols: Mapped[list["Protocol"]] = relationship(back_populates="template")
|