Kaynağa Gözat

tweak: for zai ensure clear_thinking is false

Aiden Cline 1 ay önce
ebeveyn
işleme
b4ad5c138e
1 değiştirilmiş dosya ile 7 ekleme ve 0 silme
  1. 7 0
      packages/opencode/src/provider/transform.ts

+ 7 - 0
packages/opencode/src/provider/transform.ts

@@ -476,6 +476,13 @@ export namespace ProviderTransform {
       result["chat_template_args"] = { enable_thinking: true }
     }
 
+    if (["zai", "zhipuai"].includes(model.providerID) && model.api.npm === "@ai-sdk/openai-compatible") {
+      result["thinking"] = {
+        type: "enabled",
+        clear_thinking: false,
+      }
+    }
+
     if (model.providerID === "openai" || providerOptions?.setCacheKey) {
       result["promptCacheKey"] = sessionID
     }