mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-06-10 08:13:59 +02:00
31 lines
836 B
Go
31 lines
836 B
Go
package multiagent
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestStripReasoningFromSummarizationPayload(t *testing.T) {
|
|
in := []byte(`{"model":"deepseek-chat","messages":[],"thinking":{"type":"enabled"},"reasoning_effort":"high"}`)
|
|
out, err := stripReasoningFromSummarizationPayload(in)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
s := string(out)
|
|
if strings.Contains(s, "thinking") || strings.Contains(s, "reasoning_effort") {
|
|
t.Fatalf("expected reasoning fields stripped, got %s", s)
|
|
}
|
|
if !strings.Contains(s, `"model":"deepseek-chat"`) {
|
|
t.Fatalf("expected model preserved, got %s", s)
|
|
}
|
|
|
|
plain := []byte(`{"model":"gpt-4o","messages":[]}`)
|
|
out2, err := stripReasoningFromSummarizationPayload(plain)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if string(out2) != string(plain) {
|
|
t.Fatalf("expected unchanged payload, got %s", out2)
|
|
}
|
|
}
|