fix: Compatible with Azure GPT4.1 series models, users do not need to manually delete the dot in the name when creating a deployment (#2235)

This commit is contained in:
voidking 2025-04-17 11:21:32 +08:00
parent 8df4a2670b
commit 1280ec6891

View File

@ -45,7 +45,8 @@ func (a *Adaptor) GetRequestURL(meta *meta.Meta) (string, error) {
requestURL = fmt.Sprintf("%s?api-version=%s", requestURL, meta.Config.APIVersion)
task := strings.TrimPrefix(requestURL, "/v1/")
model_ := meta.ActualModelName
model_ = strings.Replace(model_, ".", "", -1)
// https://github.com/songquanpeng/one-api/issues/2235
// model_ = strings.Replace(model_, ".", "", -1)
//https://github.com/songquanpeng/one-api/issues/1191
// {your endpoint}/openai/deployments/{your azure_model}/chat/completions?api-version={api_version}
requestURL = fmt.Sprintf("/openai/deployments/%s/%s", model_, task)