mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-08-29 14:10:50 +02:00
37 lines
1.0 KiB
Go
37 lines
1.0 KiB
Go
package multiagent
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"cyberstrike-ai/internal/config"
|
|
copenai "cyberstrike-ai/internal/openai"
|
|
)
|
|
|
|
// stripReasoningFromSummarizationPayload removes thinking / reasoning fields from a
|
|
// chat-completions JSON body. Applied only to summarization Generate calls via
|
|
// model.ModelOptions on the shared ChatModel — main-agent requests are unchanged.
|
|
func stripReasoningFromSummarizationPayload(rawBody []byte, oa *config.OpenAIConfig) ([]byte, error) {
|
|
if shouldDisableDeepSeekThinkingForSummarization(oa) {
|
|
return copenai.DisableThinkingForChatCompletionBody(rawBody)
|
|
}
|
|
return copenai.StripReasoningFromChatCompletionBody(rawBody)
|
|
}
|
|
|
|
func shouldDisableDeepSeekThinkingForSummarization(oa *config.OpenAIConfig) bool {
|
|
if oa == nil {
|
|
return false
|
|
}
|
|
if oa.IsDeepSeekEndpointOrModel() {
|
|
return true
|
|
}
|
|
profile := strings.ToLower(strings.TrimSpace(oa.Reasoning.ProfileEffective()))
|
|
switch profile {
|
|
case "deepseek", "deepseek_compat":
|
|
return true
|
|
case "", "auto":
|
|
return false
|
|
default:
|
|
return false
|
|
}
|
|
}
|