refactor chat message body struct

This commit is contained in:
RockYang
2024-09-14 07:11:45 +08:00
parent 96b8121210
commit e371310d02
11 changed files with 161 additions and 95 deletions

View File

@@ -4,16 +4,17 @@ import "gorm.io/gorm"
type ChatMessage struct {
BaseModel
ChatId string // 会话 ID
UserId uint // 用户 ID
RoleId uint // 角色 ID
Model string // AI模型
Type string
Icon string
Tokens int
Content string
UseContext bool // 是否可以作为聊天上下文
DeletedAt gorm.DeletedAt
ChatId string // 会话 ID
UserId uint // 用户 ID
RoleId uint // 角色 ID
Model string // AI模型
Type string
Icon string
Tokens int
TotalTokens int // 总 token 消耗
Content string
UseContext bool // 是否可以作为聊天上下文
DeletedAt gorm.DeletedAt
}
func (ChatMessage) TableName() string {