diff --git a/api/core/types/chat.go b/api/core/types/chat.go index f6ff64c7..aa8ac01f 100644 --- a/api/core/types/chat.go +++ b/api/core/types/chat.go @@ -70,6 +70,8 @@ type ChatModel struct { Power int `json:"power"` MaxTokens int `json:"max_tokens"` // 最大响应长度 MaxContext int `json:"max_context"` // 最大上下文长度 + Description string `json:"description"` //模型描述 + Category string `json:"category"` //模型类别 Temperature float32 `json:"temperature"` // 模型温度 KeyId int `json:"key_id"` // 绑定 API KEY } diff --git a/api/handler/admin/chat_model_handler.go b/api/handler/admin/chat_model_handler.go index 2c92089b..fe5e16cf 100644 --- a/api/handler/admin/chat_model_handler.go +++ b/api/handler/admin/chat_model_handler.go @@ -40,6 +40,8 @@ func (h *ChatModelHandler) Save(c *gin.Context) { Power int `json:"power"` MaxTokens int `json:"max_tokens"` // 最大响应长度 MaxContext int `json:"max_context"` // 最大上下文长度 + Description string `json:"description"` //模型描述 + Category string `json:"category"` //模型类别 Temperature float32 `json:"temperature"` // 模型温度 KeyId int `json:"key_id,omitempty"` CreatedAt int64 `json:"created_at"` @@ -64,6 +66,8 @@ func (h *ChatModelHandler) Save(c *gin.Context) { item.Power = data.Power item.MaxTokens = data.MaxTokens item.MaxContext = data.MaxContext + item.Description = data.Description + item.Category = data.Category item.Temperature = data.Temperature item.KeyId = data.KeyId item.Type = data.Type diff --git a/api/store/model/chat_model.go b/api/store/model/chat_model.go index 20c8c87b..b0fe256c 100644 --- a/api/store/model/chat_model.go +++ b/api/store/model/chat_model.go @@ -10,6 +10,8 @@ type ChatModel struct { Open bool // 是否开放模型给所有人使用 MaxTokens int // 最大响应长度 MaxContext int // 最大上下文长度 + Description string //模型描述 + Category string //模型类别 Temperature float32 // 模型温度 KeyId int // 绑定 API KEY ID Type string // 模型类型 diff --git a/api/store/vo/chat_model.go b/api/store/vo/chat_model.go index 50196263..81ae2d4e 100644 --- a/api/store/vo/chat_model.go +++ b/api/store/vo/chat_model.go @@ -10,6 +10,8 @@ type ChatModel struct { Open bool `json:"open"` MaxTokens int `json:"max_tokens"` // 最大响应长度 MaxContext int `json:"max_context"` // 最大上下文长度 + Description string `json:"description"` // 模型描述 + Category string `json:"category"` //模型类别 Temperature float32 `json:"temperature"` // 模型温度 KeyId int `json:"key_id,omitempty"` KeyName string `json:"key_name"` diff --git a/database/update-v4.2.3.sql b/database/update-v4.2.3.sql new file mode 100644 index 00000000..fa1632ec --- /dev/null +++ b/database/update-v4.2.3.sql @@ -0,0 +1,2 @@ +ALTER TABLE `chatgpt_chat_models` ADD `category` VARCHAR(1024) NOT NULL DEFAULT '' COMMENT '模型类别' AFTER `id`; +ALTER TABLE `chatgpt_chat_models` ADD `description` VARCHAR(1024) NOT NULL DEFAULT '' COMMENT '模型类型描述' AFTER `id`;