From f19b11be8c6dceefee9d1dbaad69d26c140502ba Mon Sep 17 00:00:00 2001 From: CaIon <1808837298@qq.com> Date: Thu, 1 Feb 2024 19:27:00 +0800 Subject: [PATCH] fix: fix test channel --- controller/channel-test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/controller/channel-test.go b/controller/channel-test.go index 20288ad..3c3e94b 100644 --- a/controller/channel-test.go +++ b/controller/channel-test.go @@ -47,7 +47,11 @@ func testChannel(channel *model.Channel, request ChatRequest) (err error, openai request.Model = "gpt-3.5-turbo" } } - requestURL := getFullRequestURL(channel.GetBaseURL(), "/v1/chat/completions", channel.Type) + baseUrl := common.ChannelBaseURLs[channel.Type] + if channel.GetBaseURL() != "" { + baseUrl = channel.GetBaseURL() + } + requestURL := getFullRequestURL(baseUrl, "/v1/chat/completions", channel.Type) if channel.Type == common.ChannelTypeAzure { requestURL = getFullRequestURL(channel.GetBaseURL(), fmt.Sprintf("/openai/deployments/%s/chat/completions?api-version=2023-03-15-preview", request.Model), channel.Type)