@ai-sdk/anthropic 3.0.48 → 3.0.50
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/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 +2 -2
- package/src/anthropic-messages-language-model.ts +17 -23
- package/src/anthropic-messages-options.ts +1 -1
package/dist/internal/index.js
CHANGED
|
@@ -781,7 +781,7 @@ var anthropicLanguageModelOptions = import_v43.z.object({
|
|
|
781
781
|
/**
|
|
782
782
|
* Determines how structured outputs are generated.
|
|
783
783
|
*
|
|
784
|
-
* - `outputFormat`: Use the `
|
|
784
|
+
* - `outputFormat`: Use the `output_config.format` parameter to specify the structured output format.
|
|
785
785
|
* - `jsonTool`: Use a special 'json' tool to specify the structured output format.
|
|
786
786
|
* - `auto`: Use 'outputFormat' when supported, otherwise use 'jsonTool' (default).
|
|
787
787
|
*/
|
|
@@ -2654,8 +2654,18 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2654
2654
|
...thinkingBudget != null && { budget_tokens: thinkingBudget }
|
|
2655
2655
|
}
|
|
2656
2656
|
},
|
|
2657
|
-
...(anthropicOptions == null ? void 0 : anthropicOptions.effort) && {
|
|
2658
|
-
output_config: {
|
|
2657
|
+
...((anthropicOptions == null ? void 0 : anthropicOptions.effort) || useStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null) && {
|
|
2658
|
+
output_config: {
|
|
2659
|
+
...(anthropicOptions == null ? void 0 : anthropicOptions.effort) && {
|
|
2660
|
+
effort: anthropicOptions.effort
|
|
2661
|
+
},
|
|
2662
|
+
...useStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && {
|
|
2663
|
+
format: {
|
|
2664
|
+
type: "json_schema",
|
|
2665
|
+
schema: responseFormat.schema
|
|
2666
|
+
}
|
|
2667
|
+
}
|
|
2668
|
+
}
|
|
2659
2669
|
},
|
|
2660
2670
|
...(anthropicOptions == null ? void 0 : anthropicOptions.speed) && {
|
|
2661
2671
|
speed: anthropicOptions.speed
|
|
@@ -2663,13 +2673,6 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2663
2673
|
...(anthropicOptions == null ? void 0 : anthropicOptions.cacheControl) && {
|
|
2664
2674
|
cache_control: anthropicOptions.cacheControl
|
|
2665
2675
|
},
|
|
2666
|
-
// structured output:
|
|
2667
|
-
...useStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && {
|
|
2668
|
-
output_format: {
|
|
2669
|
-
type: "json_schema",
|
|
2670
|
-
schema: responseFormat.schema
|
|
2671
|
-
}
|
|
2672
|
-
},
|
|
2673
2676
|
// mcp servers:
|
|
2674
2677
|
...(anthropicOptions == null ? void 0 : anthropicOptions.mcpServers) && anthropicOptions.mcpServers.length > 0 && {
|
|
2675
2678
|
mcp_servers: anthropicOptions.mcpServers.map((server) => ({
|
|
@@ -2843,10 +2846,6 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2843
2846
|
if (stream && ((_f = anthropicOptions == null ? void 0 : anthropicOptions.toolStreaming) != null ? _f : true)) {
|
|
2844
2847
|
betas.add("fine-grained-tool-streaming-2025-05-14");
|
|
2845
2848
|
}
|
|
2846
|
-
const usingNativeOutputFormat = useStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null;
|
|
2847
|
-
if (usingNativeOutputFormat) {
|
|
2848
|
-
betas.add("structured-outputs-2025-11-13");
|
|
2849
|
-
}
|
|
2850
2849
|
const {
|
|
2851
2850
|
tools: anthropicTools2,
|
|
2852
2851
|
toolChoice: anthropicToolChoice,
|