24 lines
1.1 KiB
Python
24 lines
1.1 KiB
Python
"""Utility datamodels: Prompt."""
|
|
|
|
from pydantic import BaseModel, Field
|
|
from modules.shared.attributeUtils import registerModelLabels
|
|
import uuid
|
|
|
|
|
|
class Prompt(BaseModel):
|
|
id: str = Field(default_factory=lambda: str(uuid.uuid4()), description="Primary key", json_schema_extra={"frontend_type": "text", "frontend_readonly": True, "frontend_required": False})
|
|
mandateId: str = Field(description="ID of the mandate this prompt belongs to", json_schema_extra={"frontend_type": "text", "frontend_readonly": True, "frontend_required": False})
|
|
content: str = Field(description="Content of the prompt", json_schema_extra={"frontend_type": "textarea", "frontend_readonly": False, "frontend_required": True})
|
|
name: str = Field(description="Name of the prompt", json_schema_extra={"frontend_type": "text", "frontend_readonly": False, "frontend_required": True})
|
|
registerModelLabels(
|
|
"Prompt",
|
|
{"en": "Prompt", "fr": "Invite"},
|
|
{
|
|
"id": {"en": "ID", "fr": "ID"},
|
|
"mandateId": {"en": "Mandate ID", "fr": "ID du mandat"},
|
|
"content": {"en": "Content", "fr": "Contenu"},
|
|
"name": {"en": "Name", "fr": "Nom"},
|
|
},
|
|
)
|
|
|
|
|