@absolutejs/ai 0.2.6 → 0.2.8

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/ai/index.js CHANGED
@@ -512,7 +512,7 @@ var withResilience = (provider, providerName = "unknown") => {
512
512
  noteSuccess(providerName);
513
513
  } catch (err) {
514
514
  const providerError = ProviderError.from(err, providerName);
515
- const canRetry = !yielded && providerError.retryable && attemptNo < config.maxRetries && !params.signal?.aborted;
515
+ const canRetry = !yielded && providerError.retryable && attemptNo < (params.maxRetries === undefined ? config.maxRetries : Math.max(0, Math.min(config.maxRetries, params.maxRetries))) && !params.signal?.aborted;
516
516
  if (canRetry) {
517
517
  await sleep(backoffDelay(attemptNo), params.signal);
518
518
  yield* attempt(params, attemptNo + 1);
@@ -590,6 +590,7 @@ var claude46 = {
590
590
  ...claude,
591
591
  efforts: ["low", "medium", "high", "max"]
592
592
  };
593
+ var opus45 = { ...claude, efforts: ["low", "medium", "high"] };
593
594
  var haiku = profile("budget", ["none", "low", "medium", "high"], "Thinking-token budget: Low 2,048; Medium 8,192; High 16,384. Actual usage can be lower.", "https://platform.claude.com/docs/en/build-with-claude/extended-thinking");
594
595
  var gpt = profile("effort", ["none", "low", "medium", "high", "xhigh", "max"], claude.description, "https://developers.openai.com/api/docs/models/gpt-5.6-sol");
595
596
  var gemini = profile("effort", ["low", "medium", "high"], claude.description, "https://ai.google.dev/gemini-api/docs/openai");
@@ -597,12 +598,18 @@ var deepseek = profile("effort", ["none", "low", "high", "max"], claude.descript
597
598
  var mistral = profile("effort", ["none", "high"], "Minimal thinking or full reasoning. This model does not offer intermediate effort levels.", "https://docs.mistral.ai/studio/conversations/reasoning");
598
599
  var qwen = profile("budget", ["none", "low", "medium", "high"], haiku.description, "https://help.aliyun.com/en/model-studio/deep-thinking");
599
600
  var MODEL_REASONING = {
601
+ "anthropic:claude-opus-5-5": claude,
600
602
  "anthropic:claude-fable-5-1": claude,
601
603
  "anthropic:claude-opus-5": claude,
602
604
  "anthropic:claude-sonnet-5": claude,
605
+ "anthropic:claude-fable-5": claude,
606
+ "anthropic:claude-opus-4-8": claude,
607
+ "anthropic:claude-opus-4-7": claude,
603
608
  "anthropic:claude-sonnet-4-6": claude46,
604
609
  "anthropic:claude-opus-4-6": claude46,
610
+ "anthropic:claude-opus-4-5": opus45,
605
611
  "anthropic:claude-haiku-4-5": haiku,
612
+ "anthropic:claude-sonnet-4-5": haiku,
606
613
  "openai:gpt-6-astra": {
607
614
  ...gpt,
608
615
  efforts: ["low", "medium", "high", "xhigh", "max"],
@@ -5650,6 +5657,7 @@ var generateAI = async (options) => {
5650
5657
  const stream = streamWithAIContext(options.provider, {
5651
5658
  cacheSystemPrompt: options.cacheSystemPrompt,
5652
5659
  maxTokens: options.maxTokens,
5660
+ maxRetries: options.maxRetries,
5653
5661
  messages: options.messages,
5654
5662
  model: options.model,
5655
5663
  promptCaching: options.promptCaching,
@@ -5854,6 +5862,7 @@ var generateObjectAI = async (options) => {
5854
5862
  contextPolicy: options.contextPolicy,
5855
5863
  cacheSystemPrompt: options.cacheSystemPrompt,
5856
5864
  maxTokens: options.maxTokens,
5865
+ maxRetries: options.maxRetries,
5857
5866
  messages,
5858
5867
  model: options.model,
5859
5868
  promptCaching: options.promptCaching,
@@ -8900,5 +8909,5 @@ export {
8900
8909
  xai
8901
8910
  };
8902
8911
 
8903
- //# debugId=33E15B35E923B1E064756E2164756E21
8912
+ //# debugId=E09A768F1F0FB95564756E2164756E21
8904
8913
  //# sourceMappingURL=index.js.map