from django.db import models
from apps.system.models import CommonADModel, BaseModel

# Create your models here.
class Conversation(CommonADModel):
    """
    TN: 对话
    """
    title = models.CharField(max_length=200, default='新对话',verbose_name='对话标题')

class Message(BaseModel):
    """
    TN: 消息
    """
    conversation = models.ForeignKey(Conversation, on_delete=models.CASCADE, related_name='messages', verbose_name='对话')
    content = models.TextField(verbose_name='消息内容')
    role = models.CharField("角色", max_length=10, default='user', help_text="system/user")
