mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-14 03:52:26 +08:00
style: satisfy Sonnet 5.5 lint checks
This commit is contained in:
@@ -1830,10 +1830,11 @@ func TestSonnet55RejectsUnsupportedParametersBeforeMimicry(t *testing.T) {
|
||||
for _, count := range []bool{false, true} {
|
||||
model := "claude-sonnet-5-5"
|
||||
account := &Account{ID: 1, Platform: PlatformAnthropic, Type: typ}
|
||||
if typ == AccountTypeAPIKey {
|
||||
switch typ {
|
||||
case AccountTypeAPIKey:
|
||||
model = "public-sonnet"
|
||||
account.Credentials = map[string]any{"model_mapping": map[string]any{model: "claude-sonnet-5-5"}}
|
||||
} else if typ == AccountTypeBedrock {
|
||||
case AccountTypeBedrock:
|
||||
account.Credentials = map[string]any{"aws_region": "eu-west-1"}
|
||||
}
|
||||
body := []byte(`{"model":"` + model + `","messages":[{"role":"user","content":"hello"}],` + field + `}`)
|
||||
|
||||
@@ -736,7 +736,7 @@ func FilterThinkingBlocksForRetry(body []byte, mappedModel string) []byte {
|
||||
// Disable top-level thinking mode for retry to avoid structural/signature constraints upstream.
|
||||
thinkingMode := gjson.Get(jsonStr, "thinking.type").String()
|
||||
deleteTopLevelThinking := gjson.Get(jsonStr, "thinking").Exists() &&
|
||||
!(claude.IsSonnet55(mappedModel) && thinkingMode == "between_tools")
|
||||
(!claude.IsSonnet55(mappedModel) || thinkingMode != "between_tools")
|
||||
|
||||
for i := 0; i < len(messages); i++ {
|
||||
msgMap, ok := messages[i].(map[string]any)
|
||||
|
||||
Reference in New Issue
Block a user