anthropic 1.24.0 → 1.26.0

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.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +42 -0
  3. data/README.md +1 -1
  4. data/lib/anthropic/errors.rb +11 -2
  5. data/lib/anthropic/internal/type/enum.rb +11 -11
  6. data/lib/anthropic/internal/util.rb +2 -3
  7. data/lib/anthropic/models/anthropic_beta.rb +3 -0
  8. data/lib/anthropic/models/beta/beta_capability_support.rb +22 -0
  9. data/lib/anthropic/models/beta/beta_context_management_capability.rb +46 -0
  10. data/lib/anthropic/models/beta/beta_effort_capability.rb +54 -0
  11. data/lib/anthropic/models/beta/beta_model_capabilities.rb +86 -0
  12. data/lib/anthropic/models/beta/beta_model_info.rb +25 -1
  13. data/lib/anthropic/models/beta/beta_thinking_capability.rb +30 -0
  14. data/lib/anthropic/models/beta/beta_thinking_types.rb +30 -0
  15. data/lib/anthropic/models/capability_support.rb +18 -0
  16. data/lib/anthropic/models/context_management_capability.rb +42 -0
  17. data/lib/anthropic/models/effort_capability.rb +50 -0
  18. data/lib/anthropic/models/error_type.rb +22 -0
  19. data/lib/anthropic/models/model_capabilities.rb +82 -0
  20. data/lib/anthropic/models/model_info.rb +25 -1
  21. data/lib/anthropic/models/thinking_capability.rb +26 -0
  22. data/lib/anthropic/models/thinking_types.rb +26 -0
  23. data/lib/anthropic/models.rb +14 -0
  24. data/lib/anthropic/version.rb +1 -1
  25. data/lib/anthropic.rb +13 -0
  26. data/rbi/anthropic/errors.rbi +7 -2
  27. data/rbi/anthropic/models/anthropic_beta.rbi +2 -0
  28. data/rbi/anthropic/models/beta/beta_capability_support.rbi +35 -0
  29. data/rbi/anthropic/models/beta/beta_context_management_capability.rbi +99 -0
  30. data/rbi/anthropic/models/beta/beta_effort_capability.rbi +93 -0
  31. data/rbi/anthropic/models/beta/beta_model_capabilities.rbi +165 -0
  32. data/rbi/anthropic/models/beta/beta_model_info.rbi +39 -1
  33. data/rbi/anthropic/models/beta/beta_thinking_capability.rbi +53 -0
  34. data/rbi/anthropic/models/beta/beta_thinking_types.rbi +63 -0
  35. data/rbi/anthropic/models/capability_support.rbi +28 -0
  36. data/rbi/anthropic/models/context_management_capability.rbi +90 -0
  37. data/rbi/anthropic/models/effort_capability.rbi +82 -0
  38. data/rbi/anthropic/models/error_type.rbi +32 -0
  39. data/rbi/anthropic/models/model_capabilities.rbi +135 -0
  40. data/rbi/anthropic/models/model_info.rbi +37 -1
  41. data/rbi/anthropic/models/thinking_capability.rbi +46 -0
  42. data/rbi/anthropic/models/thinking_types.rbi +52 -0
  43. data/rbi/anthropic/models.rbi +14 -0
  44. data/sig/anthropic/errors.rbs +4 -1
  45. data/sig/anthropic/models/anthropic_beta.rbs +2 -0
  46. data/sig/anthropic/models/beta/beta_capability_support.rbs +17 -0
  47. data/sig/anthropic/models/beta/beta_context_management_capability.rbs +39 -0
  48. data/sig/anthropic/models/beta/beta_effort_capability.rbs +44 -0
  49. data/sig/anthropic/models/beta/beta_model_capabilities.rbs +64 -0
  50. data/sig/anthropic/models/beta/beta_model_info.rbs +21 -1
  51. data/sig/anthropic/models/beta/beta_thinking_capability.rbs +26 -0
  52. data/sig/anthropic/models/beta/beta_thinking_types.rbs +29 -0
  53. data/sig/anthropic/models/capability_support.rbs +13 -0
  54. data/sig/anthropic/models/context_management_capability.rbs +35 -0
  55. data/sig/anthropic/models/effort_capability.rbs +40 -0
  56. data/sig/anthropic/models/error_type.rbs +30 -0
  57. data/sig/anthropic/models/model_capabilities.rbs +60 -0
  58. data/sig/anthropic/models/model_info.rbs +21 -1
  59. data/sig/anthropic/models/thinking_capability.rbs +16 -0
  60. data/sig/anthropic/models/thinking_types.rbs +25 -0
  61. data/sig/anthropic/models.rbs +14 -0
  62. metadata +41 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d8e994ed4ea60cbaf7aee144bcabab2da5406df0c604d5dab2687b8ba226ec47
4
- data.tar.gz: 963a20b35842c61557dc0cd60a1afbf00116653cfa120f1291fc840c4562933b
3
+ metadata.gz: 8765d87a8f2c333c114221a23ca51b9562d6364e6585bb517660192974a193d4
4
+ data.tar.gz: dfcba061b31eb9a056a0b0cbfe5a0f96b93277a52162d3945f2615d26eea81a4
5
5
  SHA512:
6
- metadata.gz: 2df975c4dde315c09393d07959e77315ce1bf725e0955c56085c0c0f444207b988e07ee7e2a78a688fb50df1781448f2c9c6a6ec00ea40a42ccb3597aa615308
7
- data.tar.gz: 466afa0cd510de890dcd18e075a8ebb378877ce10636184eda10bc185c11ce4d4095d81cc778aa314b07011d8f476ce62ca30694993c60826992ee5f0a135882
6
+ metadata.gz: 04b8f406fe7f06a6d9bc6331030486a1283d099c0e19eb2975fd7a987f911280a7a6e13d277d4d412fd478fa98a3316c114a9ff3cf98c0fb4c028b9d218f8592
7
+ data.tar.gz: 727738003e679d0fd5ca540fc918e85f8eccfb67a8f47d45996aaec6ddb58d14ec5ceed23df33197aafb7a779730019cdc27b2ec61aaacb4e549dcd9957905b9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,47 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.26.0 (2026-03-31)
4
+
5
+ Full Changelog: [v1.25.0...v1.26.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v1.25.0...v1.26.0)
6
+
7
+ ### Features
8
+
9
+ * add .type field to APIStatusError for uniform error identification ([#847](https://github.com/anthropics/anthropic-sdk-ruby/issues/847)) ([4c57783](https://github.com/anthropics/anthropic-sdk-ruby/commit/4c577837697516dc339100fe52be915afe544102))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * **internal:** correct multipart form field name encoding ([0fed236](https://github.com/anthropics/anthropic-sdk-ruby/commit/0fed236eabd481a034739c6f7abab75bc3a875c2))
15
+ * variable name typo ([550b1ed](https://github.com/anthropics/anthropic-sdk-ruby/commit/550b1ed8af220d6749040c44f608b0b6b8910aaf))
16
+
17
+
18
+ ### Chores
19
+
20
+ * **ci:** run builds on CI even if only spec metadata changed ([8faa86f](https://github.com/anthropics/anthropic-sdk-ruby/commit/8faa86f76c7fbc80082ac07768e14af831566f62))
21
+ * **ci:** skip lint on metadata-only changes ([16064d4](https://github.com/anthropics/anthropic-sdk-ruby/commit/16064d40c434ba29c0943c6dd0402c0b58fcbb3d))
22
+ * **ci:** support opting out of skipping builds on metadata-only commits ([e184024](https://github.com/anthropics/anthropic-sdk-ruby/commit/e18402452192c17170a6933ab0bb060a7e0ba073))
23
+ * **internal:** update gitignore ([5f3d363](https://github.com/anthropics/anthropic-sdk-ruby/commit/5f3d363e741a966fa6ec3e04ed675eab27aedd77))
24
+ * **tests:** bump steady to v0.19.4 ([4a17d4d](https://github.com/anthropics/anthropic-sdk-ruby/commit/4a17d4deff2d696f78c9c503f99dcbd9c7146153))
25
+ * **tests:** bump steady to v0.19.5 ([a4bcfd7](https://github.com/anthropics/anthropic-sdk-ruby/commit/a4bcfd76f9384c02bfb074ed57de8aba2face020))
26
+ * **tests:** bump steady to v0.19.6 ([e34f523](https://github.com/anthropics/anthropic-sdk-ruby/commit/e34f5236c9d2aa6fa78c7562af7f89aa70fe373b))
27
+ * **tests:** bump steady to v0.19.7 ([577310d](https://github.com/anthropics/anthropic-sdk-ruby/commit/577310d77b14972f657d5946b661298cadbff31a))
28
+ * **tests:** bump steady to v0.20.1 ([dcf51d2](https://github.com/anthropics/anthropic-sdk-ruby/commit/dcf51d293d46d719c0fe09b4410dcb5445adcabc))
29
+ * **tests:** bump steady to v0.20.2 ([5c52306](https://github.com/anthropics/anthropic-sdk-ruby/commit/5c523068dadf801f50b1d39d53bbcce07a5d0722))
30
+
31
+ ## 1.25.0 (2026-03-18)
32
+
33
+ Full Changelog: [v1.24.0...v1.25.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v1.24.0...v1.25.0)
34
+
35
+ ### Features
36
+
37
+ * **api:** manual updates ([b08cc0d](https://github.com/anthropics/anthropic-sdk-ruby/commit/b08cc0d8165bb47207e1fabe6738f7a8f59cdaa8))
38
+ * **api:** manual updates ([6e54a17](https://github.com/anthropics/anthropic-sdk-ruby/commit/6e54a172886f85bc936fb570a01a1e105fba2efb))
39
+
40
+
41
+ ### Chores
42
+
43
+ * **internal:** tweak CI branches ([3870094](https://github.com/anthropics/anthropic-sdk-ruby/commit/387009475a97f22752895b4e4abec8c751ba23d4))
44
+
3
45
  ## 1.24.0 (2026-03-16)
4
46
 
5
47
  Full Changelog: [v1.23.0...v1.24.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v1.23.0...v1.24.0)
data/README.md CHANGED
@@ -15,7 +15,7 @@ Add to your application's Gemfile:
15
15
  <!-- x-release-please-start-version -->
16
16
 
17
17
  ```ruby
18
- gem "anthropic", "~> 1.24.0"
18
+ gem "anthropic", "~> 1.26.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
@@ -121,6 +121,9 @@ module Anthropic
121
121
  end
122
122
 
123
123
  class APIStatusError < Anthropic::Errors::APIError
124
+ # @return [Anthropic::ErrorType::TaggedSymbol, nil]
125
+ attr_reader :type
126
+
124
127
  # @api private
125
128
  #
126
129
  # @param url [URI::Generic]
@@ -133,6 +136,9 @@ module Anthropic
133
136
  #
134
137
  # @return [self]
135
138
  def self.for(url:, status:, headers:, body:, request:, response:, message: nil)
139
+ error_type = body.dig(:error, :type) if body.is_a?(Hash)
140
+ error_type = error_type.to_sym if error_type.is_a?(String)
141
+
136
142
  kwargs =
137
143
  {
138
144
  url: url,
@@ -141,7 +147,8 @@ module Anthropic
141
147
  body: body,
142
148
  request: request,
143
149
  response: response,
144
- message: message
150
+ message: message,
151
+ type: error_type
145
152
  }
146
153
 
147
154
  case status
@@ -179,7 +186,9 @@ module Anthropic
179
186
  # @param request [nil]
180
187
  # @param response [nil]
181
188
  # @param message [String, nil]
182
- def initialize(url:, status:, headers:, body:, request:, response:, message: nil)
189
+ # @param type [Anthropic::ErrorType::TaggedSymbol, nil]
190
+ def initialize(url:, status:, headers:, body:, request:, response:, message: nil, type: nil)
191
+ @type = type
183
192
  message ||= {url: url.to_s, status: status, body: body}
184
193
  super(
185
194
  url: url,
@@ -17,28 +17,28 @@ module Anthropic
17
17
  # values safely.
18
18
  #
19
19
  # @example
20
- # # `bash_code_execution_tool_result_error_code` is a `Anthropic::BashCodeExecutionToolResultErrorCode`
21
- # case bash_code_execution_tool_result_error_code
22
- # when Anthropic::BashCodeExecutionToolResultErrorCode::INVALID_TOOL_INPUT
20
+ # # `error_type` is a `Anthropic::ErrorType`
21
+ # case error_type
22
+ # when Anthropic::ErrorType::INVALID_REQUEST_ERROR
23
23
  # # ...
24
- # when Anthropic::BashCodeExecutionToolResultErrorCode::UNAVAILABLE
24
+ # when Anthropic::ErrorType::AUTHENTICATION_ERROR
25
25
  # # ...
26
- # when Anthropic::BashCodeExecutionToolResultErrorCode::TOO_MANY_REQUESTS
26
+ # when Anthropic::ErrorType::PERMISSION_ERROR
27
27
  # # ...
28
28
  # else
29
- # puts(bash_code_execution_tool_result_error_code)
29
+ # puts(error_type)
30
30
  # end
31
31
  #
32
32
  # @example
33
- # case bash_code_execution_tool_result_error_code
34
- # in :invalid_tool_input
33
+ # case error_type
34
+ # in :invalid_request_error
35
35
  # # ...
36
- # in :unavailable
36
+ # in :authentication_error
37
37
  # # ...
38
- # in :too_many_requests
38
+ # in :permission_error
39
39
  # # ...
40
40
  # else
41
- # puts(bash_code_execution_tool_result_error_code)
41
+ # puts(error_type)
42
42
  # end
43
43
  module Enum
44
44
  include Anthropic::Internal::Type::Converter
@@ -157,7 +157,7 @@ module Anthropic
157
157
  in Hash | nil => coerced
158
158
  coerced
159
159
  else
160
- message = "Expected a #{Hash} or #{Anthropic::Internal::Type::BaseModel}, got #{data.inspect}"
160
+ message = "Expected a #{Hash} or #{Anthropic::Internal::Type::BaseModel}, got #{input.inspect}"
161
161
  raise ArgumentError.new(message)
162
162
  end
163
163
  end
@@ -571,8 +571,7 @@ module Anthropic
571
571
  y << "Content-Disposition: form-data"
572
572
 
573
573
  unless key.nil?
574
- name = ERB::Util.url_encode(key.to_s)
575
- y << "; name=\"#{name}\""
574
+ y << "; name=\"#{key}\""
576
575
  end
577
576
 
578
577
  case val
@@ -47,6 +47,8 @@ module Anthropic
47
47
 
48
48
  variant const: -> { Anthropic::Models::AnthropicBeta::FAST_MODE_2026_02_01 }
49
49
 
50
+ variant const: -> { Anthropic::Models::AnthropicBeta::OUTPUT_300K_2026_03_24 }
51
+
50
52
  # @!method self.variants
51
53
  # @return [Array(String, Symbol)]
52
54
 
@@ -76,6 +78,7 @@ module Anthropic
76
78
  MODEL_CONTEXT_WINDOW_EXCEEDED_2025_08_26 = :"model-context-window-exceeded-2025-08-26"
77
79
  SKILLS_2025_10_02 = :"skills-2025-10-02"
78
80
  FAST_MODE_2026_02_01 = :"fast-mode-2026-02-01"
81
+ OUTPUT_300K_2026_03_24 = :"output-300k-2026-03-24"
79
82
 
80
83
  # @!endgroup
81
84
  end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ class BetaCapabilitySupport < Anthropic::Internal::Type::BaseModel
7
+ # @!attribute supported
8
+ # Whether this capability is supported by the model.
9
+ #
10
+ # @return [Boolean]
11
+ required :supported, Anthropic::Internal::Type::Boolean
12
+
13
+ # @!method initialize(supported:)
14
+ # Indicates whether a capability is supported.
15
+ #
16
+ # @param supported [Boolean] Whether this capability is supported by the model.
17
+ end
18
+ end
19
+
20
+ BetaCapabilitySupport = Beta::BetaCapabilitySupport
21
+ end
22
+ end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ class BetaContextManagementCapability < Anthropic::Internal::Type::BaseModel
7
+ # @!attribute clear_thinking_20251015
8
+ # Indicates whether a capability is supported.
9
+ #
10
+ # @return [Anthropic::Models::Beta::BetaCapabilitySupport, nil]
11
+ required :clear_thinking_20251015, -> { Anthropic::Beta::BetaCapabilitySupport }, nil?: true
12
+
13
+ # @!attribute clear_tool_uses_20250919
14
+ # Indicates whether a capability is supported.
15
+ #
16
+ # @return [Anthropic::Models::Beta::BetaCapabilitySupport, nil]
17
+ required :clear_tool_uses_20250919, -> { Anthropic::Beta::BetaCapabilitySupport }, nil?: true
18
+
19
+ # @!attribute compact_20260112
20
+ # Indicates whether a capability is supported.
21
+ #
22
+ # @return [Anthropic::Models::Beta::BetaCapabilitySupport, nil]
23
+ required :compact_20260112, -> { Anthropic::Beta::BetaCapabilitySupport }, nil?: true
24
+
25
+ # @!attribute supported
26
+ # Whether this capability is supported by the model.
27
+ #
28
+ # @return [Boolean]
29
+ required :supported, Anthropic::Internal::Type::Boolean
30
+
31
+ # @!method initialize(clear_thinking_20251015:, clear_tool_uses_20250919:, compact_20260112:, supported:)
32
+ # Context management capability details.
33
+ #
34
+ # @param clear_thinking_20251015 [Anthropic::Models::Beta::BetaCapabilitySupport, nil] Indicates whether a capability is supported.
35
+ #
36
+ # @param clear_tool_uses_20250919 [Anthropic::Models::Beta::BetaCapabilitySupport, nil] Indicates whether a capability is supported.
37
+ #
38
+ # @param compact_20260112 [Anthropic::Models::Beta::BetaCapabilitySupport, nil] Indicates whether a capability is supported.
39
+ #
40
+ # @param supported [Boolean] Whether this capability is supported by the model.
41
+ end
42
+ end
43
+
44
+ BetaContextManagementCapability = Beta::BetaContextManagementCapability
45
+ end
46
+ end
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ class BetaEffortCapability < Anthropic::Internal::Type::BaseModel
7
+ # @!attribute high
8
+ # Whether the model supports high effort level.
9
+ #
10
+ # @return [Anthropic::Models::Beta::BetaCapabilitySupport]
11
+ required :high, -> { Anthropic::Beta::BetaCapabilitySupport }
12
+
13
+ # @!attribute low
14
+ # Whether the model supports low effort level.
15
+ #
16
+ # @return [Anthropic::Models::Beta::BetaCapabilitySupport]
17
+ required :low, -> { Anthropic::Beta::BetaCapabilitySupport }
18
+
19
+ # @!attribute max
20
+ # Whether the model supports max effort level.
21
+ #
22
+ # @return [Anthropic::Models::Beta::BetaCapabilitySupport]
23
+ required :max, -> { Anthropic::Beta::BetaCapabilitySupport }
24
+
25
+ # @!attribute medium
26
+ # Whether the model supports medium effort level.
27
+ #
28
+ # @return [Anthropic::Models::Beta::BetaCapabilitySupport]
29
+ required :medium, -> { Anthropic::Beta::BetaCapabilitySupport }
30
+
31
+ # @!attribute supported
32
+ # Whether this capability is supported by the model.
33
+ #
34
+ # @return [Boolean]
35
+ required :supported, Anthropic::Internal::Type::Boolean
36
+
37
+ # @!method initialize(high:, low:, max:, medium:, supported:)
38
+ # Effort (reasoning_effort) capability details.
39
+ #
40
+ # @param high [Anthropic::Models::Beta::BetaCapabilitySupport] Whether the model supports high effort level.
41
+ #
42
+ # @param low [Anthropic::Models::Beta::BetaCapabilitySupport] Whether the model supports low effort level.
43
+ #
44
+ # @param max [Anthropic::Models::Beta::BetaCapabilitySupport] Whether the model supports max effort level.
45
+ #
46
+ # @param medium [Anthropic::Models::Beta::BetaCapabilitySupport] Whether the model supports medium effort level.
47
+ #
48
+ # @param supported [Boolean] Whether this capability is supported by the model.
49
+ end
50
+ end
51
+
52
+ BetaEffortCapability = Beta::BetaEffortCapability
53
+ end
54
+ end
@@ -0,0 +1,86 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ class BetaModelCapabilities < Anthropic::Internal::Type::BaseModel
7
+ # @!attribute batch
8
+ # Whether the model supports the Batch API.
9
+ #
10
+ # @return [Anthropic::Models::Beta::BetaCapabilitySupport]
11
+ required :batch, -> { Anthropic::Beta::BetaCapabilitySupport }
12
+
13
+ # @!attribute citations
14
+ # Whether the model supports citation generation.
15
+ #
16
+ # @return [Anthropic::Models::Beta::BetaCapabilitySupport]
17
+ required :citations, -> { Anthropic::Beta::BetaCapabilitySupport }
18
+
19
+ # @!attribute code_execution
20
+ # Whether the model supports code execution tools.
21
+ #
22
+ # @return [Anthropic::Models::Beta::BetaCapabilitySupport]
23
+ required :code_execution, -> { Anthropic::Beta::BetaCapabilitySupport }
24
+
25
+ # @!attribute context_management
26
+ # Context management support and available strategies.
27
+ #
28
+ # @return [Anthropic::Models::Beta::BetaContextManagementCapability]
29
+ required :context_management, -> { Anthropic::Beta::BetaContextManagementCapability }
30
+
31
+ # @!attribute effort
32
+ # Effort (reasoning_effort) support and available levels.
33
+ #
34
+ # @return [Anthropic::Models::Beta::BetaEffortCapability]
35
+ required :effort, -> { Anthropic::Beta::BetaEffortCapability }
36
+
37
+ # @!attribute image_input
38
+ # Whether the model accepts image content blocks.
39
+ #
40
+ # @return [Anthropic::Models::Beta::BetaCapabilitySupport]
41
+ required :image_input, -> { Anthropic::Beta::BetaCapabilitySupport }
42
+
43
+ # @!attribute pdf_input
44
+ # Whether the model accepts PDF content blocks.
45
+ #
46
+ # @return [Anthropic::Models::Beta::BetaCapabilitySupport]
47
+ required :pdf_input, -> { Anthropic::Beta::BetaCapabilitySupport }
48
+
49
+ # @!attribute structured_outputs
50
+ # Whether the model supports structured output / JSON mode / strict tool schemas.
51
+ #
52
+ # @return [Anthropic::Models::Beta::BetaCapabilitySupport]
53
+ required :structured_outputs, -> { Anthropic::Beta::BetaCapabilitySupport }
54
+
55
+ # @!attribute thinking
56
+ # Thinking capability and supported type configurations.
57
+ #
58
+ # @return [Anthropic::Models::Beta::BetaThinkingCapability]
59
+ required :thinking, -> { Anthropic::Beta::BetaThinkingCapability }
60
+
61
+ # @!method initialize(batch:, citations:, code_execution:, context_management:, effort:, image_input:, pdf_input:, structured_outputs:, thinking:)
62
+ # Model capability information.
63
+ #
64
+ # @param batch [Anthropic::Models::Beta::BetaCapabilitySupport] Whether the model supports the Batch API.
65
+ #
66
+ # @param citations [Anthropic::Models::Beta::BetaCapabilitySupport] Whether the model supports citation generation.
67
+ #
68
+ # @param code_execution [Anthropic::Models::Beta::BetaCapabilitySupport] Whether the model supports code execution tools.
69
+ #
70
+ # @param context_management [Anthropic::Models::Beta::BetaContextManagementCapability] Context management support and available strategies.
71
+ #
72
+ # @param effort [Anthropic::Models::Beta::BetaEffortCapability] Effort (reasoning_effort) support and available levels.
73
+ #
74
+ # @param image_input [Anthropic::Models::Beta::BetaCapabilitySupport] Whether the model accepts image content blocks.
75
+ #
76
+ # @param pdf_input [Anthropic::Models::Beta::BetaCapabilitySupport] Whether the model accepts PDF content blocks.
77
+ #
78
+ # @param structured_outputs [Anthropic::Models::Beta::BetaCapabilitySupport] Whether the model supports structured output / JSON mode / strict tool schemas.
79
+ #
80
+ # @param thinking [Anthropic::Models::Beta::BetaThinkingCapability] Thinking capability and supported type configurations.
81
+ end
82
+ end
83
+
84
+ BetaModelCapabilities = Beta::BetaModelCapabilities
85
+ end
86
+ end
@@ -11,6 +11,12 @@ module Anthropic
11
11
  # @return [String]
12
12
  required :id, String
13
13
 
14
+ # @!attribute capabilities
15
+ # Model capability information.
16
+ #
17
+ # @return [Anthropic::Models::Beta::BetaModelCapabilities, nil]
18
+ required :capabilities, -> { Anthropic::Beta::BetaModelCapabilities }, nil?: true
19
+
14
20
  # @!attribute created_at
15
21
  # RFC 3339 datetime string representing the time at which the model was released.
16
22
  # May be set to an epoch value if the release date is unknown.
@@ -24,6 +30,18 @@ module Anthropic
24
30
  # @return [String]
25
31
  required :display_name, String
26
32
 
33
+ # @!attribute max_input_tokens
34
+ # Maximum input context window size in tokens for this model.
35
+ #
36
+ # @return [Integer, nil]
37
+ required :max_input_tokens, Integer, nil?: true
38
+
39
+ # @!attribute max_tokens
40
+ # Maximum value for the `max_tokens` parameter when using this model.
41
+ #
42
+ # @return [Integer, nil]
43
+ required :max_tokens, Integer, nil?: true
44
+
27
45
  # @!attribute type
28
46
  # Object type.
29
47
  #
@@ -32,16 +50,22 @@ module Anthropic
32
50
  # @return [Symbol, :model]
33
51
  required :type, const: :model
34
52
 
35
- # @!method initialize(id:, created_at:, display_name:, type: :model)
53
+ # @!method initialize(id:, capabilities:, created_at:, display_name:, max_input_tokens:, max_tokens:, type: :model)
36
54
  # Some parameter documentations has been truncated, see
37
55
  # {Anthropic::Models::Beta::BetaModelInfo} for more details.
38
56
  #
39
57
  # @param id [String] Unique model identifier.
40
58
  #
59
+ # @param capabilities [Anthropic::Models::Beta::BetaModelCapabilities, nil] Model capability information.
60
+ #
41
61
  # @param created_at [Time] RFC 3339 datetime string representing the time at which the model was released.
42
62
  #
43
63
  # @param display_name [String] A human-readable name for the model.
44
64
  #
65
+ # @param max_input_tokens [Integer, nil] Maximum input context window size in tokens for this model.
66
+ #
67
+ # @param max_tokens [Integer, nil] Maximum value for the `max_tokens` parameter when using this model.
68
+ #
45
69
  # @param type [Symbol, :model] Object type.
46
70
  end
47
71
  end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ class BetaThinkingCapability < Anthropic::Internal::Type::BaseModel
7
+ # @!attribute supported
8
+ # Whether this capability is supported by the model.
9
+ #
10
+ # @return [Boolean]
11
+ required :supported, Anthropic::Internal::Type::Boolean
12
+
13
+ # @!attribute types
14
+ # Supported thinking type configurations.
15
+ #
16
+ # @return [Anthropic::Models::Beta::BetaThinkingTypes]
17
+ required :types, -> { Anthropic::Beta::BetaThinkingTypes }
18
+
19
+ # @!method initialize(supported:, types:)
20
+ # Thinking capability details.
21
+ #
22
+ # @param supported [Boolean] Whether this capability is supported by the model.
23
+ #
24
+ # @param types [Anthropic::Models::Beta::BetaThinkingTypes] Supported thinking type configurations.
25
+ end
26
+ end
27
+
28
+ BetaThinkingCapability = Beta::BetaThinkingCapability
29
+ end
30
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ class BetaThinkingTypes < Anthropic::Internal::Type::BaseModel
7
+ # @!attribute adaptive
8
+ # Whether the model supports thinking with type 'adaptive' (auto).
9
+ #
10
+ # @return [Anthropic::Models::Beta::BetaCapabilitySupport]
11
+ required :adaptive, -> { Anthropic::Beta::BetaCapabilitySupport }
12
+
13
+ # @!attribute enabled
14
+ # Whether the model supports thinking with type 'enabled'.
15
+ #
16
+ # @return [Anthropic::Models::Beta::BetaCapabilitySupport]
17
+ required :enabled, -> { Anthropic::Beta::BetaCapabilitySupport }
18
+
19
+ # @!method initialize(adaptive:, enabled:)
20
+ # Supported thinking type configurations.
21
+ #
22
+ # @param adaptive [Anthropic::Models::Beta::BetaCapabilitySupport] Whether the model supports thinking with type 'adaptive' (auto).
23
+ #
24
+ # @param enabled [Anthropic::Models::Beta::BetaCapabilitySupport] Whether the model supports thinking with type 'enabled'.
25
+ end
26
+ end
27
+
28
+ BetaThinkingTypes = Beta::BetaThinkingTypes
29
+ end
30
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ class CapabilitySupport < Anthropic::Internal::Type::BaseModel
6
+ # @!attribute supported
7
+ # Whether this capability is supported by the model.
8
+ #
9
+ # @return [Boolean]
10
+ required :supported, Anthropic::Internal::Type::Boolean
11
+
12
+ # @!method initialize(supported:)
13
+ # Indicates whether a capability is supported.
14
+ #
15
+ # @param supported [Boolean] Whether this capability is supported by the model.
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ class ContextManagementCapability < Anthropic::Internal::Type::BaseModel
6
+ # @!attribute clear_thinking_20251015
7
+ # Indicates whether a capability is supported.
8
+ #
9
+ # @return [Anthropic::Models::CapabilitySupport, nil]
10
+ required :clear_thinking_20251015, -> { Anthropic::CapabilitySupport }, nil?: true
11
+
12
+ # @!attribute clear_tool_uses_20250919
13
+ # Indicates whether a capability is supported.
14
+ #
15
+ # @return [Anthropic::Models::CapabilitySupport, nil]
16
+ required :clear_tool_uses_20250919, -> { Anthropic::CapabilitySupport }, nil?: true
17
+
18
+ # @!attribute compact_20260112
19
+ # Indicates whether a capability is supported.
20
+ #
21
+ # @return [Anthropic::Models::CapabilitySupport, nil]
22
+ required :compact_20260112, -> { Anthropic::CapabilitySupport }, nil?: true
23
+
24
+ # @!attribute supported
25
+ # Whether this capability is supported by the model.
26
+ #
27
+ # @return [Boolean]
28
+ required :supported, Anthropic::Internal::Type::Boolean
29
+
30
+ # @!method initialize(clear_thinking_20251015:, clear_tool_uses_20250919:, compact_20260112:, supported:)
31
+ # Context management capability details.
32
+ #
33
+ # @param clear_thinking_20251015 [Anthropic::Models::CapabilitySupport, nil] Indicates whether a capability is supported.
34
+ #
35
+ # @param clear_tool_uses_20250919 [Anthropic::Models::CapabilitySupport, nil] Indicates whether a capability is supported.
36
+ #
37
+ # @param compact_20260112 [Anthropic::Models::CapabilitySupport, nil] Indicates whether a capability is supported.
38
+ #
39
+ # @param supported [Boolean] Whether this capability is supported by the model.
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ class EffortCapability < Anthropic::Internal::Type::BaseModel
6
+ # @!attribute high
7
+ # Whether the model supports high effort level.
8
+ #
9
+ # @return [Anthropic::Models::CapabilitySupport]
10
+ required :high, -> { Anthropic::CapabilitySupport }
11
+
12
+ # @!attribute low
13
+ # Whether the model supports low effort level.
14
+ #
15
+ # @return [Anthropic::Models::CapabilitySupport]
16
+ required :low, -> { Anthropic::CapabilitySupport }
17
+
18
+ # @!attribute max
19
+ # Whether the model supports max effort level.
20
+ #
21
+ # @return [Anthropic::Models::CapabilitySupport]
22
+ required :max, -> { Anthropic::CapabilitySupport }
23
+
24
+ # @!attribute medium
25
+ # Whether the model supports medium effort level.
26
+ #
27
+ # @return [Anthropic::Models::CapabilitySupport]
28
+ required :medium, -> { Anthropic::CapabilitySupport }
29
+
30
+ # @!attribute supported
31
+ # Whether this capability is supported by the model.
32
+ #
33
+ # @return [Boolean]
34
+ required :supported, Anthropic::Internal::Type::Boolean
35
+
36
+ # @!method initialize(high:, low:, max:, medium:, supported:)
37
+ # Effort (reasoning_effort) capability details.
38
+ #
39
+ # @param high [Anthropic::Models::CapabilitySupport] Whether the model supports high effort level.
40
+ #
41
+ # @param low [Anthropic::Models::CapabilitySupport] Whether the model supports low effort level.
42
+ #
43
+ # @param max [Anthropic::Models::CapabilitySupport] Whether the model supports max effort level.
44
+ #
45
+ # @param medium [Anthropic::Models::CapabilitySupport] Whether the model supports medium effort level.
46
+ #
47
+ # @param supported [Boolean] Whether this capability is supported by the model.
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module ErrorType
6
+ extend Anthropic::Internal::Type::Enum
7
+
8
+ INVALID_REQUEST_ERROR = :invalid_request_error
9
+ AUTHENTICATION_ERROR = :authentication_error
10
+ PERMISSION_ERROR = :permission_error
11
+ NOT_FOUND_ERROR = :not_found_error
12
+ RATE_LIMIT_ERROR = :rate_limit_error
13
+ TIMEOUT_ERROR = :timeout_error
14
+ OVERLOADED_ERROR = :overloaded_error
15
+ API_ERROR = :api_error
16
+ BILLING_ERROR = :billing_error
17
+
18
+ # @!method self.values
19
+ # @return [Array<Symbol>]
20
+ end
21
+ end
22
+ end