from typing import Any

from pydantic import BaseModel, Field


class PromptTemplateBaseDTO(BaseModel):
    template_name: str | None = Field(None, description='模板名称')
    template_code: str | None = Field(None, description='模板code')
    template_type: str | None = Field(None, description='模板类型')
    description: str | None = Field(None, description='模板描述')
    template_content: str | None = Field(None, description='模板内容')
    template_abbreviation: str | None = Field(None, description='模板简称')
    variables: dict[str, Any] | None = Field(None, description='变量定义')
    status: int | None = Field(None, description='状态')
    version: str | None = Field(None, description='版本')
    created_by: int | None = Field(None, description='创建人ID')


class PromptTemplateCreateDTO(PromptTemplateBaseDTO):
    template_name: str = Field(..., description='模板名称')
    template_type: str = Field(..., description='模板类型')
    template_content: str = Field(..., description='模板内容')
    status: int = Field(1, description='状态')
    version: str = Field('v1.0', description='版本')


class PromptTemplateUpdateDTO(PromptTemplateBaseDTO):
    pass
