feat(relay): Add pass-through request option for global settings

This commit is contained in:
1808837298@qq.com
2025-03-11 17:02:35 +08:00
parent 8de29fbb83
commit 6f24dddcb2
4 changed files with 150 additions and 20 deletions

View File

@@ -0,0 +1,26 @@
package model_setting
import (
"one-api/setting/config"
)
type GlobalSettings struct {
PassThroughRequestEnabled bool `json:"pass_through_request_enabled"`
}
// 默认配置
var defaultOpenaiSettings = GlobalSettings{
PassThroughRequestEnabled: false,
}
// 全局实例
var globalSettings = defaultOpenaiSettings
func init() {
// 注册到全局配置管理器
config.GlobalConfig.Register("global", &globalSettings)
}
func GetGlobalSettings() *GlobalSettings {
return &globalSettings
}