@ai-sdk/anthropic 3.0.0-beta.57 → 3.0.0-beta.58
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 +6 -0
- package/dist/index.d.mts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +13 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -3
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +1 -1
- package/dist/internal/index.d.ts +1 -1
- package/dist/internal/index.js +12 -2
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +12 -2
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -42,7 +42,7 @@ interface AnthropicMessageMetadata {
|
|
|
42
42
|
} | null;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
type AnthropicMessagesModelId = 'claude-haiku-
|
|
45
|
+
type AnthropicMessagesModelId = 'claude-3-5-haiku-20241022' | 'claude-3-5-haiku-latest' | 'claude-3-7-sonnet-20250219' | 'claude-3-7-sonnet-latest' | 'claude-3-haiku-20240307' | 'claude-haiku-4-5-20251001' | 'claude-haiku-4-5' | 'claude-opus-4-0' | 'claude-opus-4-1-20250805' | 'claude-opus-4-1' | 'claude-opus-4-20250514' | 'claude-opus-4-5' | 'claude-opus-4-5-20251101' | 'claude-sonnet-4-0' | 'claude-sonnet-4-20250514' | 'claude-sonnet-4-5-20250929' | 'claude-sonnet-4-5' | (string & {});
|
|
46
46
|
declare const anthropicProviderOptions: z.ZodObject<{
|
|
47
47
|
sendReasoning: z.ZodOptional<z.ZodBoolean>;
|
|
48
48
|
structuredOutputMode: z.ZodOptional<z.ZodEnum<{
|
|
@@ -78,6 +78,11 @@ declare const anthropicProviderOptions: z.ZodObject<{
|
|
|
78
78
|
}, z.core.$strip>>>;
|
|
79
79
|
}, z.core.$strip>>;
|
|
80
80
|
toolStreaming: z.ZodOptional<z.ZodBoolean>;
|
|
81
|
+
effort: z.ZodOptional<z.ZodEnum<{
|
|
82
|
+
low: "low";
|
|
83
|
+
medium: "medium";
|
|
84
|
+
high: "high";
|
|
85
|
+
}>>;
|
|
81
86
|
}, z.core.$strip>;
|
|
82
87
|
type AnthropicProviderOptions = z.infer<typeof anthropicProviderOptions>;
|
|
83
88
|
|
package/dist/index.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ interface AnthropicMessageMetadata {
|
|
|
42
42
|
} | null;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
type AnthropicMessagesModelId = 'claude-haiku-
|
|
45
|
+
type AnthropicMessagesModelId = 'claude-3-5-haiku-20241022' | 'claude-3-5-haiku-latest' | 'claude-3-7-sonnet-20250219' | 'claude-3-7-sonnet-latest' | 'claude-3-haiku-20240307' | 'claude-haiku-4-5-20251001' | 'claude-haiku-4-5' | 'claude-opus-4-0' | 'claude-opus-4-1-20250805' | 'claude-opus-4-1' | 'claude-opus-4-20250514' | 'claude-opus-4-5' | 'claude-opus-4-5-20251101' | 'claude-sonnet-4-0' | 'claude-sonnet-4-20250514' | 'claude-sonnet-4-5-20250929' | 'claude-sonnet-4-5' | (string & {});
|
|
46
46
|
declare const anthropicProviderOptions: z.ZodObject<{
|
|
47
47
|
sendReasoning: z.ZodOptional<z.ZodBoolean>;
|
|
48
48
|
structuredOutputMode: z.ZodOptional<z.ZodEnum<{
|
|
@@ -78,6 +78,11 @@ declare const anthropicProviderOptions: z.ZodObject<{
|
|
|
78
78
|
}, z.core.$strip>>>;
|
|
79
79
|
}, z.core.$strip>>;
|
|
80
80
|
toolStreaming: z.ZodOptional<z.ZodBoolean>;
|
|
81
|
+
effort: z.ZodOptional<z.ZodEnum<{
|
|
82
|
+
low: "low";
|
|
83
|
+
medium: "medium";
|
|
84
|
+
high: "high";
|
|
85
|
+
}>>;
|
|
81
86
|
}, z.core.$strip>;
|
|
82
87
|
type AnthropicProviderOptions = z.infer<typeof anthropicProviderOptions>;
|
|
83
88
|
|
package/dist/index.js
CHANGED
|
@@ -31,7 +31,7 @@ var import_provider4 = require("@ai-sdk/provider");
|
|
|
31
31
|
var import_provider_utils20 = require("@ai-sdk/provider-utils");
|
|
32
32
|
|
|
33
33
|
// src/version.ts
|
|
34
|
-
var VERSION = true ? "3.0.0-beta.
|
|
34
|
+
var VERSION = true ? "3.0.0-beta.58" : "0.0.0-test";
|
|
35
35
|
|
|
36
36
|
// src/anthropic-messages-language-model.ts
|
|
37
37
|
var import_provider3 = require("@ai-sdk/provider");
|
|
@@ -662,7 +662,11 @@ var anthropicProviderOptions = import_v43.z.object({
|
|
|
662
662
|
*
|
|
663
663
|
* @default true
|
|
664
664
|
*/
|
|
665
|
-
toolStreaming: import_v43.z.boolean().optional()
|
|
665
|
+
toolStreaming: import_v43.z.boolean().optional(),
|
|
666
|
+
/**
|
|
667
|
+
* @default 'high'
|
|
668
|
+
*/
|
|
669
|
+
effort: import_v43.z.enum(["low", "medium", "high"]).optional()
|
|
666
670
|
});
|
|
667
671
|
|
|
668
672
|
// src/anthropic-prepare-tools.ts
|
|
@@ -1999,6 +2003,9 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
1999
2003
|
...isThinking && {
|
|
2000
2004
|
thinking: { type: "enabled", budget_tokens: thinkingBudget }
|
|
2001
2005
|
},
|
|
2006
|
+
...(anthropicOptions == null ? void 0 : anthropicOptions.effort) && {
|
|
2007
|
+
output_config: { effort: anthropicOptions.effort }
|
|
2008
|
+
},
|
|
2002
2009
|
// structured output:
|
|
2003
2010
|
...useStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && {
|
|
2004
2011
|
output_format: {
|
|
@@ -2092,6 +2099,9 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2092
2099
|
});
|
|
2093
2100
|
}
|
|
2094
2101
|
}
|
|
2102
|
+
if (anthropicOptions == null ? void 0 : anthropicOptions.effort) {
|
|
2103
|
+
betas.add("effort-2025-11-24");
|
|
2104
|
+
}
|
|
2095
2105
|
if (stream && ((_f = anthropicOptions == null ? void 0 : anthropicOptions.toolStreaming) != null ? _f : true)) {
|
|
2096
2106
|
betas.add("fine-grained-tool-streaming-2025-05-14");
|
|
2097
2107
|
}
|
|
@@ -2981,7 +2991,7 @@ function getModelCapabilities(modelId) {
|
|
|
2981
2991
|
supportsStructuredOutput: true,
|
|
2982
2992
|
isKnownModel: true
|
|
2983
2993
|
};
|
|
2984
|
-
} else if (modelId.includes("claude-opus-4-1")) {
|
|
2994
|
+
} else if (modelId.includes("claude-opus-4-1") || modelId.includes("claude-opus-4-5")) {
|
|
2985
2995
|
return {
|
|
2986
2996
|
maxOutputTokens: 32e3,
|
|
2987
2997
|
supportsStructuredOutput: true,
|