ソースを参照

fix: fix Azure channel test (close #101)

CaIon 2 年 前
コミット
0640dd81fd
1 ファイル変更12 行追加0 行削除
  1. 12 0
      controller/channel-test.go

+ 12 - 0
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.Request.Header.Set("Content-Type", "application/json")
 	c.Set("channel", channel.Type)
 	c.Set("channel", channel.Type)
 	c.Set("base_url", channel.GetBaseURL())
 	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)
 	meta := relaycommon.GenRelayInfo(c)
 	apiType := constant.ChannelType2APIType(channel.Type)
 	apiType := constant.ChannelType2APIType(channel.Type)
 	adaptor := relay.GetAdaptor(apiType)
 	adaptor := relay.GetAdaptor(apiType)