feat: Azure OpenAI model name automatically removes dots.

This commit is contained in:
MartialBE 2024-01-01 01:02:05 +08:00 committed by Buer
parent 3aef247fa9
commit bf5ba315ee

View File

@ -71,6 +71,12 @@ func (p *OpenAIProvider) GetFullRequestURL(requestURL string, modelName string)
} else { } else {
requestURL = fmt.Sprintf("/openai/deployments/%s%s?api-version=%s", modelName, requestURL, apiVersion) requestURL = fmt.Sprintf("/openai/deployments/%s%s?api-version=%s", modelName, requestURL, apiVersion)
} }
// 检测模型是是否包含 . 如果有则直接去掉
if strings.Contains(requestURL, ".") {
requestURL = strings.Replace(requestURL, ".", "", -1)
fmt.Println(requestURL)
}
} }
if strings.HasPrefix(baseURL, "https://gateway.ai.cloudflare.com") { if strings.HasPrefix(baseURL, "https://gateway.ai.cloudflare.com") {