anthropic 1.59.0 → 1.60.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 (39) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +23 -0
  3. data/README.md +1 -1
  4. data/lib/anthropic/client.rb +0 -1
  5. data/lib/anthropic/internal/type/union.rb +3 -1
  6. data/lib/anthropic/models/anthropic_beta.rb +3 -0
  7. data/lib/anthropic/models/beta/beta_managed_agents_custom_tool_params.rb +1 -1
  8. data/lib/anthropic/models/beta/beta_redacted_thinking_block.rb +15 -1
  9. data/lib/anthropic/models/beta/beta_redacted_thinking_block_param.rb +7 -1
  10. data/lib/anthropic/models/beta/beta_signature_delta.rb +8 -1
  11. data/lib/anthropic/models/beta/beta_thinking_block.rb +18 -2
  12. data/lib/anthropic/models/beta/beta_thinking_block_param.rb +13 -2
  13. data/lib/anthropic/models/beta/beta_thinking_delta.rb +4 -1
  14. data/lib/anthropic/models/model.rb +0 -16
  15. data/lib/anthropic/models/redacted_thinking_block.rb +15 -1
  16. data/lib/anthropic/models/redacted_thinking_block_param.rb +7 -1
  17. data/lib/anthropic/models/signature_delta.rb +8 -1
  18. data/lib/anthropic/models/thinking_block.rb +18 -2
  19. data/lib/anthropic/models/thinking_block_param.rb +13 -2
  20. data/lib/anthropic/models/thinking_delta.rb +8 -1
  21. data/lib/anthropic/version.rb +1 -1
  22. data/rbi/anthropic/models/anthropic_beta.rbi +5 -0
  23. data/rbi/anthropic/models/beta/beta_managed_agents_custom_tool_params.rbi +2 -2
  24. data/rbi/anthropic/models/beta/beta_redacted_thinking_block.rbi +24 -1
  25. data/rbi/anthropic/models/beta/beta_redacted_thinking_block_param.rbi +8 -1
  26. data/rbi/anthropic/models/beta/beta_signature_delta.rbi +10 -1
  27. data/rbi/anthropic/models/beta/beta_thinking_block.rbi +27 -1
  28. data/rbi/anthropic/models/beta/beta_thinking_block_param.rbi +17 -1
  29. data/rbi/anthropic/models/beta/beta_thinking_delta.rbi +6 -0
  30. data/rbi/anthropic/models/model.rbi +0 -8
  31. data/rbi/anthropic/models/redacted_thinking_block.rbi +24 -1
  32. data/rbi/anthropic/models/redacted_thinking_block_param.rbi +8 -1
  33. data/rbi/anthropic/models/signature_delta.rbi +10 -1
  34. data/rbi/anthropic/models/thinking_block.rbi +27 -1
  35. data/rbi/anthropic/models/thinking_block_param.rbi +17 -1
  36. data/rbi/anthropic/models/thinking_delta.rbi +10 -1
  37. data/sig/anthropic/models/anthropic_beta.rbs +2 -0
  38. data/sig/anthropic/models/model.rbs +0 -8
  39. metadata +32 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a5c7920c024b325266d16d26526490511c33ee3de9136b7a0314a6d7c28f8c0a
4
- data.tar.gz: 21354f0f03146858812a863149f1c02b7f961cdbd3d7726b166530d628d340eb
3
+ metadata.gz: efbaa5ea2af0df006d6f8a4ea867da82d577e6e4805367c51741ac17fb7ea409
4
+ data.tar.gz: bfa7b1ac0faa0f00c7fa7ca83dfab534255b29ef9f4326ce44e2e89da301d35b
5
5
  SHA512:
6
- metadata.gz: be751a0e2ddaf99238b87eefb9d67fb7479542f624d42490dc009eb1b1fcdd92159bea36526d41ab07d26687ab943911b94e27941b809f6322478ffaaa0baff2
7
- data.tar.gz: da3afb6cf93ae7f9a4ab4fe2bca496f80eca4222ab80638677bca0eebd6cc9c0e556f980d2214a112aec585349193b8fcf73dde751b8a087c0da56a65647fd7f
6
+ metadata.gz: 6e5e8fc6150933d2b88ad45dc9cdb7f0d7af4be76e193deaeb1513db120cd886276d7435439040d939e33bd799bf3a1e4aa4af94a65425414429c53f7b346a2f
7
+ data.tar.gz: f2ad79c7da87618848dc58f0802147c6efdd8aa4f7363ffb11b5619783e690b09564732dc5414047931395a8b7a3290a0169a9c434eafe369776e2af3bdaeb8e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.60.0 (2026-08-06)
4
+
5
+ Full Changelog: [v1.59.0...v1.60.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v1.59.0...v1.60.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** add `mid-conversation-tool-changes-2026-07-01` beta ([f52232a](https://github.com/anthropics/anthropic-sdk-ruby/commit/f52232a5ed81f9911d0481b41b2bbe44456c421b))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * **client:** declare `base64` gemspec dependency so `require` works under Bundler on Ruby 3.4+ ([468dd7d](https://github.com/anthropics/anthropic-sdk-ruby/commit/468dd7d5fcd5ba973825968c5f6dd6529b586201))
15
+ * **deps:** constrain gemspec runtime dependencies to their current major ([#141](https://github.com/anthropics/anthropic-sdk-ruby/issues/141)) ([b0e644c](https://github.com/anthropics/anthropic-sdk-ruby/commit/b0e644ceac00a7f9b43632345fa99c86717b7cca))
16
+ * **internal:** preserve coerce state strictness in discriminated union fast path ([b30146f](https://github.com/anthropics/anthropic-sdk-ruby/commit/b30146f91e58ba71a751685ea3264ee757a7cc77))
17
+
18
+
19
+ ### Chores
20
+
21
+ * **api:** remove retired Claude Opus 4.1 models ([b7b2043](https://github.com/anthropics/anthropic-sdk-ruby/commit/b7b2043b8bdf38271a6269771c1869b96fb66d82))
22
+ * **deps:** bump 6 CVE-flagged dev/test gems to CVE-clean versions ([#146](https://github.com/anthropics/anthropic-sdk-ruby/issues/146)) ([ae3a617](https://github.com/anthropics/anthropic-sdk-ruby/commit/ae3a61750cede1c854e15047c411241b82ede8de))
23
+ * **docs:** small updates to descriptions ([b8dc207](https://github.com/anthropics/anthropic-sdk-ruby/commit/b8dc207c909f48c7b276cef6da79e99404e1b6c7))
24
+ * **docs:** updates to a few documentation strings ([b83066a](https://github.com/anthropics/anthropic-sdk-ruby/commit/b83066acd84f805bdf475883d1b3e3029f421103))
25
+
3
26
  ## 1.59.0 (2026-07-24)
4
27
 
5
28
  Full Changelog: [v1.58.0...v1.59.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v1.58.0...v1.59.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.59.0"
18
+ gem "anthropic", "~> 1.60.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
@@ -48,7 +48,6 @@ module Anthropic
48
48
  "claude-4-opus-20250514": 8_192,
49
49
  "anthropic.claude-opus-4-20250514-v1:0": 8_192,
50
50
  "claude-opus-4@20250514": 8_192,
51
- "claude-opus-4-1-20250805": 8192,
52
51
  "anthropic.claude-opus-4-1-20250805-v1:0": 8192,
53
52
  "claude-opus-4-1@20250805": 8192
54
53
  }.freeze
@@ -163,11 +163,13 @@ module Anthropic
163
163
  #
164
164
  # @return [Object]
165
165
  def coerce(value, state:)
166
+ # read before the early return: the ensure block writes it back into the shared state
167
+ strictness = state.fetch(:strictness)
168
+
166
169
  if (target = resolve_variant(value))
167
170
  return Anthropic::Internal::Type::Converter.coerce(target, value, state: state)
168
171
  end
169
172
 
170
- strictness = state.fetch(:strictness)
171
173
  exactness = state.fetch(:exactness)
172
174
 
173
175
  alternatives = []
@@ -71,6 +71,8 @@ module Anthropic
71
71
 
72
72
  variant const: -> { Anthropic::Models::AnthropicBeta::AGENT_MEMORY_2026_07_22 }
73
73
 
74
+ variant const: -> { Anthropic::Models::AnthropicBeta::MID_CONVERSATION_TOOL_CHANGES_2026_07_01 }
75
+
74
76
  # @!method self.variants
75
77
  # @return [Array(String, Symbol)]
76
78
 
@@ -112,6 +114,7 @@ module Anthropic
112
114
  FALLBACK_CREDIT_2026_06_01 = :"fallback-credit-2026-06-01"
113
115
  FALLBACK_CREDIT_2026_07_01 = :"fallback-credit-2026-07-01"
114
116
  AGENT_MEMORY_2026_07_22 = :"agent-memory-2026-07-22"
117
+ MID_CONVERSATION_TOOL_CHANGES_2026_07_01 = :"mid-conversation-tool-changes-2026-07-01"
115
118
 
116
119
  # @!endgroup
117
120
  end
@@ -6,7 +6,7 @@ module Anthropic
6
6
  class BetaManagedAgentsCustomToolParams < Anthropic::Internal::Type::BaseModel
7
7
  # @!attribute description
8
8
  # Description of what the tool does, shown to the agent to help it decide when to
9
- # use the tool. 1-4096 characters.
9
+ # use the tool.
10
10
  #
11
11
  # @return [String]
12
12
  required :description, String
@@ -5,6 +5,16 @@ module Anthropic
5
5
  module Beta
6
6
  class BetaRedactedThinkingBlock < Anthropic::Internal::Type::BaseModel
7
7
  # @!attribute data
8
+ # The contents of this redacted thinking block, returned when portions of the
9
+ # model's thinking were safety-redacted. This field is opaque and encrypted, with
10
+ # no readable content.
11
+ #
12
+ # Pass `redacted_thinking` blocks back to the API unchanged when continuing a
13
+ # multi-turn conversation.
14
+ #
15
+ # See
16
+ # [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking#redacted-thinking-blocks)
17
+ # for details.
8
18
  #
9
19
  # @return [String]
10
20
  required :data, String
@@ -15,7 +25,11 @@ module Anthropic
15
25
  required :type, const: :redacted_thinking
16
26
 
17
27
  # @!method initialize(data:, type: :redacted_thinking)
18
- # @param data [String]
28
+ # Some parameter documentations has been truncated, see
29
+ # {Anthropic::Models::Beta::BetaRedactedThinkingBlock} for more details.
30
+ #
31
+ # @param data [String] The contents of this redacted thinking block, returned when portions of the mode
32
+ #
19
33
  # @param type [Symbol, :redacted_thinking]
20
34
  end
21
35
  end
@@ -5,6 +5,8 @@ module Anthropic
5
5
  module Beta
6
6
  class BetaRedactedThinkingBlockParam < Anthropic::Internal::Type::BaseModel
7
7
  # @!attribute data
8
+ # The `data` value of this redacted thinking block, exactly as returned by the API
9
+ # in a previous response. Opaque and encrypted; pass it back unchanged.
8
10
  #
9
11
  # @return [String]
10
12
  required :data, String
@@ -15,7 +17,11 @@ module Anthropic
15
17
  required :type, const: :redacted_thinking
16
18
 
17
19
  # @!method initialize(data:, type: :redacted_thinking)
18
- # @param data [String]
20
+ # Some parameter documentations has been truncated, see
21
+ # {Anthropic::Models::Beta::BetaRedactedThinkingBlockParam} for more details.
22
+ #
23
+ # @param data [String] The `data` value of this redacted thinking block, exactly as returned by the API
24
+ #
19
25
  # @param type [Symbol, :redacted_thinking]
20
26
  end
21
27
  end
@@ -5,6 +5,9 @@ module Anthropic
5
5
  module Beta
6
6
  class BetaSignatureDelta < Anthropic::Internal::Type::BaseModel
7
7
  # @!attribute signature
8
+ # The `signature` for this thinking block: an opaque value used to verify that the
9
+ # block was generated by Claude when it is passed back to the API. Delivered in a
10
+ # `signature_delta` event just before the block's `content_block_stop` event.
8
11
  #
9
12
  # @return [String]
10
13
  required :signature, String
@@ -15,7 +18,11 @@ module Anthropic
15
18
  required :type, const: :signature_delta
16
19
 
17
20
  # @!method initialize(signature:, type: :signature_delta)
18
- # @param signature [String]
21
+ # Some parameter documentations has been truncated, see
22
+ # {Anthropic::Models::Beta::BetaSignatureDelta} for more details.
23
+ #
24
+ # @param signature [String] The `signature` for this thinking block: an opaque value used to verify that the
25
+ #
19
26
  # @param type [Symbol, :signature_delta]
20
27
  end
21
28
  end
@@ -5,11 +5,22 @@ module Anthropic
5
5
  module Beta
6
6
  class BetaThinkingBlock < Anthropic::Internal::Type::BaseModel
7
7
  # @!attribute signature
8
+ # A value used to verify that this thinking block was generated by Claude when it
9
+ # is passed back to the API.
10
+ #
11
+ # This is an opaque field and should not be interpreted or parsed. When passing
12
+ # thinking blocks back to the API (required when using tools with extended
13
+ # thinking), pass them back exactly as received, with this field intact.
14
+ #
15
+ # See
16
+ # [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking)
17
+ # for details.
8
18
  #
9
19
  # @return [String]
10
20
  required :signature, String
11
21
 
12
22
  # @!attribute thinking
23
+ # The text of Claude's thinking process for this block.
13
24
  #
14
25
  # @return [String]
15
26
  required :thinking, String
@@ -20,8 +31,13 @@ module Anthropic
20
31
  required :type, const: :thinking
21
32
 
22
33
  # @!method initialize(signature:, thinking:, type: :thinking)
23
- # @param signature [String]
24
- # @param thinking [String]
34
+ # Some parameter documentations has been truncated, see
35
+ # {Anthropic::Models::Beta::BetaThinkingBlock} for more details.
36
+ #
37
+ # @param signature [String] A value used to verify that this thinking block was generated by Claude when it
38
+ #
39
+ # @param thinking [String] The text of Claude's thinking process for this block.
40
+ #
25
41
  # @param type [Symbol, :thinking]
26
42
  end
27
43
  end
@@ -5,11 +5,17 @@ module Anthropic
5
5
  module Beta
6
6
  class BetaThinkingBlockParam < Anthropic::Internal::Type::BaseModel
7
7
  # @!attribute signature
8
+ # The `signature` value of this thinking block, exactly as returned by the API in
9
+ # a previous response. Used to verify that the block was generated by Claude.
10
+ #
11
+ # Thinking blocks must be passed back unmodified and in their original order; a
12
+ # modified block results in a 400 `invalid_request_error`.
8
13
  #
9
14
  # @return [String]
10
15
  required :signature, String
11
16
 
12
17
  # @!attribute thinking
18
+ # The `thinking` text of this block as returned by the API.
13
19
  #
14
20
  # @return [String]
15
21
  required :thinking, String
@@ -20,8 +26,13 @@ module Anthropic
20
26
  required :type, const: :thinking
21
27
 
22
28
  # @!method initialize(signature:, thinking:, type: :thinking)
23
- # @param signature [String]
24
- # @param thinking [String]
29
+ # Some parameter documentations has been truncated, see
30
+ # {Anthropic::Models::Beta::BetaThinkingBlockParam} for more details.
31
+ #
32
+ # @param signature [String] The `signature` value of this thinking block, exactly as returned by the API in
33
+ #
34
+ # @param thinking [String] The `thinking` text of this block as returned by the API.
35
+ #
25
36
  # @param type [Symbol, :thinking]
26
37
  end
27
38
  end
@@ -18,6 +18,9 @@ module Anthropic
18
18
  required :estimated_tokens, Integer, nil?: true
19
19
 
20
20
  # @!attribute thinking
21
+ # The incremental `thinking` text for this content block. Concatenate the
22
+ # `thinking` values of successive `thinking_delta` events to assemble the block's
23
+ # full `thinking` value.
21
24
  #
22
25
  # @return [String]
23
26
  required :thinking, String
@@ -33,7 +36,7 @@ module Anthropic
33
36
  #
34
37
  # @param estimated_tokens [Integer, nil] Per-frame increment of a coarse, running estimate of the tokens this thinking bl
35
38
  #
36
- # @param thinking [String]
39
+ # @param thinking [String] The incremental `thinking` text for this content block. Concatenate the `thinkin
37
40
  #
38
41
  # @param type [Symbol, :thinking_delta]
39
42
  end
@@ -39,10 +39,6 @@ module Anthropic
39
39
 
40
40
  variant const: -> { Anthropic::Models::Model::CLAUDE_SONNET_4_5_20250929 }
41
41
 
42
- variant const: -> { Anthropic::Models::Model::CLAUDE_OPUS_4_1 }
43
-
44
- variant const: -> { Anthropic::Models::Model::CLAUDE_OPUS_4_1_20250805 }
45
-
46
42
  variant String
47
43
 
48
44
  # @!method self.variants
@@ -102,18 +98,6 @@ module Anthropic
102
98
  # High-performance model for agents and coding
103
99
  CLAUDE_SONNET_4_5_20250929 = :"claude-sonnet-4-5-20250929"
104
100
 
105
- # Powerful intelligence for long-running agents and coding
106
- # @deprecated Will reach end-of-life on August 5, 2026. Please migrate to a newer model. Visit
107
- # https://docs.anthropic.com/en/docs/resources/model-deprecations for more
108
- # information.
109
- CLAUDE_OPUS_4_1 = :"claude-opus-4-1"
110
-
111
- # Powerful intelligence for long-running agents and coding
112
- # @deprecated Will reach end-of-life on August 5, 2026. Please migrate to a newer model. Visit
113
- # https://docs.anthropic.com/en/docs/resources/model-deprecations for more
114
- # information.
115
- CLAUDE_OPUS_4_1_20250805 = :"claude-opus-4-1-20250805"
116
-
117
101
  # @!endgroup
118
102
  end
119
103
  end
@@ -4,6 +4,16 @@ module Anthropic
4
4
  module Models
5
5
  class RedactedThinkingBlock < Anthropic::Internal::Type::BaseModel
6
6
  # @!attribute data
7
+ # The contents of this redacted thinking block, returned when portions of the
8
+ # model's thinking were safety-redacted. This field is opaque and encrypted, with
9
+ # no readable content.
10
+ #
11
+ # Pass `redacted_thinking` blocks back to the API unchanged when continuing a
12
+ # multi-turn conversation.
13
+ #
14
+ # See
15
+ # [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking#redacted-thinking-blocks)
16
+ # for details.
7
17
  #
8
18
  # @return [String]
9
19
  required :data, String
@@ -14,7 +24,11 @@ module Anthropic
14
24
  required :type, const: :redacted_thinking
15
25
 
16
26
  # @!method initialize(data:, type: :redacted_thinking)
17
- # @param data [String]
27
+ # Some parameter documentations has been truncated, see
28
+ # {Anthropic::Models::RedactedThinkingBlock} for more details.
29
+ #
30
+ # @param data [String] The contents of this redacted thinking block, returned when portions of the mode
31
+ #
18
32
  # @param type [Symbol, :redacted_thinking]
19
33
  end
20
34
  end
@@ -4,6 +4,8 @@ module Anthropic
4
4
  module Models
5
5
  class RedactedThinkingBlockParam < Anthropic::Internal::Type::BaseModel
6
6
  # @!attribute data
7
+ # The `data` value of this redacted thinking block, exactly as returned by the API
8
+ # in a previous response. Opaque and encrypted; pass it back unchanged.
7
9
  #
8
10
  # @return [String]
9
11
  required :data, String
@@ -14,7 +16,11 @@ module Anthropic
14
16
  required :type, const: :redacted_thinking
15
17
 
16
18
  # @!method initialize(data:, type: :redacted_thinking)
17
- # @param data [String]
19
+ # Some parameter documentations has been truncated, see
20
+ # {Anthropic::Models::RedactedThinkingBlockParam} for more details.
21
+ #
22
+ # @param data [String] The `data` value of this redacted thinking block, exactly as returned by the API
23
+ #
18
24
  # @param type [Symbol, :redacted_thinking]
19
25
  end
20
26
  end
@@ -4,6 +4,9 @@ module Anthropic
4
4
  module Models
5
5
  class SignatureDelta < Anthropic::Internal::Type::BaseModel
6
6
  # @!attribute signature
7
+ # The `signature` for this thinking block: an opaque value used to verify that the
8
+ # block was generated by Claude when it is passed back to the API. Delivered in a
9
+ # `signature_delta` event just before the block's `content_block_stop` event.
7
10
  #
8
11
  # @return [String]
9
12
  required :signature, String
@@ -14,7 +17,11 @@ module Anthropic
14
17
  required :type, const: :signature_delta
15
18
 
16
19
  # @!method initialize(signature:, type: :signature_delta)
17
- # @param signature [String]
20
+ # Some parameter documentations has been truncated, see
21
+ # {Anthropic::Models::SignatureDelta} for more details.
22
+ #
23
+ # @param signature [String] The `signature` for this thinking block: an opaque value used to verify that the
24
+ #
18
25
  # @param type [Symbol, :signature_delta]
19
26
  end
20
27
  end
@@ -4,11 +4,22 @@ module Anthropic
4
4
  module Models
5
5
  class ThinkingBlock < Anthropic::Internal::Type::BaseModel
6
6
  # @!attribute signature
7
+ # A value used to verify that this thinking block was generated by Claude when it
8
+ # is passed back to the API.
9
+ #
10
+ # This is an opaque field and should not be interpreted or parsed. When passing
11
+ # thinking blocks back to the API (required when using tools with extended
12
+ # thinking), pass them back exactly as received, with this field intact.
13
+ #
14
+ # See
15
+ # [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking)
16
+ # for details.
7
17
  #
8
18
  # @return [String]
9
19
  required :signature, String
10
20
 
11
21
  # @!attribute thinking
22
+ # The text of Claude's thinking process for this block.
12
23
  #
13
24
  # @return [String]
14
25
  required :thinking, String
@@ -19,8 +30,13 @@ module Anthropic
19
30
  required :type, const: :thinking
20
31
 
21
32
  # @!method initialize(signature:, thinking:, type: :thinking)
22
- # @param signature [String]
23
- # @param thinking [String]
33
+ # Some parameter documentations has been truncated, see
34
+ # {Anthropic::Models::ThinkingBlock} for more details.
35
+ #
36
+ # @param signature [String] A value used to verify that this thinking block was generated by Claude when it
37
+ #
38
+ # @param thinking [String] The text of Claude's thinking process for this block.
39
+ #
24
40
  # @param type [Symbol, :thinking]
25
41
  end
26
42
  end
@@ -4,11 +4,17 @@ module Anthropic
4
4
  module Models
5
5
  class ThinkingBlockParam < Anthropic::Internal::Type::BaseModel
6
6
  # @!attribute signature
7
+ # The `signature` value of this thinking block, exactly as returned by the API in
8
+ # a previous response. Used to verify that the block was generated by Claude.
9
+ #
10
+ # Thinking blocks must be passed back unmodified and in their original order; a
11
+ # modified block results in a 400 `invalid_request_error`.
7
12
  #
8
13
  # @return [String]
9
14
  required :signature, String
10
15
 
11
16
  # @!attribute thinking
17
+ # The `thinking` text of this block as returned by the API.
12
18
  #
13
19
  # @return [String]
14
20
  required :thinking, String
@@ -19,8 +25,13 @@ module Anthropic
19
25
  required :type, const: :thinking
20
26
 
21
27
  # @!method initialize(signature:, thinking:, type: :thinking)
22
- # @param signature [String]
23
- # @param thinking [String]
28
+ # Some parameter documentations has been truncated, see
29
+ # {Anthropic::Models::ThinkingBlockParam} for more details.
30
+ #
31
+ # @param signature [String] The `signature` value of this thinking block, exactly as returned by the API in
32
+ #
33
+ # @param thinking [String] The `thinking` text of this block as returned by the API.
34
+ #
24
35
  # @param type [Symbol, :thinking]
25
36
  end
26
37
  end
@@ -4,6 +4,9 @@ module Anthropic
4
4
  module Models
5
5
  class ThinkingDelta < Anthropic::Internal::Type::BaseModel
6
6
  # @!attribute thinking
7
+ # The incremental `thinking` text for this content block. Concatenate the
8
+ # `thinking` values of successive `thinking_delta` events to assemble the block's
9
+ # full `thinking` value.
7
10
  #
8
11
  # @return [String]
9
12
  required :thinking, String
@@ -14,7 +17,11 @@ module Anthropic
14
17
  required :type, const: :thinking_delta
15
18
 
16
19
  # @!method initialize(thinking:, type: :thinking_delta)
17
- # @param thinking [String]
20
+ # Some parameter documentations has been truncated, see
21
+ # {Anthropic::Models::ThinkingDelta} for more details.
22
+ #
23
+ # @param thinking [String] The incremental `thinking` text for this content block. Concatenate the `thinkin
24
+ #
18
25
  # @param type [Symbol, :thinking_delta]
19
26
  end
20
27
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Anthropic
4
- VERSION = "1.59.0"
4
+ VERSION = "1.60.0"
5
5
  end
@@ -145,6 +145,11 @@ module Anthropic
145
145
  :"agent-memory-2026-07-22",
146
146
  Anthropic::AnthropicBeta::TaggedSymbol
147
147
  )
148
+ MID_CONVERSATION_TOOL_CHANGES_2026_07_01 =
149
+ T.let(
150
+ :"mid-conversation-tool-changes-2026-07-01",
151
+ Anthropic::AnthropicBeta::TaggedSymbol
152
+ )
148
153
  end
149
154
  end
150
155
  end
@@ -15,7 +15,7 @@ module Anthropic
15
15
  end
16
16
 
17
17
  # Description of what the tool does, shown to the agent to help it decide when to
18
- # use the tool. 1-4096 characters.
18
+ # use the tool.
19
19
  sig { returns(String) }
20
20
  attr_accessor :description
21
21
 
@@ -59,7 +59,7 @@ module Anthropic
59
59
  end
60
60
  def self.new(
61
61
  # Description of what the tool does, shown to the agent to help it decide when to
62
- # use the tool. 1-4096 characters.
62
+ # use the tool.
63
63
  description:,
64
64
  # JSON Schema for custom tool input parameters.
65
65
  input_schema:,
@@ -14,6 +14,16 @@ module Anthropic
14
14
  )
15
15
  end
16
16
 
17
+ # The contents of this redacted thinking block, returned when portions of the
18
+ # model's thinking were safety-redacted. This field is opaque and encrypted, with
19
+ # no readable content.
20
+ #
21
+ # Pass `redacted_thinking` blocks back to the API unchanged when continuing a
22
+ # multi-turn conversation.
23
+ #
24
+ # See
25
+ # [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking#redacted-thinking-blocks)
26
+ # for details.
17
27
  sig { returns(String) }
18
28
  attr_accessor :data
19
29
 
@@ -21,7 +31,20 @@ module Anthropic
21
31
  attr_accessor :type
22
32
 
23
33
  sig { params(data: String, type: Symbol).returns(T.attached_class) }
24
- def self.new(data:, type: :redacted_thinking)
34
+ def self.new(
35
+ # The contents of this redacted thinking block, returned when portions of the
36
+ # model's thinking were safety-redacted. This field is opaque and encrypted, with
37
+ # no readable content.
38
+ #
39
+ # Pass `redacted_thinking` blocks back to the API unchanged when continuing a
40
+ # multi-turn conversation.
41
+ #
42
+ # See
43
+ # [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking#redacted-thinking-blocks)
44
+ # for details.
45
+ data:,
46
+ type: :redacted_thinking
47
+ )
25
48
  end
26
49
 
27
50
  sig { override.returns({ data: String, type: Symbol }) }
@@ -14,6 +14,8 @@ module Anthropic
14
14
  )
15
15
  end
16
16
 
17
+ # The `data` value of this redacted thinking block, exactly as returned by the API
18
+ # in a previous response. Opaque and encrypted; pass it back unchanged.
17
19
  sig { returns(String) }
18
20
  attr_accessor :data
19
21
 
@@ -21,7 +23,12 @@ module Anthropic
21
23
  attr_accessor :type
22
24
 
23
25
  sig { params(data: String, type: Symbol).returns(T.attached_class) }
24
- def self.new(data:, type: :redacted_thinking)
26
+ def self.new(
27
+ # The `data` value of this redacted thinking block, exactly as returned by the API
28
+ # in a previous response. Opaque and encrypted; pass it back unchanged.
29
+ data:,
30
+ type: :redacted_thinking
31
+ )
25
32
  end
26
33
 
27
34
  sig { override.returns({ data: String, type: Symbol }) }
@@ -14,6 +14,9 @@ module Anthropic
14
14
  )
15
15
  end
16
16
 
17
+ # The `signature` for this thinking block: an opaque value used to verify that the
18
+ # block was generated by Claude when it is passed back to the API. Delivered in a
19
+ # `signature_delta` event just before the block's `content_block_stop` event.
17
20
  sig { returns(String) }
18
21
  attr_accessor :signature
19
22
 
@@ -23,7 +26,13 @@ module Anthropic
23
26
  sig do
24
27
  params(signature: String, type: Symbol).returns(T.attached_class)
25
28
  end
26
- def self.new(signature:, type: :signature_delta)
29
+ def self.new(
30
+ # The `signature` for this thinking block: an opaque value used to verify that the
31
+ # block was generated by Claude when it is passed back to the API. Delivered in a
32
+ # `signature_delta` event just before the block's `content_block_stop` event.
33
+ signature:,
34
+ type: :signature_delta
35
+ )
27
36
  end
28
37
 
29
38
  sig { override.returns({ signature: String, type: Symbol }) }
@@ -14,9 +14,20 @@ module Anthropic
14
14
  )
15
15
  end
16
16
 
17
+ # A value used to verify that this thinking block was generated by Claude when it
18
+ # is passed back to the API.
19
+ #
20
+ # This is an opaque field and should not be interpreted or parsed. When passing
21
+ # thinking blocks back to the API (required when using tools with extended
22
+ # thinking), pass them back exactly as received, with this field intact.
23
+ #
24
+ # See
25
+ # [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking)
26
+ # for details.
17
27
  sig { returns(String) }
18
28
  attr_accessor :signature
19
29
 
30
+ # The text of Claude's thinking process for this block.
20
31
  sig { returns(String) }
21
32
  attr_accessor :thinking
22
33
 
@@ -28,7 +39,22 @@ module Anthropic
28
39
  T.attached_class
29
40
  )
30
41
  end
31
- def self.new(signature:, thinking:, type: :thinking)
42
+ def self.new(
43
+ # A value used to verify that this thinking block was generated by Claude when it
44
+ # is passed back to the API.
45
+ #
46
+ # This is an opaque field and should not be interpreted or parsed. When passing
47
+ # thinking blocks back to the API (required when using tools with extended
48
+ # thinking), pass them back exactly as received, with this field intact.
49
+ #
50
+ # See
51
+ # [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking)
52
+ # for details.
53
+ signature:,
54
+ # The text of Claude's thinking process for this block.
55
+ thinking:,
56
+ type: :thinking
57
+ )
32
58
  end
33
59
 
34
60
  sig do
@@ -14,9 +14,15 @@ module Anthropic
14
14
  )
15
15
  end
16
16
 
17
+ # The `signature` value of this thinking block, exactly as returned by the API in
18
+ # a previous response. Used to verify that the block was generated by Claude.
19
+ #
20
+ # Thinking blocks must be passed back unmodified and in their original order; a
21
+ # modified block results in a 400 `invalid_request_error`.
17
22
  sig { returns(String) }
18
23
  attr_accessor :signature
19
24
 
25
+ # The `thinking` text of this block as returned by the API.
20
26
  sig { returns(String) }
21
27
  attr_accessor :thinking
22
28
 
@@ -28,7 +34,17 @@ module Anthropic
28
34
  T.attached_class
29
35
  )
30
36
  end
31
- def self.new(signature:, thinking:, type: :thinking)
37
+ def self.new(
38
+ # The `signature` value of this thinking block, exactly as returned by the API in
39
+ # a previous response. Used to verify that the block was generated by Claude.
40
+ #
41
+ # Thinking blocks must be passed back unmodified and in their original order; a
42
+ # modified block results in a 400 `invalid_request_error`.
43
+ signature:,
44
+ # The `thinking` text of this block as returned by the API.
45
+ thinking:,
46
+ type: :thinking
47
+ )
32
48
  end
33
49
 
34
50
  sig do
@@ -25,6 +25,9 @@ module Anthropic
25
25
  sig { returns(T.nilable(Integer)) }
26
26
  attr_accessor :estimated_tokens
27
27
 
28
+ # The incremental `thinking` text for this content block. Concatenate the
29
+ # `thinking` values of successive `thinking_delta` events to assemble the block's
30
+ # full `thinking` value.
28
31
  sig { returns(String) }
29
32
  attr_accessor :thinking
30
33
 
@@ -48,6 +51,9 @@ module Anthropic
48
51
  # so this is a deliberately lossy display hint, not a billable count;
49
52
  # `usage.output_tokens` remains authoritative.
50
53
  estimated_tokens:,
54
+ # The incremental `thinking` text for this content block. Concatenate the
55
+ # `thinking` values of successive `thinking_delta` events to assemble the block's
56
+ # full `thinking` value.
51
57
  thinking:,
52
58
  type: :thinking_delta
53
59
  )
@@ -75,14 +75,6 @@ module Anthropic
75
75
  # High-performance model for agents and coding
76
76
  CLAUDE_SONNET_4_5_20250929 =
77
77
  T.let(:"claude-sonnet-4-5-20250929", Anthropic::Model::TaggedSymbol)
78
-
79
- # Powerful intelligence for long-running agents and coding
80
- CLAUDE_OPUS_4_1 =
81
- T.let(:"claude-opus-4-1", Anthropic::Model::TaggedSymbol)
82
-
83
- # Powerful intelligence for long-running agents and coding
84
- CLAUDE_OPUS_4_1_20250805 =
85
- T.let(:"claude-opus-4-1-20250805", Anthropic::Model::TaggedSymbol)
86
78
  end
87
79
  end
88
80
  end
@@ -8,6 +8,16 @@ module Anthropic
8
8
  T.any(Anthropic::RedactedThinkingBlock, Anthropic::Internal::AnyHash)
9
9
  end
10
10
 
11
+ # The contents of this redacted thinking block, returned when portions of the
12
+ # model's thinking were safety-redacted. This field is opaque and encrypted, with
13
+ # no readable content.
14
+ #
15
+ # Pass `redacted_thinking` blocks back to the API unchanged when continuing a
16
+ # multi-turn conversation.
17
+ #
18
+ # See
19
+ # [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking#redacted-thinking-blocks)
20
+ # for details.
11
21
  sig { returns(String) }
12
22
  attr_accessor :data
13
23
 
@@ -15,7 +25,20 @@ module Anthropic
15
25
  attr_accessor :type
16
26
 
17
27
  sig { params(data: String, type: Symbol).returns(T.attached_class) }
18
- def self.new(data:, type: :redacted_thinking)
28
+ def self.new(
29
+ # The contents of this redacted thinking block, returned when portions of the
30
+ # model's thinking were safety-redacted. This field is opaque and encrypted, with
31
+ # no readable content.
32
+ #
33
+ # Pass `redacted_thinking` blocks back to the API unchanged when continuing a
34
+ # multi-turn conversation.
35
+ #
36
+ # See
37
+ # [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking#redacted-thinking-blocks)
38
+ # for details.
39
+ data:,
40
+ type: :redacted_thinking
41
+ )
19
42
  end
20
43
 
21
44
  sig { override.returns({ data: String, type: Symbol }) }
@@ -11,6 +11,8 @@ module Anthropic
11
11
  )
12
12
  end
13
13
 
14
+ # The `data` value of this redacted thinking block, exactly as returned by the API
15
+ # in a previous response. Opaque and encrypted; pass it back unchanged.
14
16
  sig { returns(String) }
15
17
  attr_accessor :data
16
18
 
@@ -18,7 +20,12 @@ module Anthropic
18
20
  attr_accessor :type
19
21
 
20
22
  sig { params(data: String, type: Symbol).returns(T.attached_class) }
21
- def self.new(data:, type: :redacted_thinking)
23
+ def self.new(
24
+ # The `data` value of this redacted thinking block, exactly as returned by the API
25
+ # in a previous response. Opaque and encrypted; pass it back unchanged.
26
+ data:,
27
+ type: :redacted_thinking
28
+ )
22
29
  end
23
30
 
24
31
  sig { override.returns({ data: String, type: Symbol }) }
@@ -8,6 +8,9 @@ module Anthropic
8
8
  T.any(Anthropic::SignatureDelta, Anthropic::Internal::AnyHash)
9
9
  end
10
10
 
11
+ # The `signature` for this thinking block: an opaque value used to verify that the
12
+ # block was generated by Claude when it is passed back to the API. Delivered in a
13
+ # `signature_delta` event just before the block's `content_block_stop` event.
11
14
  sig { returns(String) }
12
15
  attr_accessor :signature
13
16
 
@@ -15,7 +18,13 @@ module Anthropic
15
18
  attr_accessor :type
16
19
 
17
20
  sig { params(signature: String, type: Symbol).returns(T.attached_class) }
18
- def self.new(signature:, type: :signature_delta)
21
+ def self.new(
22
+ # The `signature` for this thinking block: an opaque value used to verify that the
23
+ # block was generated by Claude when it is passed back to the API. Delivered in a
24
+ # `signature_delta` event just before the block's `content_block_stop` event.
25
+ signature:,
26
+ type: :signature_delta
27
+ )
19
28
  end
20
29
 
21
30
  sig { override.returns({ signature: String, type: Symbol }) }
@@ -8,9 +8,20 @@ module Anthropic
8
8
  T.any(Anthropic::ThinkingBlock, Anthropic::Internal::AnyHash)
9
9
  end
10
10
 
11
+ # A value used to verify that this thinking block was generated by Claude when it
12
+ # is passed back to the API.
13
+ #
14
+ # This is an opaque field and should not be interpreted or parsed. When passing
15
+ # thinking blocks back to the API (required when using tools with extended
16
+ # thinking), pass them back exactly as received, with this field intact.
17
+ #
18
+ # See
19
+ # [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking)
20
+ # for details.
11
21
  sig { returns(String) }
12
22
  attr_accessor :signature
13
23
 
24
+ # The text of Claude's thinking process for this block.
14
25
  sig { returns(String) }
15
26
  attr_accessor :thinking
16
27
 
@@ -22,7 +33,22 @@ module Anthropic
22
33
  T.attached_class
23
34
  )
24
35
  end
25
- def self.new(signature:, thinking:, type: :thinking)
36
+ def self.new(
37
+ # A value used to verify that this thinking block was generated by Claude when it
38
+ # is passed back to the API.
39
+ #
40
+ # This is an opaque field and should not be interpreted or parsed. When passing
41
+ # thinking blocks back to the API (required when using tools with extended
42
+ # thinking), pass them back exactly as received, with this field intact.
43
+ #
44
+ # See
45
+ # [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking)
46
+ # for details.
47
+ signature:,
48
+ # The text of Claude's thinking process for this block.
49
+ thinking:,
50
+ type: :thinking
51
+ )
26
52
  end
27
53
 
28
54
  sig do
@@ -8,9 +8,15 @@ module Anthropic
8
8
  T.any(Anthropic::ThinkingBlockParam, Anthropic::Internal::AnyHash)
9
9
  end
10
10
 
11
+ # The `signature` value of this thinking block, exactly as returned by the API in
12
+ # a previous response. Used to verify that the block was generated by Claude.
13
+ #
14
+ # Thinking blocks must be passed back unmodified and in their original order; a
15
+ # modified block results in a 400 `invalid_request_error`.
11
16
  sig { returns(String) }
12
17
  attr_accessor :signature
13
18
 
19
+ # The `thinking` text of this block as returned by the API.
14
20
  sig { returns(String) }
15
21
  attr_accessor :thinking
16
22
 
@@ -22,7 +28,17 @@ module Anthropic
22
28
  T.attached_class
23
29
  )
24
30
  end
25
- def self.new(signature:, thinking:, type: :thinking)
31
+ def self.new(
32
+ # The `signature` value of this thinking block, exactly as returned by the API in
33
+ # a previous response. Used to verify that the block was generated by Claude.
34
+ #
35
+ # Thinking blocks must be passed back unmodified and in their original order; a
36
+ # modified block results in a 400 `invalid_request_error`.
37
+ signature:,
38
+ # The `thinking` text of this block as returned by the API.
39
+ thinking:,
40
+ type: :thinking
41
+ )
26
42
  end
27
43
 
28
44
  sig do
@@ -8,6 +8,9 @@ module Anthropic
8
8
  T.any(Anthropic::ThinkingDelta, Anthropic::Internal::AnyHash)
9
9
  end
10
10
 
11
+ # The incremental `thinking` text for this content block. Concatenate the
12
+ # `thinking` values of successive `thinking_delta` events to assemble the block's
13
+ # full `thinking` value.
11
14
  sig { returns(String) }
12
15
  attr_accessor :thinking
13
16
 
@@ -15,7 +18,13 @@ module Anthropic
15
18
  attr_accessor :type
16
19
 
17
20
  sig { params(thinking: String, type: Symbol).returns(T.attached_class) }
18
- def self.new(thinking:, type: :thinking_delta)
21
+ def self.new(
22
+ # The incremental `thinking` text for this content block. Concatenate the
23
+ # `thinking` values of successive `thinking_delta` events to assemble the block's
24
+ # full `thinking` value.
25
+ thinking:,
26
+ type: :thinking_delta
27
+ )
19
28
  end
20
29
 
21
30
  sig { override.returns({ thinking: String, type: Symbol }) }
@@ -34,6 +34,7 @@ module Anthropic
34
34
  | :"fallback-credit-2026-06-01"
35
35
  | :"fallback-credit-2026-07-01"
36
36
  | :"agent-memory-2026-07-22"
37
+ | :"mid-conversation-tool-changes-2026-07-01"
37
38
 
38
39
  module AnthropicBeta
39
40
  extend Anthropic::Internal::Type::Union
@@ -72,6 +73,7 @@ module Anthropic
72
73
  FALLBACK_CREDIT_2026_06_01: :"fallback-credit-2026-06-01"
73
74
  FALLBACK_CREDIT_2026_07_01: :"fallback-credit-2026-07-01"
74
75
  AGENT_MEMORY_2026_07_22: :"agent-memory-2026-07-22"
76
+ MID_CONVERSATION_TOOL_CHANGES_2026_07_01: :"mid-conversation-tool-changes-2026-07-01"
75
77
  end
76
78
  end
77
79
  end
@@ -16,8 +16,6 @@ module Anthropic
16
16
  | :"claude-opus-4-5-20251101"
17
17
  | :"claude-sonnet-4-5"
18
18
  | :"claude-sonnet-4-5-20250929"
19
- | :"claude-opus-4-1"
20
- | :"claude-opus-4-1-20250805"
21
19
  | String
22
20
 
23
21
  module Model
@@ -69,12 +67,6 @@ module Anthropic
69
67
 
70
68
  # High-performance model for agents and coding
71
69
  CLAUDE_SONNET_4_5_20250929: :"claude-sonnet-4-5-20250929"
72
-
73
- # Powerful intelligence for long-running agents and coding
74
- CLAUDE_OPUS_4_1: :"claude-opus-4-1"
75
-
76
- # Powerful intelligence for long-running agents and coding
77
- CLAUDE_OPUS_4_1_20250805: :"claude-opus-4-1-20250805"
78
70
  end
79
71
  end
80
72
  end
metadata CHANGED
@@ -1,57 +1,77 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anthropic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.59.0
4
+ version: 1.60.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anthropic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-07-24 00:00:00.000000000 Z
11
+ date: 2026-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: base64
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.1'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: cgi
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
- - - ">="
31
+ - - "~>"
18
32
  - !ruby/object:Gem::Version
19
- version: '0'
33
+ version: '0.1'
20
34
  type: :runtime
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
24
- - - ">="
38
+ - - "~>"
25
39
  - !ruby/object:Gem::Version
26
- version: '0'
40
+ version: '0.1'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: connection_pool
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
45
  - - ">="
32
46
  - !ruby/object:Gem::Version
33
- version: '0'
47
+ version: '2'
48
+ - - "<"
49
+ - !ruby/object:Gem::Version
50
+ version: '4'
34
51
  type: :runtime
35
52
  prerelease: false
36
53
  version_requirements: !ruby/object:Gem::Requirement
37
54
  requirements:
38
55
  - - ">="
39
56
  - !ruby/object:Gem::Version
40
- version: '0'
57
+ version: '2'
58
+ - - "<"
59
+ - !ruby/object:Gem::Version
60
+ version: '4'
41
61
  - !ruby/object:Gem::Dependency
42
62
  name: standardwebhooks
43
63
  requirement: !ruby/object:Gem::Requirement
44
64
  requirements:
45
- - - ">="
65
+ - - "~>"
46
66
  - !ruby/object:Gem::Version
47
- version: '0'
67
+ version: '1.0'
48
68
  type: :runtime
49
69
  prerelease: false
50
70
  version_requirements: !ruby/object:Gem::Requirement
51
71
  requirements:
52
- - - ">="
72
+ - - "~>"
53
73
  - !ruby/object:Gem::Version
54
- version: '0'
74
+ version: '1.0'
55
75
  description:
56
76
  email: support@anthropic.com
57
77
  executables: []