mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-05-13 11:07:31 +08:00
feat: align cliproxyapi providers and auto fallback
This commit is contained in:
23
pkg/providers/qwen_provider_test.go
Normal file
23
pkg/providers/qwen_provider_test.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package providers
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestBuildQwenChatRequestSupportsExtendedThinkingSuffixes(t *testing.T) {
|
||||
base := NewHTTPProvider("qwen", "token", qwenCompatBaseURL, "qwen-max", false, "oauth", 5*time.Second, nil)
|
||||
autoBody := buildQwenChatRequest(base, []Message{{Role: "user", Content: "hi"}}, nil, "qwen-max(-1)", nil, false)
|
||||
if got := autoBody["reasoning_effort"]; got != "auto" {
|
||||
t.Fatalf("reasoning_effort = %#v, want auto", got)
|
||||
}
|
||||
disableBody := buildQwenChatRequest(base, []Message{{Role: "user", Content: "hi"}}, nil, "qwen-max(0)", nil, false)
|
||||
thinking, _ := disableBody["thinking"].(map[string]interface{})
|
||||
if got := thinking["type"]; got != "disabled" {
|
||||
t.Fatalf("thinking.type = %#v, want disabled", got)
|
||||
}
|
||||
minimalBody := buildQwenChatRequest(base, []Message{{Role: "user", Content: "hi"}}, nil, "qwen-max(minimal)", nil, false)
|
||||
if got := minimalBody["reasoning_effort"]; got != "low" {
|
||||
t.Fatalf("reasoning_effort = %#v, want low", got)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user