mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-10-29 12:53:42 +08:00
feat: support custom base url for channels
This commit is contained in:
@@ -25,9 +25,7 @@ func testChannel(channel *model.Channel, request ChatRequest) error {
|
||||
if channel.Type == common.ChannelTypeAzure {
|
||||
requestURL = fmt.Sprintf("%s/openai/deployments/%s/chat/completions?api-version=2023-03-15-preview", channel.BaseURL, request.Model)
|
||||
} else {
|
||||
if channel.Type == common.ChannelTypeCustom {
|
||||
requestURL = channel.BaseURL
|
||||
} else if channel.Type == common.ChannelTypeOpenAI && channel.BaseURL != "" {
|
||||
if channel.BaseURL != "" {
|
||||
requestURL = channel.BaseURL
|
||||
}
|
||||
requestURL += "/v1/chat/completions"
|
||||
|
||||
Reference in New Issue
Block a user