feat: Update request URL handling for Azure responses based on base URL

This commit is contained in:
CaIon
2025-08-10 21:09:16 +08:00
parent 7f462a084c
commit 92022360de

View File

@@ -132,7 +132,13 @@ func (a *Adaptor) GetRequestURL(info *relaycommon.RelayInfo) (string, error) {
if info.ChannelOtherSettings.AzureResponsesVersion != "" {
responsesApiVersion = info.ChannelOtherSettings.AzureResponsesVersion
}
requestURL = fmt.Sprintf("/openai/v1/responses?api-version=%s", responsesApiVersion)
subUrl := "/openai/v1/responses"
if strings.Contains(info.BaseUrl, "cognitiveservices.azure.com") {
subUrl = "/openai/responses"
}
requestURL = fmt.Sprintf("%s?api-version=%s", subUrl, responsesApiVersion)
return relaycommon.GetFullRequestURL(info.BaseUrl, requestURL, info.ChannelType), nil
}