fix: support AI Gateway, close #52

This commit is contained in:
CaIon
2024-02-01 17:48:55 +08:00
parent 166770eebf
commit 4274b925da
3 changed files with 9 additions and 4 deletions

View File

@@ -45,7 +45,7 @@ func testChannel(channel *model.Channel, request ChatRequest) (err error, openai
}
requestURL := common.ChannelBaseURLs[channel.Type]
if channel.Type == common.ChannelTypeAzure {
requestURL = fmt.Sprintf("%s/openai/deployments/%s/chat/completions?api-version=2023-03-15-preview", channel.GetBaseURL(), request.Model)
requestURL = getFullRequestURL(channel.GetBaseURL(), fmt.Sprintf("/openai/deployments/%s/chat/completions?api-version=2023-03-15-preview", request.Model), channel.Type)
} else {
if channel.GetBaseURL() != "" {
requestURL = channel.GetBaseURL()