@ai-sdk/anthropic 2.0.75 → 2.0.77
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 +13 -0
- package/README.md +2 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +21 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -5
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +20 -2
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +21 -4
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -11,12 +11,11 @@ import {
|
|
|
11
11
|
} from "@ai-sdk/provider-utils";
|
|
12
12
|
|
|
13
13
|
// src/version.ts
|
|
14
|
-
var VERSION = true ? "2.0.
|
|
14
|
+
var VERSION = true ? "2.0.77" : "0.0.0-test";
|
|
15
15
|
|
|
16
16
|
// src/anthropic-messages-language-model.ts
|
|
17
17
|
import {
|
|
18
|
-
APICallError
|
|
19
|
-
UnsupportedFunctionalityError as UnsupportedFunctionalityError3
|
|
18
|
+
APICallError
|
|
20
19
|
} from "@ai-sdk/provider";
|
|
21
20
|
import {
|
|
22
21
|
combineHeaders,
|
|
@@ -724,6 +723,15 @@ var anthropicProviderOptions = z3.object({
|
|
|
724
723
|
* Only supported with claude-opus-4-6.
|
|
725
724
|
*/
|
|
726
725
|
speed: z3.enum(["fast", "standard"]).optional(),
|
|
726
|
+
/**
|
|
727
|
+
* Controls where model inference runs for this request.
|
|
728
|
+
*
|
|
729
|
+
* - `"global"`: Inference may run in any available geography (default).
|
|
730
|
+
* - `"us"`: Inference runs only in US-based infrastructure.
|
|
731
|
+
*
|
|
732
|
+
* See https://platform.claude.com/docs/en/build-with-claude/data-residency
|
|
733
|
+
*/
|
|
734
|
+
inferenceGeo: z3.enum(["us", "global"]).optional(),
|
|
727
735
|
/**
|
|
728
736
|
* Context management configuration for automatic context window management.
|
|
729
737
|
* Enables features like automatic compaction and clearing of tool uses/thinking blocks.
|
|
@@ -2159,6 +2167,9 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2159
2167
|
...(anthropicOptions == null ? void 0 : anthropicOptions.speed) && {
|
|
2160
2168
|
speed: anthropicOptions.speed
|
|
2161
2169
|
},
|
|
2170
|
+
...(anthropicOptions == null ? void 0 : anthropicOptions.inferenceGeo) && {
|
|
2171
|
+
inference_geo: anthropicOptions.inferenceGeo
|
|
2172
|
+
},
|
|
2162
2173
|
...(anthropicOptions == null ? void 0 : anthropicOptions.cacheControl) && {
|
|
2163
2174
|
cache_control: anthropicOptions.cacheControl
|
|
2164
2175
|
},
|
|
@@ -2240,9 +2251,15 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2240
2251
|
};
|
|
2241
2252
|
if (isThinking) {
|
|
2242
2253
|
if (thinkingType === "enabled" && thinkingBudget == null) {
|
|
2243
|
-
|
|
2244
|
-
|
|
2254
|
+
warnings.push({
|
|
2255
|
+
type: "other",
|
|
2256
|
+
message: "thinking budget is required when thinking is enabled. using default budget of 1024 tokens."
|
|
2245
2257
|
});
|
|
2258
|
+
baseArgs.thinking = {
|
|
2259
|
+
type: "enabled",
|
|
2260
|
+
budget_tokens: 1024
|
|
2261
|
+
};
|
|
2262
|
+
thinkingBudget = 1024;
|
|
2246
2263
|
}
|
|
2247
2264
|
if (baseArgs.temperature != null) {
|
|
2248
2265
|
baseArgs.temperature = void 0;
|