feat: 支持文心4.0模型,不同的用户可以订阅不同的AI模型

This commit is contained in:
RockYang
2023-10-26 13:41:49 +08:00
parent e5fb986463
commit 9be6755f65
30 changed files with 193 additions and 47 deletions

View File

@@ -32,6 +32,7 @@ func (h *ChatModelHandler) Save(c *gin.Context) {
Enabled bool `json:"enabled"`
SortNum int `json:"sort_num"`
Platform string `json:"platform"`
Weight int `json:"weight"`
CreatedAt int64 `json:"created_at"`
}
if err := c.ShouldBindJSON(&data); err != nil {
@@ -39,7 +40,7 @@ func (h *ChatModelHandler) Save(c *gin.Context) {
return
}
item := model.ChatModel{Platform: data.Platform, Name: data.Name, Value: data.Value, Enabled: data.Enabled}
item := model.ChatModel{Platform: data.Platform, Name: data.Name, Value: data.Value, Enabled: data.Enabled, SortNum: data.SortNum, Weight: data.Weight}
item.Id = data.Id
if item.Id > 0 {
item.CreatedAt = time.Unix(data.CreatedAt, 0)