feat: chat prompt

This commit is contained in:
feng
2023-12-14 10:38:55 +08:00
committed by 老广
parent 65718c5a84
commit 6cf05435bf
7 changed files with 299 additions and 1 deletions

View File

@@ -8,6 +8,7 @@ from django.db import models
from django.db.utils import ProgrammingError, OperationalError
from django.utils.translation import gettext_lazy as _
from common.db.models import JMSBaseModel
from common.utils import signer, get_logger
logger = get_logger(__name__)
@@ -173,3 +174,15 @@ class Setting(models.Model):
('change_terminal', _('Can change terminal setting')),
('change_other', _('Can change other setting')),
]
class ChatPrompt(JMSBaseModel):
name = models.CharField(max_length=128, verbose_name=_('Name'), unique=True)
content = models.TextField(blank=False, null=False, verbose_name=_('Content'))
builtin = models.BooleanField(default=False, verbose_name=_('Builtin'))
class Meta:
verbose_name = _("Chat prompt")
def __str__(self):
return self.name