mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-04-19 11:28:38 +00:00
19 lines
562 B
Go
19 lines
562 B
Go
package openaicompat
|
|
|
|
import "github.com/QuantumNous/new-api/setting/model_setting"
|
|
|
|
func ShouldChatCompletionsUseResponsesPolicy(policy model_setting.ChatCompletionsToResponsesPolicy, channelID int, model string) bool {
|
|
if !policy.IsChannelEnabled(channelID) {
|
|
return false
|
|
}
|
|
return matchAnyRegex(policy.ModelPatterns, model)
|
|
}
|
|
|
|
func ShouldChatCompletionsUseResponsesGlobal(channelID int, model string) bool {
|
|
return ShouldChatCompletionsUseResponsesPolicy(
|
|
model_setting.GetGlobalSettings().ChatCompletionsToResponsesPolicy,
|
|
channelID,
|
|
model,
|
|
)
|
|
}
|