🐛 fix: Do not modify Provider parameters

This commit is contained in:
MartialBE 2024-05-29 16:32:08 +08:00
parent 8f77924946
commit ee662fda04
No known key found for this signature in database
GPG Key ID: 27C0267EC84B0A5C

View File

@ -111,13 +111,14 @@ func (p *OpenAIProvider) GetFullRequestURL(requestURL string, modelName string)
} }
} else if p.Channel.Type == config.ChannelTypeCustom && p.Channel.Other != "" { } else if p.Channel.Type == config.ChannelTypeCustom && p.Channel.Other != "" {
if p.Channel.Other == "disable" { replaceValue := p.Channel.Other
p.Channel.Other = "" if replaceValue == "disable" {
replaceValue = ""
} else { } else {
p.Channel.Other = "/" + p.Channel.Other replaceValue = "/" + replaceValue
} }
requestURL = strings.Replace(requestURL, "/v1", p.Channel.Other, 1) requestURL = strings.Replace(requestURL, "/v1", replaceValue, 1)
} }
if strings.HasPrefix(baseURL, "https://gateway.ai.cloudflare.com") { if strings.HasPrefix(baseURL, "https://gateway.ai.cloudflare.com") {