chore: reorganize relay related package

This commit is contained in:
JustSong
2024-04-06 01:31:44 +08:00
parent 8f4d78e24d
commit f70506eac1
23 changed files with 113 additions and 102 deletions

View File

@@ -14,6 +14,7 @@ import (
"github.com/songquanpeng/one-api/monitor"
"github.com/songquanpeng/one-api/relay/channeltype"
"github.com/songquanpeng/one-api/relay/helper"
"github.com/songquanpeng/one-api/relay/meta"
relaymodel "github.com/songquanpeng/one-api/relay/model"
"github.com/songquanpeng/one-api/relay/relaymode"
"github.com/songquanpeng/one-api/relay/util"
@@ -57,7 +58,7 @@ func testChannel(channel *model.Channel) (err error, openaiErr *relaymodel.Error
c.Set("channel", channel.Type)
c.Set("base_url", channel.GetBaseURL())
middleware.SetupContextForSelectedChannel(c, channel, "")
meta := util.GetRelayMeta(c)
meta := meta.GetByContext(c)
apiType := channeltype.ToAPIType(channel.Type)
adaptor := helper.GetAdaptor(apiType)
if adaptor == nil {