@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.cjs CHANGED
@@ -1732,7 +1732,8 @@ var resolveThinking = (setting) => {
1732
1732
  const cfg = normalize(setting);
1733
1733
  if (!cfg) return {};
1734
1734
  const level = cfg.level ?? "medium";
1735
- if (level === "none") return { reasoning: "none" };
1735
+ const webllm = (on) => ({ "web-llm": { extra_body: { enable_thinking: on } } });
1736
+ if (level === "none") return { reasoning: "none", providerOptions: webllm(false) };
1736
1737
  const includeThoughts = cfg.includeThoughts !== false;
1737
1738
  const budget = cfg.budgetTokens;
1738
1739
  if (typeof budget === "number" && budget > 0) {
@@ -1740,16 +1741,18 @@ var resolveThinking = (setting) => {
1740
1741
  reasoning: level,
1741
1742
  providerOptions: {
1742
1743
  anthropic: { thinking: { type: "enabled", budgetTokens: budget } },
1743
- google: { thinkingConfig: { thinkingBudget: budget, includeThoughts } }
1744
+ google: { thinkingConfig: { thinkingBudget: budget, includeThoughts } },
1745
+ ...webllm(true)
1744
1746
  }
1745
1747
  };
1746
1748
  }
1747
- if (!includeThoughts) return { reasoning: level };
1749
+ if (!includeThoughts) return { reasoning: level, providerOptions: webllm(true) };
1748
1750
  return {
1749
1751
  reasoning: level,
1750
1752
  providerOptions: {
1751
1753
  google: { thinkingConfig: { includeThoughts: true } },
1752
- openai: { reasoningSummary: "auto" }
1754
+ openai: { reasoningSummary: "auto" },
1755
+ ...webllm(true)
1753
1756
  }
1754
1757
  };
1755
1758
  };