mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-13 04:33:42 +08:00
refactor: refactor chat_handler, add support for Azure and ChatGLM
This commit is contained in:
@@ -3,7 +3,7 @@ package vo
|
||||
// ApiKey OpenAI API 模型
|
||||
type ApiKey struct {
|
||||
BaseVo
|
||||
UserId uint `json:"user_id"` //用户ID,系统添加的用户 ID 为 0
|
||||
Platform string `json:"platform"`
|
||||
Value string `json:"value"` // API Key 的值
|
||||
LastUsedAt int64 `json:"last_used_at"` // 最后使用时间
|
||||
}
|
||||
|
||||
@@ -11,7 +11,3 @@ type HistoryMessage struct {
|
||||
Content string `json:"content"`
|
||||
UseContext bool `json:"use_context"`
|
||||
}
|
||||
|
||||
func (HistoryMessage) TableName() string {
|
||||
return "chatgpt_chat_history"
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@ package vo
|
||||
|
||||
type ChatItem struct {
|
||||
BaseVo
|
||||
UserId uint `json:"user_id"`
|
||||
Icon string `json:"icon"`
|
||||
RoleId uint `json:"role_id"`
|
||||
ChatId string `json:"chat_id"`
|
||||
Model string `json:"model"`
|
||||
Title string `json:"title"`
|
||||
UserId uint `json:"user_id"`
|
||||
Icon string `json:"icon"`
|
||||
RoleId uint `json:"role_id"`
|
||||
ChatId string `json:"chat_id"`
|
||||
ModelId uint `json:"model_id"`
|
||||
Title string `json:"title"`
|
||||
}
|
||||
|
||||
9
api/store/vo/chat_model.go
Normal file
9
api/store/vo/chat_model.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package vo
|
||||
|
||||
type ChatModel struct {
|
||||
BaseVo
|
||||
Platform string `json:"platform"`
|
||||
Name string `json:"name"`
|
||||
Value string `json:"value"`
|
||||
Enabled bool `json:"enabled"`
|
||||
}
|
||||
@@ -4,13 +4,11 @@ import "chatplus/core/types"
|
||||
|
||||
type User struct {
|
||||
BaseVo
|
||||
Username string `json:"username"`
|
||||
Mobile string `json:"mobile"`
|
||||
Nickname string `json:"nickname"`
|
||||
Avatar string `json:"avatar"`
|
||||
Salt string `json:"salt"` // 密码盐
|
||||
Tokens int64 `json:"tokens"` // 剩余tokens
|
||||
Calls int `json:"calls"` // 剩余对话次数
|
||||
Salt string `json:"salt"` // 密码盐
|
||||
TotalTokens int64 `json:"total_tokens"` // 总消耗tokens
|
||||
Calls int `json:"calls"` // 剩余对话次数
|
||||
ImgCalls int `json:"img_calls"`
|
||||
ChatConfig types.ChatConfig `json:"chat_config"` // 聊天配置
|
||||
ChatRoles []string `json:"chat_roles"` // 聊天角色集合
|
||||
|
||||
Reference in New Issue
Block a user