Skip to content

Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.

cmd: use slices.Contains to simplify code (#12249)

fengyuchuanshen8a7e2055d219
diff --git a/cmd/cmd.go b/cmd/cmd.go
index 8fe068655..19f1e192f 100644
--- a/cmd/cmd.go
+++ b/cmd/cmd.go
@@ -56,10 +56,8 @@ func ensureThinkingSupport(ctx context.Context, client *api.Client, name string)
if err != nil {
return
}
- for _, cap := range resp.Capabilities {
- if cap == model.CapabilityThinking {
- return
- }
+ if slices.Contains(resp.Capabilities, model.CapabilityThinking) {
+ return
}
fmt.Fprintf(os.Stderr, "warning: model %q does not support thinking output\n", name)
}