@kenkaiiii/gg-ai 4.11.2 → 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.cjs
CHANGED
|
@@ -813,16 +813,17 @@ function toAnthropicThinking(level, maxTokens, model) {
|
|
|
813
813
|
outputConfig: { effort }
|
|
814
814
|
};
|
|
815
815
|
}
|
|
816
|
+
const VISIBLE_FLOOR = 1024;
|
|
816
817
|
const effectiveLevel = level === "xhigh" || level === "max" ? "high" : level;
|
|
817
818
|
const budgetMap = {
|
|
818
|
-
low: Math.max(1024, Math.floor(maxTokens * 0.
|
|
819
|
-
medium: Math.max(2048, Math.floor(maxTokens * 0.
|
|
820
|
-
high: Math.max(4096, maxTokens)
|
|
819
|
+
low: Math.max(1024, Math.floor(maxTokens * 0.2)),
|
|
820
|
+
medium: Math.max(2048, Math.floor(maxTokens * 0.45)),
|
|
821
|
+
high: Math.max(4096, Math.floor(maxTokens * 0.8))
|
|
821
822
|
};
|
|
822
|
-
const budget = budgetMap[effectiveLevel];
|
|
823
|
+
const budget = Math.max(0, Math.min(budgetMap[effectiveLevel], maxTokens - VISIBLE_FLOOR));
|
|
823
824
|
return {
|
|
824
825
|
thinking: { type: "enabled", budget_tokens: budget },
|
|
825
|
-
maxTokens
|
|
826
|
+
maxTokens
|
|
826
827
|
};
|
|
827
828
|
}
|
|
828
829
|
function remapToolCallId(id, idMap) {
|