diff --git a/controller/channel-test.go b/controller/channel-test.go index b498f4f1..485d7702 100644 --- a/controller/channel-test.go +++ b/controller/channel-test.go @@ -8,6 +8,7 @@ import ( "github.com/songquanpeng/one-api/common" "github.com/songquanpeng/one-api/common/config" "github.com/songquanpeng/one-api/common/logger" + "github.com/songquanpeng/one-api/middleware" "github.com/songquanpeng/one-api/model" "github.com/songquanpeng/one-api/relay/constant" "github.com/songquanpeng/one-api/relay/helper" @@ -51,6 +52,7 @@ func testChannel(channel *model.Channel) (err error, openaiErr *relaymodel.Error c.Request.Header.Set("Content-Type", "application/json") c.Set("channel", channel.Type) c.Set("base_url", channel.GetBaseURL()) + middleware.SetupContextForSelectedChannel(c, channel, "") meta := util.GetRelayMeta(c) apiType := constant.ChannelType2APIType(channel.Type) adaptor := helper.GetAdaptor(apiType)