🎨 优化预设 && 优化对话是预设和模型切换

Signed-off-by: Echo <1711788888@qq.com>
This commit is contained in:
2026-02-28 15:09:40 +08:00
parent 032d0ccdf0
commit 81b552b689
7 changed files with 113 additions and 50 deletions

View File

@@ -19,10 +19,12 @@ type Conversation struct {
Title string `gorm:"type:varchar(200)" json:"title"` // 对话标题
// 对话配置
PresetID *uint `gorm:"index" json:"presetId"` // 使用的预设ID
AIProvider string `gorm:"type:varchar(50)" json:"aiProvider"` // AI提供商 (openai/anthropic)
Model string `gorm:"type:varchar(100)" json:"model"` // 使用的模型
Settings datatypes.JSON `gorm:"type:jsonb" json:"settings"` // 对话设置 (temperature等)
PresetID *uint `gorm:"index" json:"presetId"` // 使用的预设ID
WorldbookID *uint `gorm:"index" json:"worldbookId"` // 使用的世界书ID
AIProvider string `gorm:"type:varchar(50)" json:"aiProvider"` // AI提供商 (openai/anthropic)
Model string `gorm:"type:varchar(100)" json:"model"` // 使用的模型
Settings datatypes.JSON `gorm:"type:jsonb" json:"settings"` // 对话设置 (temperature等)
WorldbookEnabled bool `gorm:"default:false" json:"worldbookEnabled"` // 是否启用世界书
// 统计信息
MessageCount int `gorm:"default:0" json:"messageCount"` // 消息数量