mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-09 18:23:40 +08:00
fix: Switch to channel-ratio
- Use channel ratios instead of group ratios in all applicable places - Start using the lowest channel ratio of the specified channel's groups
This commit is contained in:
@@ -26,6 +26,7 @@ type RelayMeta struct {
|
||||
ActualModelName string
|
||||
RequestURLPath string
|
||||
PromptTokens int // only for DoResponse
|
||||
ChannelRatio float64
|
||||
}
|
||||
|
||||
func GetRelayMeta(c *gin.Context) *RelayMeta {
|
||||
@@ -43,6 +44,7 @@ func GetRelayMeta(c *gin.Context) *RelayMeta {
|
||||
APIKey: strings.TrimPrefix(c.Request.Header.Get("Authorization"), "Bearer "),
|
||||
Config: nil,
|
||||
RequestURLPath: c.Request.URL.String(),
|
||||
ChannelRatio: c.GetFloat64("channel_ratio"),
|
||||
}
|
||||
if meta.ChannelType == common.ChannelTypeAzure {
|
||||
meta.APIVersion = GetAzureAPIVersion(c)
|
||||
|
||||
Reference in New Issue
Block a user