diff --git a/controller/channel-test.go b/controller/channel-test.go index dae6eb17..9137407d 100644 --- a/controller/channel-test.go +++ b/controller/channel-test.go @@ -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" diff --git a/controller/relay-text.go b/controller/relay-text.go index 44be0fef..2e1a596a 100644 --- a/controller/relay-text.go +++ b/controller/relay-text.go @@ -31,12 +31,8 @@ func relayTextHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode { } baseURL := common.ChannelBaseURLs[channelType] requestURL := c.Request.URL.String() - if channelType == common.ChannelTypeCustom { + if c.GetString("base_url") != "" { baseURL = c.GetString("base_url") - } else if channelType == common.ChannelTypeOpenAI { - if c.GetString("base_url") != "" { - baseURL = c.GetString("base_url") - } } fullRequestURL := fmt.Sprintf("%s%s", baseURL, requestURL) if channelType == common.ChannelTypeAzure { diff --git a/web/src/pages/Channel/EditChannel.js b/web/src/pages/Channel/EditChannel.js index e25ab2de..0e544d47 100644 --- a/web/src/pages/Channel/EditChannel.js +++ b/web/src/pages/Channel/EditChannel.js @@ -177,6 +177,20 @@ const EditChannel = () => { ) } + { + inputs.type !== 3 && inputs.type !== 8 && ( + + + + ) + }