@codeproxy/core 0.1.4 → 0.1.5

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.js CHANGED
@@ -1959,6 +1959,12 @@ function buildUpstreamBody(request, format, streaming, baseUrl, dropImages, reas
1959
1959
  ar.thinking = { type: "enabled", budget_tokens: 65536 };
1960
1960
  }
1961
1961
  }
1962
+ if (ar.thinking && typeof ar.thinking === "object" && "budget_tokens" in ar.thinking) {
1963
+ const budget = Number(ar.thinking.budget_tokens);
1964
+ if (budget > 0 && ar.max_tokens <= budget) {
1965
+ ar.max_tokens = budget + 1024;
1966
+ }
1967
+ }
1962
1968
  return {
1963
1969
  upstreamBody: ar,
1964
1970
  requestMetadata: buildRequestMetadata(request, ar.temperature, ar.top_p)