@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/dist/index.mjs
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "@ai-sdk/provider-utils";
|
|
13
13
|
|
|
14
14
|
// src/version.ts
|
|
15
|
-
var VERSION = true ? "3.0.
|
|
15
|
+
var VERSION = true ? "3.0.49" : "0.0.0-test";
|
|
16
16
|
|
|
17
17
|
// src/anthropic-messages-language-model.ts
|
|
18
18
|
import {
|
|
@@ -784,7 +784,7 @@ var anthropicLanguageModelOptions = z3.object({
|
|
|
784
784
|
/**
|
|
785
785
|
* Determines how structured outputs are generated.
|
|
786
786
|
*
|
|
787
|
-
* - `outputFormat`: Use the `
|
|
787
|
+
* - `outputFormat`: Use the `output_config.format` parameter to specify the structured output format.
|
|
788
788
|
* - `jsonTool`: Use a special 'json' tool to specify the structured output format.
|
|
789
789
|
* - `auto`: Use 'outputFormat' when supported, otherwise use 'jsonTool' (default).
|
|
790
790
|
*/
|
|
@@ -2686,8 +2686,18 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2686
2686
|
...thinkingBudget != null && { budget_tokens: thinkingBudget }
|
|
2687
2687
|
}
|
|
2688
2688
|
},
|
|
2689
|
-
...(anthropicOptions == null ? void 0 : anthropicOptions.effort) && {
|
|
2690
|
-
output_config: {
|
|
2689
|
+
...((anthropicOptions == null ? void 0 : anthropicOptions.effort) || useStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null) && {
|
|
2690
|
+
output_config: {
|
|
2691
|
+
...(anthropicOptions == null ? void 0 : anthropicOptions.effort) && {
|
|
2692
|
+
effort: anthropicOptions.effort
|
|
2693
|
+
},
|
|
2694
|
+
...useStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && {
|
|
2695
|
+
format: {
|
|
2696
|
+
type: "json_schema",
|
|
2697
|
+
schema: responseFormat.schema
|
|
2698
|
+
}
|
|
2699
|
+
}
|
|
2700
|
+
}
|
|
2691
2701
|
},
|
|
2692
2702
|
...(anthropicOptions == null ? void 0 : anthropicOptions.speed) && {
|
|
2693
2703
|
speed: anthropicOptions.speed
|
|
@@ -2695,13 +2705,6 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2695
2705
|
...(anthropicOptions == null ? void 0 : anthropicOptions.cacheControl) && {
|
|
2696
2706
|
cache_control: anthropicOptions.cacheControl
|
|
2697
2707
|
},
|
|
2698
|
-
// structured output:
|
|
2699
|
-
...useStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && {
|
|
2700
|
-
output_format: {
|
|
2701
|
-
type: "json_schema",
|
|
2702
|
-
schema: responseFormat.schema
|
|
2703
|
-
}
|
|
2704
|
-
},
|
|
2705
2708
|
// mcp servers:
|
|
2706
2709
|
...(anthropicOptions == null ? void 0 : anthropicOptions.mcpServers) && anthropicOptions.mcpServers.length > 0 && {
|
|
2707
2710
|
mcp_servers: anthropicOptions.mcpServers.map((server) => ({
|
|
@@ -2875,10 +2878,6 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2875
2878
|
if (stream && ((_f = anthropicOptions == null ? void 0 : anthropicOptions.toolStreaming) != null ? _f : true)) {
|
|
2876
2879
|
betas.add("fine-grained-tool-streaming-2025-05-14");
|
|
2877
2880
|
}
|
|
2878
|
-
const usingNativeOutputFormat = useStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null;
|
|
2879
|
-
if (usingNativeOutputFormat) {
|
|
2880
|
-
betas.add("structured-outputs-2025-11-13");
|
|
2881
|
-
}
|
|
2882
2881
|
const {
|
|
2883
2882
|
tools: anthropicTools2,
|
|
2884
2883
|
toolChoice: anthropicToolChoice,
|