🔖 chore: allow to remove openai version number (#232)
This commit is contained in:
parent
23f7dd0612
commit
7d90e43492
@ -111,7 +111,13 @@ func (p *OpenAIProvider) GetFullRequestURL(requestURL string, modelName string)
|
||||
}
|
||||
|
||||
} else if p.Channel.Type == config.ChannelTypeCustom && p.Channel.Other != "" {
|
||||
requestURL = strings.Replace(requestURL, "v1", p.Channel.Other, 1)
|
||||
if p.Channel.Other == "disable" {
|
||||
p.Channel.Other = ""
|
||||
} else {
|
||||
p.Channel.Other = "/" + p.Channel.Other
|
||||
}
|
||||
|
||||
requestURL = strings.Replace(requestURL, "/v1", p.Channel.Other, 1)
|
||||
}
|
||||
|
||||
if strings.HasPrefix(baseURL, "https://gateway.ai.cloudflare.com") {
|
||||
|
@ -58,7 +58,8 @@ const typeConfig = {
|
||||
other: '替换 API 版本'
|
||||
},
|
||||
prompt: {
|
||||
other: '输入后,会替换请求地址中的v1,例如:freeapi,则请求chat时会变成https://xxx.com/freeapi/chat/completions'
|
||||
other:
|
||||
'输入后,会替换请求地址中的v1,例如:freeapi,则请求chat时会变成https://xxx.com/freeapi/chat/completions,如果需要禁用版本号,请输入 disable'
|
||||
}
|
||||
},
|
||||
3: {
|
||||
|
Loading…
Reference in New Issue
Block a user