@ai-sdk/anthropic 2.0.103 → 2.0.104

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 CHANGED
@@ -1,5 +1,14 @@
1
1
  # @ai-sdk/anthropic
2
2
 
3
+ ## 2.0.104
4
+
5
+ ### Patch Changes
6
+
7
+ - dc710c5: fix(amazon-bedrock): avoid forced structured-output tools for incompatible Claude models
8
+ - Updated dependencies [594787e]
9
+ - @ai-sdk/provider@2.0.5
10
+ - @ai-sdk/provider-utils@3.0.38
11
+
3
12
  ## 2.0.103
4
13
 
5
14
  ### Patch Changes
package/dist/index.js CHANGED
@@ -31,7 +31,7 @@ var import_provider4 = require("@ai-sdk/provider");
31
31
  var import_provider_utils21 = require("@ai-sdk/provider-utils");
32
32
 
33
33
  // src/version.ts
34
- var VERSION = true ? "2.0.103" : "0.0.0-test";
34
+ var VERSION = true ? "2.0.104" : "0.0.0-test";
35
35
 
36
36
  // src/anthropic-messages-language-model.ts
37
37
  var import_provider3 = require("@ai-sdk/provider");
package/dist/index.mjs CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  } from "@ai-sdk/provider-utils";
12
12
 
13
13
  // src/version.ts
14
- var VERSION = true ? "2.0.103" : "0.0.0-test";
14
+ var VERSION = true ? "2.0.104" : "0.0.0-test";
15
15
 
16
16
  // src/anthropic-messages-language-model.ts
17
17
  import {
@@ -32,6 +32,28 @@ declare class AnthropicMessagesLanguageModel implements LanguageModelV2 {
32
32
  doGenerate(options: Parameters<LanguageModelV2['doGenerate']>[0]): Promise<Awaited<ReturnType<LanguageModelV2['doGenerate']>>>;
33
33
  doStream(options: Parameters<LanguageModelV2['doStream']>[0]): Promise<Awaited<ReturnType<LanguageModelV2['doStream']>>>;
34
34
  }
35
+ /**
36
+ * Returns the capabilities of a Claude model that are used for defaults and feature selection.
37
+ *
38
+ * @see https://docs.claude.com/en/docs/about-claude/models/overview#model-comparison-table
39
+ * @see https://platform.claude.com/docs/en/build-with-claude/structured-outputs
40
+ */
41
+ declare function getModelCapabilities(modelId: string): {
42
+ maxOutputTokens: number;
43
+ supportsStructuredOutput: boolean;
44
+ rejectsSamplingParameters: boolean;
45
+ rejectsThinkingDisabledAboveHighEffort: boolean;
46
+ /**
47
+ * Thinking is always adaptive: `thinking.type` `disabled` and `enabled`
48
+ * are rejected with a 400.
49
+ */
50
+ rejectsThinkingDisabled: boolean;
51
+ /**
52
+ * Forced tool use (`tool_choice` `any` or a named tool) is rejected with a 400.
53
+ */
54
+ rejectsForcedToolUse: boolean;
55
+ isKnownModel: boolean;
56
+ };
35
57
 
36
58
  /**
37
59
  * Member tools of the computer toolset. Each member is returned by the API as
@@ -781,4 +803,4 @@ declare function prepareTools({ tools, toolChoice, disableParallelToolUse, cache
781
803
  */
782
804
  declare function sanitizeJsonSchema(schema: JSONSchema7): JSONSchema7;
783
805
 
784
- export { AnthropicMessagesLanguageModel, type AnthropicMessagesModelId, anthropicTools, prepareTools, sanitizeJsonSchema };
806
+ export { AnthropicMessagesLanguageModel, type AnthropicMessagesModelId, anthropicTools, getModelCapabilities, prepareTools, sanitizeJsonSchema };
@@ -32,6 +32,28 @@ declare class AnthropicMessagesLanguageModel implements LanguageModelV2 {
32
32
  doGenerate(options: Parameters<LanguageModelV2['doGenerate']>[0]): Promise<Awaited<ReturnType<LanguageModelV2['doGenerate']>>>;
33
33
  doStream(options: Parameters<LanguageModelV2['doStream']>[0]): Promise<Awaited<ReturnType<LanguageModelV2['doStream']>>>;
34
34
  }
35
+ /**
36
+ * Returns the capabilities of a Claude model that are used for defaults and feature selection.
37
+ *
38
+ * @see https://docs.claude.com/en/docs/about-claude/models/overview#model-comparison-table
39
+ * @see https://platform.claude.com/docs/en/build-with-claude/structured-outputs
40
+ */
41
+ declare function getModelCapabilities(modelId: string): {
42
+ maxOutputTokens: number;
43
+ supportsStructuredOutput: boolean;
44
+ rejectsSamplingParameters: boolean;
45
+ rejectsThinkingDisabledAboveHighEffort: boolean;
46
+ /**
47
+ * Thinking is always adaptive: `thinking.type` `disabled` and `enabled`
48
+ * are rejected with a 400.
49
+ */
50
+ rejectsThinkingDisabled: boolean;
51
+ /**
52
+ * Forced tool use (`tool_choice` `any` or a named tool) is rejected with a 400.
53
+ */
54
+ rejectsForcedToolUse: boolean;
55
+ isKnownModel: boolean;
56
+ };
35
57
 
36
58
  /**
37
59
  * Member tools of the computer toolset. Each member is returned by the API as
@@ -781,4 +803,4 @@ declare function prepareTools({ tools, toolChoice, disableParallelToolUse, cache
781
803
  */
782
804
  declare function sanitizeJsonSchema(schema: JSONSchema7): JSONSchema7;
783
805
 
784
- export { AnthropicMessagesLanguageModel, type AnthropicMessagesModelId, anthropicTools, prepareTools, sanitizeJsonSchema };
806
+ export { AnthropicMessagesLanguageModel, type AnthropicMessagesModelId, anthropicTools, getModelCapabilities, prepareTools, sanitizeJsonSchema };
@@ -22,6 +22,7 @@ var index_exports = {};
22
22
  __export(index_exports, {
23
23
  AnthropicMessagesLanguageModel: () => AnthropicMessagesLanguageModel,
24
24
  anthropicTools: () => anthropicTools,
25
+ getModelCapabilities: () => getModelCapabilities,
25
26
  prepareTools: () => prepareTools,
26
27
  sanitizeJsonSchema: () => sanitizeJsonSchema
27
28
  });
@@ -4750,6 +4751,7 @@ var anthropicTools = {
4750
4751
  0 && (module.exports = {
4751
4752
  AnthropicMessagesLanguageModel,
4752
4753
  anthropicTools,
4754
+ getModelCapabilities,
4753
4755
  prepareTools,
4754
4756
  sanitizeJsonSchema
4755
4757
  });