package oaichat import ( "github.com/QuantumNous/new-api/service/relayconvert/internal/matcher" "github.com/QuantumNous/new-api/setting/model_setting" ) func ShouldChatCompletionsUseResponsesPolicy(policy model_setting.ChatCompletionsToResponsesPolicy, channelID int, channelType int, model string) bool { if !policy.IsChannelEnabled(channelID, channelType) { return false } return matcher.MatchAnyRegex(policy.ModelPatterns, model) } func ShouldChatCompletionsUseResponsesGlobal(channelID int, channelType int, model string) bool { return ShouldChatCompletionsUseResponsesPolicy( model_setting.GetGlobalSettings().ChatCompletionsToResponsesPolicy, channelID, channelType, model, ) }