@ai-sdk/anthropic 3.0.48 → 3.0.49
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.js +14 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -15
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +13 -14
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +13 -14
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/anthropic-messages-language-model.ts +17 -23
- package/src/anthropic-messages-options.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @ai-sdk/anthropic
|
|
2
2
|
|
|
3
|
+
## 3.0.49
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d98d9ba: Migrated deprecated `output_format` parameter to `output_config.format` for structured outputs + Enabled native structured output support for Bedrock Anthropic models via `output_config.format`.
|
|
8
|
+
|
|
3
9
|
## 3.0.48
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -32,7 +32,7 @@ var import_provider4 = require("@ai-sdk/provider");
|
|
|
32
32
|
var import_provider_utils24 = require("@ai-sdk/provider-utils");
|
|
33
33
|
|
|
34
34
|
// src/version.ts
|
|
35
|
-
var VERSION = true ? "3.0.
|
|
35
|
+
var VERSION = true ? "3.0.49" : "0.0.0-test";
|
|
36
36
|
|
|
37
37
|
// src/anthropic-messages-language-model.ts
|
|
38
38
|
var import_provider3 = require("@ai-sdk/provider");
|
|
@@ -789,7 +789,7 @@ var anthropicLanguageModelOptions = import_v43.z.object({
|
|
|
789
789
|
/**
|
|
790
790
|
* Determines how structured outputs are generated.
|
|
791
791
|
*
|
|
792
|
-
* - `outputFormat`: Use the `
|
|
792
|
+
* - `outputFormat`: Use the `output_config.format` parameter to specify the structured output format.
|
|
793
793
|
* - `jsonTool`: Use a special 'json' tool to specify the structured output format.
|
|
794
794
|
* - `auto`: Use 'outputFormat' when supported, otherwise use 'jsonTool' (default).
|
|
795
795
|
*/
|
|
@@ -2662,8 +2662,18 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2662
2662
|
...thinkingBudget != null && { budget_tokens: thinkingBudget }
|
|
2663
2663
|
}
|
|
2664
2664
|
},
|
|
2665
|
-
...(anthropicOptions == null ? void 0 : anthropicOptions.effort) && {
|
|
2666
|
-
output_config: {
|
|
2665
|
+
...((anthropicOptions == null ? void 0 : anthropicOptions.effort) || useStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null) && {
|
|
2666
|
+
output_config: {
|
|
2667
|
+
...(anthropicOptions == null ? void 0 : anthropicOptions.effort) && {
|
|
2668
|
+
effort: anthropicOptions.effort
|
|
2669
|
+
},
|
|
2670
|
+
...useStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && {
|
|
2671
|
+
format: {
|
|
2672
|
+
type: "json_schema",
|
|
2673
|
+
schema: responseFormat.schema
|
|
2674
|
+
}
|
|
2675
|
+
}
|
|
2676
|
+
}
|
|
2667
2677
|
},
|
|
2668
2678
|
...(anthropicOptions == null ? void 0 : anthropicOptions.speed) && {
|
|
2669
2679
|
speed: anthropicOptions.speed
|
|
@@ -2671,13 +2681,6 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2671
2681
|
...(anthropicOptions == null ? void 0 : anthropicOptions.cacheControl) && {
|
|
2672
2682
|
cache_control: anthropicOptions.cacheControl
|
|
2673
2683
|
},
|
|
2674
|
-
// structured output:
|
|
2675
|
-
...useStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && {
|
|
2676
|
-
output_format: {
|
|
2677
|
-
type: "json_schema",
|
|
2678
|
-
schema: responseFormat.schema
|
|
2679
|
-
}
|
|
2680
|
-
},
|
|
2681
2684
|
// mcp servers:
|
|
2682
2685
|
...(anthropicOptions == null ? void 0 : anthropicOptions.mcpServers) && anthropicOptions.mcpServers.length > 0 && {
|
|
2683
2686
|
mcp_servers: anthropicOptions.mcpServers.map((server) => ({
|
|
@@ -2851,10 +2854,6 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2851
2854
|
if (stream && ((_f = anthropicOptions == null ? void 0 : anthropicOptions.toolStreaming) != null ? _f : true)) {
|
|
2852
2855
|
betas.add("fine-grained-tool-streaming-2025-05-14");
|
|
2853
2856
|
}
|
|
2854
|
-
const usingNativeOutputFormat = useStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null;
|
|
2855
|
-
if (usingNativeOutputFormat) {
|
|
2856
|
-
betas.add("structured-outputs-2025-11-13");
|
|
2857
|
-
}
|
|
2858
2857
|
const {
|
|
2859
2858
|
tools: anthropicTools2,
|
|
2860
2859
|
toolChoice: anthropicToolChoice,
|