diff --git a/relay/controller/text.go b/relay/controller/text.go index 3a396895..b77cb626 100644 --- a/relay/controller/text.go +++ b/relay/controller/text.go @@ -15,6 +15,7 @@ import ( "github.com/songquanpeng/one-api/relay" "github.com/songquanpeng/one-api/relay/adaptor" "github.com/songquanpeng/one-api/relay/adaptor/openai" + "github.com/songquanpeng/one-api/relay/apitype" "github.com/songquanpeng/one-api/relay/billing" billingratio "github.com/songquanpeng/one-api/relay/billing/ratio" "github.com/songquanpeng/one-api/relay/channeltype" @@ -110,8 +111,11 @@ func RelayTextHelper(c *gin.Context) *relaymodel.ErrorWithStatusCode { } func getRequestBody(c *gin.Context, meta *meta.Meta, textRequest *relaymodel.GeneralOpenAIRequest, adaptor adaptor.Adaptor) (io.Reader, error) { - if !config.EnforceIncludeUsage && meta.OriginModelName == meta.ActualModelName && meta.ChannelType != channeltype.Baichuan { - // openai also need convert + if !config.EnforceIncludeUsage && + meta.APIType == apitype.OpenAI && + meta.OriginModelName == meta.ActualModelName && + meta.ChannelType != channeltype.OpenAI && // openai also need to convert request + meta.ChannelType != channeltype.Baichuan { return c.Request.Body, nil }