添加会话授权支持

This commit is contained in:
RockYang
2023-03-21 18:12:24 +08:00
parent 3bb6814493
commit 005d219a8c
16 changed files with 403 additions and 73 deletions

View File

@@ -10,10 +10,12 @@ import (
)
type Config struct {
Listen string
Session Session
ProxyURL string
Chat Chat
Listen string
Session Session
ProxyURL string
Chat Chat
EnableAuth bool // 是否开启鉴权
Tokens []string // 授权的白名单列表 TODO: 后期要存储到 LevelDB 或者 Mysql 数据库
}
// Chat configs struct
@@ -60,6 +62,7 @@ func NewDefaultConfig() *Config {
Temperature: 1.0,
EnableContext: true,
},
EnableAuth: true,
}
}