@dudko.dev/agent-web 0.0.20 → 0.0.21

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.d.cts CHANGED
@@ -53,6 +53,9 @@ interface IStepResult {
53
53
  * so a `budgetTokens` is mapped to the provider-specific options of the two
54
54
  * providers that take one (Anthropic, Google); provider options win over the
55
55
  * portable level by the SDK's precedence rules.
56
+ *
57
+ * WebLLM ignores the portable level: its thinking models (Qwen3) are switched
58
+ * by `extra_body.enable_thinking`, so every setting carries that too.
56
59
  */
57
60
  type ThinkingLevel = 'provider-default' | 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
58
61
  interface ThinkingConfig {
package/dist/index.d.ts CHANGED
@@ -53,6 +53,9 @@ interface IStepResult {
53
53
  * so a `budgetTokens` is mapped to the provider-specific options of the two
54
54
  * providers that take one (Anthropic, Google); provider options win over the
55
55
  * portable level by the SDK's precedence rules.
56
+ *
57
+ * WebLLM ignores the portable level: its thinking models (Qwen3) are switched
58
+ * by `extra_body.enable_thinking`, so every setting carries that too.
56
59
  */
57
60
  type ThinkingLevel = 'provider-default' | 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
58
61
  interface ThinkingConfig {
package/dist/index.js CHANGED
@@ -1566,7 +1566,8 @@ var resolveThinking = (setting) => {
1566
1566
  const cfg = normalize(setting);
1567
1567
  if (!cfg) return {};
1568
1568
  const level = cfg.level ?? "medium";
1569
- if (level === "none") return { reasoning: "none" };
1569
+ const webllm = (on) => ({ "web-llm": { extra_body: { enable_thinking: on } } });
1570
+ if (level === "none") return { reasoning: "none", providerOptions: webllm(false) };
1570
1571
  const includeThoughts = cfg.includeThoughts !== false;
1571
1572
  const budget = cfg.budgetTokens;
1572
1573
  if (typeof budget === "number" && budget > 0) {
@@ -1574,16 +1575,18 @@ var resolveThinking = (setting) => {
1574
1575
  reasoning: level,
1575
1576
  providerOptions: {
1576
1577
  anthropic: { thinking: { type: "enabled", budgetTokens: budget } },
1577
- google: { thinkingConfig: { thinkingBudget: budget, includeThoughts } }
1578
+ google: { thinkingConfig: { thinkingBudget: budget, includeThoughts } },
1579
+ ...webllm(true)
1578
1580
  }
1579
1581
  };
1580
1582
  }
1581
- if (!includeThoughts) return { reasoning: level };
1583
+ if (!includeThoughts) return { reasoning: level, providerOptions: webllm(true) };
1582
1584
  return {
1583
1585
  reasoning: level,
1584
1586
  providerOptions: {
1585
1587
  google: { thinkingConfig: { includeThoughts: true } },
1586
- openai: { reasoningSummary: "auto" }
1588
+ openai: { reasoningSummary: "auto" },
1589
+ ...webllm(true)
1587
1590
  }
1588
1591
  };
1589
1592
  };