|
@@ -295,9 +295,13 @@ func relayErrorHandler(resp *http.Response) (openAIErrorWithStatusCode *OpenAIEr
|
|
|
|
|
|
|
|
func getFullRequestURL(baseURL string, requestURL string, channelType int) string {
|
|
func getFullRequestURL(baseURL string, requestURL string, channelType int) string {
|
|
|
fullRequestURL := fmt.Sprintf("%s%s", baseURL, requestURL)
|
|
fullRequestURL := fmt.Sprintf("%s%s", baseURL, requestURL)
|
|
|
- if channelType == common.ChannelTypeOpenAI {
|
|
|
|
|
- if strings.HasPrefix(baseURL, "https://gateway.ai.cloudflare.com") {
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if strings.HasPrefix(baseURL, "https://gateway.ai.cloudflare.com") {
|
|
|
|
|
+ switch channelType {
|
|
|
|
|
+ case common.ChannelTypeOpenAI:
|
|
|
fullRequestURL = fmt.Sprintf("%s%s", baseURL, strings.TrimPrefix(requestURL, "/v1"))
|
|
fullRequestURL = fmt.Sprintf("%s%s", baseURL, strings.TrimPrefix(requestURL, "/v1"))
|
|
|
|
|
+ case common.ChannelTypeAzure:
|
|
|
|
|
+ fullRequestURL = fmt.Sprintf("%s%s", baseURL, strings.TrimPrefix(requestURL, "/openai/deployments"))
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
return fullRequestURL
|
|
return fullRequestURL
|