feat: 移除 azure model 的 TrimSuffix (#1193)

This commit is contained in:
GuangxiaoLong 2024-03-24 21:47:46 +08:00 committed by GitHub
parent 4ae311e964
commit e96b173abe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -31,11 +31,8 @@ func (a *Adaptor) GetRequestURL(meta *util.RelayMeta) (string, error) {
task := strings.TrimPrefix(requestURL, "/v1/") task := strings.TrimPrefix(requestURL, "/v1/")
model_ := meta.ActualModelName model_ := meta.ActualModelName
model_ = strings.Replace(model_, ".", "", -1) model_ = strings.Replace(model_, ".", "", -1)
// https://github.com/songquanpeng/one-api/issues/67 //https://github.com/songquanpeng/one-api/issues/1191
model_ = strings.TrimSuffix(model_, "-0301") // {your endpoint}/openai/deployments/{your azure_model}/chat/completions?api-version={api_version}
model_ = strings.TrimSuffix(model_, "-0314")
model_ = strings.TrimSuffix(model_, "-0613")
requestURL = fmt.Sprintf("/openai/deployments/%s/%s", model_, task) requestURL = fmt.Sprintf("/openai/deployments/%s/%s", model_, task)
return util.GetFullRequestURL(meta.BaseURL, requestURL, meta.ChannelType), nil return util.GetFullRequestURL(meta.BaseURL, requestURL, meta.ChannelType), nil
case common.ChannelTypeMinimax: case common.ChannelTypeMinimax: