mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-10 19:23:42 +08:00
添加聊天角色支持
This commit is contained in:
@@ -151,5 +151,15 @@ func (s *Server) ListApiKeys(c *gin.Context) {
|
||||
}
|
||||
|
||||
func (s *Server) GetChatRoles(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, types.BizVo{Code: types.Success, Message: types.OkMsg, Data: s.Config.ChatRoles})
|
||||
var roles = make(map[string]interface{})
|
||||
for k, v := range s.Config.ChatRoles {
|
||||
roles[k] = struct {
|
||||
Key string `json:"key"`
|
||||
Name string `json:"name"`
|
||||
}{
|
||||
Key: v.Key,
|
||||
Name: v.Name,
|
||||
}
|
||||
}
|
||||
c.JSON(http.StatusOK, types.BizVo{Code: types.Success, Message: types.OkMsg, Data: roles})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user