mirror of
https://github.com/CJackHwang/ds2api.git
synced 2026-05-21 00:17:44 +08:00
fix: align tool call protocol and thinking controls
This commit is contained in:
@@ -27,13 +27,24 @@ func TestResolveThinkingEnabledUsesExtraBodyFallback(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestResolveThinkingEnabledMapsReasoningEffortToEnabled(t *testing.T) {
|
||||
for _, effort := range []string{"low", "medium", "high", "xhigh"} {
|
||||
for _, effort := range []string{"minimal", "low", "medium", "high", "xhigh"} {
|
||||
if got := ResolveThinkingEnabled(map[string]any{"reasoning_effort": effort}, false); !got {
|
||||
t.Fatalf("expected reasoning_effort=%s to enable thinking", effort)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestResolveThinkingEnabledMapsReasoningObject(t *testing.T) {
|
||||
req := map[string]any{"reasoning": map[string]any{"effort": "none"}}
|
||||
if got := ResolveThinkingEnabled(req, true); got {
|
||||
t.Fatalf("expected reasoning.effort=none to disable thinking")
|
||||
}
|
||||
req = map[string]any{"reasoning": map[string]any{"effort": "medium"}}
|
||||
if got := ResolveThinkingEnabled(req, false); !got {
|
||||
t.Fatalf("expected reasoning.effort=medium to enable thinking")
|
||||
}
|
||||
}
|
||||
|
||||
func TestResolveThinkingEnabledDefaultsWhenUnset(t *testing.T) {
|
||||
if !ResolveThinkingEnabled(nil, true) {
|
||||
t.Fatal("expected default thinking=true when unset")
|
||||
|
||||
Reference in New Issue
Block a user