@kenkaiiii/gg-ai 4.11.1 → 4.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +6 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -759,16 +759,17 @@ function toAnthropicThinking(level, maxTokens, model) {
|
|
|
759
759
|
outputConfig: { effort }
|
|
760
760
|
};
|
|
761
761
|
}
|
|
762
|
+
const VISIBLE_FLOOR = 1024;
|
|
762
763
|
const effectiveLevel = level === "xhigh" || level === "max" ? "high" : level;
|
|
763
764
|
const budgetMap = {
|
|
764
|
-
low: Math.max(1024, Math.floor(maxTokens * 0.
|
|
765
|
-
medium: Math.max(2048, Math.floor(maxTokens * 0.
|
|
766
|
-
high: Math.max(4096, maxTokens)
|
|
765
|
+
low: Math.max(1024, Math.floor(maxTokens * 0.2)),
|
|
766
|
+
medium: Math.max(2048, Math.floor(maxTokens * 0.45)),
|
|
767
|
+
high: Math.max(4096, Math.floor(maxTokens * 0.8))
|
|
767
768
|
};
|
|
768
|
-
const budget = budgetMap[effectiveLevel];
|
|
769
|
+
const budget = Math.max(0, Math.min(budgetMap[effectiveLevel], maxTokens - VISIBLE_FLOOR));
|
|
769
770
|
return {
|
|
770
771
|
thinking: { type: "enabled", budget_tokens: budget },
|
|
771
|
-
maxTokens
|
|
772
|
+
maxTokens
|
|
772
773
|
};
|
|
773
774
|
}
|
|
774
775
|
function remapToolCallId(id, idMap) {
|