From 0640dd81fd9a6b1626b7df27e4c8046c410d59c7 Mon Sep 17 00:00:00 2001 From: CaIon <1808837298@qq.com> Date: Fri, 8 Mar 2024 20:06:17 +0800 Subject: [PATCH] fix: fix Azure channel test (close #101) --- controller/channel-test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/controller/channel-test.go b/controller/channel-test.go index 79929e65..b14ee6ac 100644 --- a/controller/channel-test.go +++ b/controller/channel-test.go @@ -40,6 +40,18 @@ func testChannel(channel *model.Channel, testModel string) (err error, openaiErr c.Request.Header.Set("Content-Type", "application/json") c.Set("channel", channel.Type) c.Set("base_url", channel.GetBaseURL()) + switch channel.Type { + case common.ChannelTypeAzure: + c.Set("api_version", channel.Other) + case common.ChannelTypeXunfei: + c.Set("api_version", channel.Other) + //case common.ChannelTypeAIProxyLibrary: + // c.Set("library_id", channel.Other) + case common.ChannelTypeGemini: + c.Set("api_version", channel.Other) + case common.ChannelTypeAli: + c.Set("plugin", channel.Other) + } meta := relaycommon.GenRelayInfo(c) apiType := constant.ChannelType2APIType(channel.Type) adaptor := relay.GetAdaptor(apiType)