@ai-sdk/anthropic 4.0.72 → 4.0.73

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/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @ai-sdk/anthropic
2
2
 
3
+ ## 4.0.73
4
+
5
+ ### Patch Changes
6
+
7
+ - fc1e19e: fix: limit jsonl rows to 64mb during batch result downloads
8
+ - 268225c: feat(provider): add a portable `max` reasoning level with native provider mappings, compatibility coercions, and budget-based fallback support.
9
+
10
+ Compatibility notes:
11
+
12
+ - **TypeScript source compatibility:** Adding `max` widens `LanguageModelV4CallOptions['reasoning']` and the derived `ReasoningLevel` type. Third-party providers and consumers with exhaustive switches or `Record<ReasoningLevel, ...>` mappings must handle `max` before upgrading. Ordinary calls using existing reasoning levels remain accepted.
13
+ - **Amazon Bedrock:** Existing Nova 2 calls using portable `reasoning: 'xhigh'` now send `maxReasoningEffort: 'high'` instead of the unsupported `'max'`, and return a compatibility warning. Anthropic and OpenAI Bedrock effort mappings retain their existing `xhigh` behavior. Partial Bedrock reasoning configurations continue to preserve explicit values and derive missing fields; explicit effort/budget overrides and disabled thinking no longer emit warnings for portable mappings that are not sent.
14
+ - **Fireworks:** Existing portable `minimal` and `xhigh` calls keep their request mappings to `low` and `high`, respectively, and now return compatibility warnings in generation and streaming results. Portable `max` maps to `high` with the same warning behavior.
15
+
16
+ **Release classification:** This remains a patch changeset under the repository's explicit release policy, which uses patch releases for both fixes and features. The TypeScript source-compatibility caveat for exhaustive consumers is disclosed above. Maintainers can override this classification with a `major` label if they decide to align the provider-spec addition with a future AI SDK major release.
17
+
18
+ - 0af2f7c: chore: upgrade to TypeScript 6
19
+ - Updated dependencies [fc1e19e]
20
+ - Updated dependencies [5094ebd]
21
+ - Updated dependencies [268225c]
22
+ - Updated dependencies [0af2f7c]
23
+ - @ai-sdk/provider-utils@5.0.55
24
+ - @ai-sdk/provider@4.0.23
25
+
3
26
  ## 4.0.72
4
27
 
5
28
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1484,6 +1484,11 @@ interface AnthropicProvider extends ProviderV4 {
1484
1484
  tools: typeof anthropicTools;
1485
1485
  }
1486
1486
  interface AnthropicProviderSettings {
1487
+ /** Settings for downloading JSON Lines batch results. */
1488
+ batchResultDownloads?: {
1489
+ /** Maximum UTF-8 bytes per row, excluding LF. Defaults to 64 MiB. */
1490
+ maxLineBytes?: number;
1491
+ };
1487
1492
  /**
1488
1493
  * Use a different URL prefix for API calls, e.g. to use proxy servers.
1489
1494
  * The default prefix is `https://api.anthropic.com/v1`.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["SandboxSession","SandboxSession","_$__tool_computer_toolset_202608010.ComputerToolset_20260801Member","DecisionModelV4","BatchV4"],"sources":["../src/anthropic-api.ts","../src/anthropic-message-metadata.ts","../src/anthropic-language-model-options.ts","../src/anthropic-prepare-tools.ts","../src/tool/computer-toolset_20260801.ts","../src/tool/bash_20241022.ts","../src/tool/bash_20250124.ts","../src/anthropic-tools.ts","../src/anthropic-provider.ts","../src/forward-anthropic-container-id-from-last-step.ts","../src/version.ts"],"mappings":";;;;cAmrBM,gCAA8B,EAAA;;;;;;;;;;GAelC,EAAA,KAAA;KAEU,2BAA2B,EAAE,aAChC;;;;;;;;;;;;;;;;;;KCnrBG;EACV;;;;;;EAOA;;;;EAKA;;;;EAKA;;;;EAKA;;;;EAKA;;UAGe;EACf,OAAO;EACP;;;;;;;EAQA,uBAAuB;IACrB;IACA;IACA;;;;;;;;;;;;;EAcF,mBAAmB;;;;;;;;;;EAWnB;;;;;IAKE;;;;;IAMA;;;;;IAMA;;;;;;IAOA;;;;;;;;;EAUF,YAAY;;;;;;;EAQZ;;;;IAIE;;;;IAKA;;;;IAKA,QAAQ;;;;MAIN;;;;MAKA;;;;MAKA;;;;;;;;EASJ;;;;;IAKE,cAAc;;;;;;;;;MASR;;;;;MAMA;;;;;MAMA;;;;;;;;;;MAUA;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAJlB;MACF;MACJ;MAEwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAHxB;MACA;MAEa;MACK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UCJJ,0BAA0B;;;;GAIxC,SAAS,mBAAmB;;;;EAK7B,cAAc,SAAS,mBAAmB;EAE1C,KAAK,SAAS,mBAAmB;EAEjC,SAAS,SAAS,mBAAmB;;EAGrC,cAAc,SAAS,mBAAmBE;;EAE1C,gBAAgB,SAAS,mBAAmBA;IAC1C,YAAYA;;EAGd,sBAAsBC;IAAU,MAAM;;;;;EAKtC,mBAAmB;EAEnB,SAAS;;;;EAKT,UAAU;;;;EAKV,cAAc;;UAGC;;;;;EAKf;;;;;;EAOA;;;;;;EAOA;;;;EAKA,UAAU;;;;;EAMV,QAAQ;EAER;;;;;EAMA;;;;;wBAMc,gBACd,UAAS,4BACR;;;;qBAyHU,WAAS;;;;;;;;;;wBChPN,0CACd;EAEA,OAAO;IACL,mBAAmB,eAAe;;;EAEpB,kBAAkB,eAAe;;;;qBCdtC"}
1
+ {"version":3,"file":"index.d.ts","names":["SandboxSession","SandboxSession","_$__tool_computer_toolset_202608010.ComputerToolset_20260801Member","DecisionModelV4","BatchV4"],"sources":["../src/anthropic-api.ts","../src/anthropic-message-metadata.ts","../src/anthropic-language-model-options.ts","../src/anthropic-prepare-tools.ts","../src/tool/computer-toolset_20260801.ts","../src/tool/bash_20241022.ts","../src/tool/bash_20250124.ts","../src/anthropic-tools.ts","../src/anthropic-provider.ts","../src/forward-anthropic-container-id-from-last-step.ts","../src/version.ts"],"mappings":";;;;cAmrBM,gCAA8B,EAAA;;;;;;;;;;GAelC,EAAA,KAAA;KAEU,2BAA2B,EAAE,aAChC;;;;;;;;;;;;;;;;;;KCnrBG;EACV;;;;;;EAOA;;;;EAKA;;;;EAKA;;;;EAKA;;;;EAKA;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAnEiD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAQP;MACF;MACJ;MAEwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAJlB;MACF;MACJ;MAEwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAHxB;MACA;MAEa;MACK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UCJJ,0BAA0B;;;;GAIxC,SAAS,mBAAmB;;;;EAK7B,cAAc,SAAS,mBAAmB;EAE1C,KAAK,SAAS,mBAAmB;EAEjC,SAAS,SAAS,mBAAmB;;EAGrC,cAAc,SAAS,mBAAmBE;;EAE1C,gBAAgB,SAAS,mBAAmBA;IAC1C,YAAYA;;EAGd,sBAAsBC;IAAU,MAAM;;;;;EAKtC,mBAAmB;EAEnB,SAAS;;;;EAKT,UAAU;;;;EAKV,cAAc;;UAGC;;EAEf;;IAEE;;;;;;EAOF;;;;;;EAOA;;;;;;EAOA;;;;EAKA,UAAU;;;;;EAMV,QAAQ;EAER;;;;;EAMA;;;;;wBAMc,gBACd,UAAS,4BACR;;;;qBA0HU,WAAS;;;;;;;;;;wBCvPN,0CACd;EAEA,OAAO;IACL,mBAAmB,eAAe;;;EAEpB,kBAAkB,eAAe;;;;qBCdtC"}
package/dist/index.js CHANGED
@@ -5379,7 +5379,8 @@ function resolveAnthropicReasoningConfig({ reasoning, modelId, supportsAdaptiveT
5379
5379
  low: "low",
5380
5380
  medium: "medium",
5381
5381
  high: "high",
5382
- xhigh: supportsXhighEffort ? "xhigh" : "max"
5382
+ xhigh: supportsXhighEffort ? "xhigh" : "max",
5383
+ max: "max"
5383
5384
  },
5384
5385
  warnings
5385
5386
  })
@@ -5639,7 +5640,7 @@ var AnthropicBatch = class {
5639
5640
  trustedOrigin: this.options.config.baseURL,
5640
5641
  headers: await this.getBatchHeaders(options.headers),
5641
5642
  failedResponseHandler: anthropicFailedResponseHandler,
5642
- successfulResponseHandler: createJsonLinesResponseHandler(anthropicBatchResultLineSchema),
5643
+ successfulResponseHandler: createJsonLinesResponseHandler(anthropicBatchResultLineSchema, { maxLineBytes: this.options.maxLineBytes }),
5643
5644
  abortSignal: options.abortSignal,
5644
5645
  fetch: this.options.config.fetch
5645
5646
  });
@@ -6839,7 +6840,7 @@ var AnthropicSkills = class {
6839
6840
  };
6840
6841
  //#endregion
6841
6842
  //#region src/version.ts
6842
- const VERSION = "4.0.72";
6843
+ const VERSION = "4.0.73";
6843
6844
  //#endregion
6844
6845
  //#region src/anthropic-provider.ts
6845
6846
  const ANTHROPIC_API_URL = "https://api.anthropic.com";
@@ -6888,6 +6889,7 @@ function createAnthropic(options = {}) {
6888
6889
  const createChatModel = (modelId) => new AnthropicLanguageModel(modelId, languageModelConfig);
6889
6890
  const createBatch = () => new AnthropicBatch({
6890
6891
  provider: `${providerName.replace(/\.messages$/, "")}.batch`,
6892
+ maxLineBytes: options.batchResultDownloads?.maxLineBytes,
6891
6893
  config: languageModelConfig,
6892
6894
  supportedUrls
6893
6895
  });