anthropic 1.57.0 → 1.58.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 82d08a6de0932e58a27b89091c4d3c29261acca43943535a4d711467feb483a8
4
- data.tar.gz: c7bb501092d94bac9d6fa81ae6f1e9c107ee1b5b2f3816ed74747d3f6f671148
3
+ metadata.gz: 48ab35bd8cf4f04042fe7c27121f1735ac8cad21809ced2a9dd9cafd220e5f6c
4
+ data.tar.gz: e1fe6ba52bb7ebf74ca4c76c7aaec7a485ee44b9453f7978a44fe1bee8dc188d
5
5
  SHA512:
6
- metadata.gz: 8f8567e516173bba49d9d88423beeecf301207513c66bd5c5700836a30e5015d8d843acdff2cf4af725ff8524821a90b153477e9c8933c86b004d4ff20c12fe5
7
- data.tar.gz: bbff41981982e86ec8fa9652422eaec9b1492b4f968b1965b97756179b890dd324fdaf59989560e30d9101cdc5a0026468dffcf621632c0b4ce76fcac1573c3d
6
+ metadata.gz: c7f72255a73f80441ee63badd6b98f72f6607b8a56e3c3fdfb6d33fa65938d8917702988b22c707c190952458087e2e24710b8b6f7867eb68c045357fd6aaf9e
7
+ data.tar.gz: 6d7b44b71542c194de65cdffdd164ad1e4d25d4caf668b3f0b0f90977ae8bdeb7a1bae803dbaf698aeb1ac583c723de2ae1a0a517e8214a659e9535bc9b4eea1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.58.0 (2026-07-23)
4
+
5
+ Full Changelog: [v1.57.0...v1.58.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v1.57.0...v1.58.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** add new stop reason 'model_context_window_exceeded' ([09a69dd](https://github.com/anthropics/anthropic-sdk-ruby/commit/09a69dd429905e10d3f18abe80a12f26082907b2))
10
+
3
11
  ## 1.57.0 (2026-07-22)
4
12
 
5
13
  Full Changelog: [v1.56.1...v1.57.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v1.56.1...v1.57.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.57.0"
18
+ gem "anthropic", "~> 1.58.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
@@ -122,6 +122,7 @@ module Anthropic
122
122
  # back as-is in a subsequent request to let the model continue.
123
123
  # - `"refusal"`: when streaming classifiers intervene to handle potential policy
124
124
  # violations
125
+ # - `"model_context_window_exceeded"`: we exceeded the model's context window
125
126
  #
126
127
  # In non-streaming mode this value is always non-null. In streaming mode, it is
127
128
  # null in the `message_start` event and non-null otherwise.
@@ -15,25 +15,29 @@ module Anthropic
15
15
  required :session_id, String
16
16
 
17
17
  # @!attribute created_at_gt
18
- # Return events created after this time (exclusive).
18
+ # Return events created after this time (exclusive). Compared against the event's
19
+ # `processed_at` value.
19
20
  #
20
21
  # @return [Time, nil]
21
22
  optional :created_at_gt, Time
22
23
 
23
24
  # @!attribute created_at_gte
24
- # Return events created at or after this time (inclusive).
25
+ # Return events created at or after this time (inclusive). Compared against the
26
+ # event's `processed_at` value.
25
27
  #
26
28
  # @return [Time, nil]
27
29
  optional :created_at_gte, Time
28
30
 
29
31
  # @!attribute created_at_lt
30
- # Return events created before this time (exclusive).
32
+ # Return events created before this time (exclusive). Compared against the event's
33
+ # `processed_at` value.
31
34
  #
32
35
  # @return [Time, nil]
33
36
  optional :created_at_lt, Time
34
37
 
35
38
  # @!attribute created_at_lte
36
- # Return events created at or before this time (inclusive).
39
+ # Return events created at or before this time (inclusive). Compared against the
40
+ # event's `processed_at` value.
37
41
  #
38
42
  # @return [Time, nil]
39
43
  optional :created_at_lte, Time
@@ -45,8 +49,8 @@ module Anthropic
45
49
  optional :limit, Integer
46
50
 
47
51
  # @!attribute order
48
- # Sort direction for results, ordered by created_at. Defaults to asc
49
- # (chronological).
52
+ # Sort direction for results, ordered by the event's `processed_at`. Defaults to
53
+ # asc (chronological).
50
54
  #
51
55
  # @return [Symbol, Anthropic::Models::Beta::Sessions::EventListParams::Order, nil]
52
56
  optional :order, enum: -> { Anthropic::Beta::Sessions::EventListParams::Order }
@@ -76,17 +80,17 @@ module Anthropic
76
80
  #
77
81
  # @param session_id [String]
78
82
  #
79
- # @param created_at_gt [Time] Return events created after this time (exclusive).
83
+ # @param created_at_gt [Time] Return events created after this time (exclusive). Compared against the event's
80
84
  #
81
- # @param created_at_gte [Time] Return events created at or after this time (inclusive).
85
+ # @param created_at_gte [Time] Return events created at or after this time (inclusive). Compared against the ev
82
86
  #
83
- # @param created_at_lt [Time] Return events created before this time (exclusive).
87
+ # @param created_at_lt [Time] Return events created before this time (exclusive). Compared against the event's
84
88
  #
85
- # @param created_at_lte [Time] Return events created at or before this time (inclusive).
89
+ # @param created_at_lte [Time] Return events created at or before this time (inclusive). Compared against the e
86
90
  #
87
91
  # @param limit [Integer] Query parameter for limit
88
92
  #
89
- # @param order [Symbol, Anthropic::Models::Beta::Sessions::EventListParams::Order] Sort direction for results, ordered by created_at. Defaults to asc (chronologica
93
+ # @param order [Symbol, Anthropic::Models::Beta::Sessions::EventListParams::Order] Sort direction for results, ordered by the event's `processed_at`. Defaults to a
90
94
  #
91
95
  # @param page [String] Opaque pagination cursor from a previous response's next_page.
92
96
  #
@@ -96,8 +100,8 @@ module Anthropic
96
100
  #
97
101
  # @param request_options [Anthropic::RequestOptions, Hash{Symbol=>Object}]
98
102
 
99
- # Sort direction for results, ordered by created_at. Defaults to asc
100
- # (chronological).
103
+ # Sort direction for results, ordered by the event's `processed_at`. Defaults to
104
+ # asc (chronological).
101
105
  module Order
102
106
  extend Anthropic::Internal::Type::Enum
103
107
 
@@ -106,6 +106,7 @@ module Anthropic
106
106
  # back as-is in a subsequent request to let the model continue.
107
107
  # - `"refusal"`: when streaming classifiers intervene to handle potential policy
108
108
  # violations
109
+ # - `"model_context_window_exceeded"`: we exceeded the model's context window
109
110
  #
110
111
  # In non-streaming mode this value is always non-null. In streaming mode, it is
111
112
  # null in the `message_start` event and non-null otherwise.
@@ -11,6 +11,7 @@ module Anthropic
11
11
  TOOL_USE = :tool_use
12
12
  PAUSE_TURN = :pause_turn
13
13
  REFUSAL = :refusal
14
+ MODEL_CONTEXT_WINDOW_EXCEEDED = :model_context_window_exceeded
14
15
 
15
16
  # @!method self.values
16
17
  # @return [Array<Symbol>]
@@ -14,17 +14,17 @@ module Anthropic
14
14
  #
15
15
  # @param session_id [String] Path param: Path parameter session_id
16
16
  #
17
- # @param created_at_gt [Time] Query param: Return events created after this time (exclusive).
17
+ # @param created_at_gt [Time] Query param: Return events created after this time (exclusive). Compared against
18
18
  #
19
- # @param created_at_gte [Time] Query param: Return events created at or after this time (inclusive).
19
+ # @param created_at_gte [Time] Query param: Return events created at or after this time (inclusive). Compared a
20
20
  #
21
- # @param created_at_lt [Time] Query param: Return events created before this time (exclusive).
21
+ # @param created_at_lt [Time] Query param: Return events created before this time (exclusive). Compared agains
22
22
  #
23
- # @param created_at_lte [Time] Query param: Return events created at or before this time (inclusive).
23
+ # @param created_at_lte [Time] Query param: Return events created at or before this time (inclusive). Compared
24
24
  #
25
25
  # @param limit [Integer] Query param: Query parameter for limit
26
26
  #
27
- # @param order [Symbol, Anthropic::Models::Beta::Sessions::EventListParams::Order] Query param: Sort direction for results, ordered by created_at. Defaults to asc
27
+ # @param order [Symbol, Anthropic::Models::Beta::Sessions::EventListParams::Order] Query param: Sort direction for results, ordered by the event's `processed_at`.
28
28
  #
29
29
  # @param page [String] Query param: Opaque pagination cursor from a previous response's next_page.
30
30
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Anthropic
4
- VERSION = "1.57.0"
4
+ VERSION = "1.58.0"
5
5
  end
@@ -133,6 +133,7 @@ module Anthropic
133
133
  # back as-is in a subsequent request to let the model continue.
134
134
  # - `"refusal"`: when streaming classifiers intervene to handle potential policy
135
135
  # violations
136
+ # - `"model_context_window_exceeded"`: we exceeded the model's context window
136
137
  #
137
138
  # In non-streaming mode this value is always non-null. In streaming mode, it is
138
139
  # null in the `message_start` event and non-null otherwise.
@@ -281,6 +282,7 @@ module Anthropic
281
282
  # back as-is in a subsequent request to let the model continue.
282
283
  # - `"refusal"`: when streaming classifiers intervene to handle potential policy
283
284
  # violations
285
+ # - `"model_context_window_exceeded"`: we exceeded the model's context window
284
286
  #
285
287
  # In non-streaming mode this value is always non-null. In streaming mode, it is
286
288
  # null in the `message_start` event and non-null otherwise.
@@ -19,28 +19,32 @@ module Anthropic
19
19
  sig { returns(String) }
20
20
  attr_accessor :session_id
21
21
 
22
- # Return events created after this time (exclusive).
22
+ # Return events created after this time (exclusive). Compared against the event's
23
+ # `processed_at` value.
23
24
  sig { returns(T.nilable(Time)) }
24
25
  attr_reader :created_at_gt
25
26
 
26
27
  sig { params(created_at_gt: Time).void }
27
28
  attr_writer :created_at_gt
28
29
 
29
- # Return events created at or after this time (inclusive).
30
+ # Return events created at or after this time (inclusive). Compared against the
31
+ # event's `processed_at` value.
30
32
  sig { returns(T.nilable(Time)) }
31
33
  attr_reader :created_at_gte
32
34
 
33
35
  sig { params(created_at_gte: Time).void }
34
36
  attr_writer :created_at_gte
35
37
 
36
- # Return events created before this time (exclusive).
38
+ # Return events created before this time (exclusive). Compared against the event's
39
+ # `processed_at` value.
37
40
  sig { returns(T.nilable(Time)) }
38
41
  attr_reader :created_at_lt
39
42
 
40
43
  sig { params(created_at_lt: Time).void }
41
44
  attr_writer :created_at_lt
42
45
 
43
- # Return events created at or before this time (inclusive).
46
+ # Return events created at or before this time (inclusive). Compared against the
47
+ # event's `processed_at` value.
44
48
  sig { returns(T.nilable(Time)) }
45
49
  attr_reader :created_at_lte
46
50
 
@@ -54,8 +58,8 @@ module Anthropic
54
58
  sig { params(limit: Integer).void }
55
59
  attr_writer :limit
56
60
 
57
- # Sort direction for results, ordered by created_at. Defaults to asc
58
- # (chronological).
61
+ # Sort direction for results, ordered by the event's `processed_at`. Defaults to
62
+ # asc (chronological).
59
63
  sig do
60
64
  returns(
61
65
  T.nilable(
@@ -123,18 +127,22 @@ module Anthropic
123
127
  end
124
128
  def self.new(
125
129
  session_id:,
126
- # Return events created after this time (exclusive).
130
+ # Return events created after this time (exclusive). Compared against the event's
131
+ # `processed_at` value.
127
132
  created_at_gt: nil,
128
- # Return events created at or after this time (inclusive).
133
+ # Return events created at or after this time (inclusive). Compared against the
134
+ # event's `processed_at` value.
129
135
  created_at_gte: nil,
130
- # Return events created before this time (exclusive).
136
+ # Return events created before this time (exclusive). Compared against the event's
137
+ # `processed_at` value.
131
138
  created_at_lt: nil,
132
- # Return events created at or before this time (inclusive).
139
+ # Return events created at or before this time (inclusive). Compared against the
140
+ # event's `processed_at` value.
133
141
  created_at_lte: nil,
134
142
  # Query parameter for limit
135
143
  limit: nil,
136
- # Sort direction for results, ordered by created_at. Defaults to asc
137
- # (chronological).
144
+ # Sort direction for results, ordered by the event's `processed_at`. Defaults to
145
+ # asc (chronological).
138
146
  order: nil,
139
147
  # Opaque pagination cursor from a previous response's next_page.
140
148
  page: nil,
@@ -169,8 +177,8 @@ module Anthropic
169
177
  def to_hash
170
178
  end
171
179
 
172
- # Sort direction for results, ordered by created_at. Defaults to asc
173
- # (chronological).
180
+ # Sort direction for results, ordered by the event's `processed_at`. Defaults to
181
+ # asc (chronological).
174
182
  module Order
175
183
  extend Anthropic::Internal::Type::Enum
176
184
 
@@ -96,6 +96,7 @@ module Anthropic
96
96
  # back as-is in a subsequent request to let the model continue.
97
97
  # - `"refusal"`: when streaming classifiers intervene to handle potential policy
98
98
  # violations
99
+ # - `"model_context_window_exceeded"`: we exceeded the model's context window
99
100
  #
100
101
  # In non-streaming mode this value is always non-null. In streaming mode, it is
101
102
  # null in the `message_start` event and non-null otherwise.
@@ -226,6 +227,7 @@ module Anthropic
226
227
  # back as-is in a subsequent request to let the model continue.
227
228
  # - `"refusal"`: when streaming classifiers intervene to handle potential policy
228
229
  # violations
230
+ # - `"model_context_window_exceeded"`: we exceeded the model's context window
229
231
  #
230
232
  # In non-streaming mode this value is always non-null. In streaming mode, it is
231
233
  # null in the `message_start` event and non-null otherwise.
@@ -14,6 +14,11 @@ module Anthropic
14
14
  TOOL_USE = T.let(:tool_use, Anthropic::StopReason::TaggedSymbol)
15
15
  PAUSE_TURN = T.let(:pause_turn, Anthropic::StopReason::TaggedSymbol)
16
16
  REFUSAL = T.let(:refusal, Anthropic::StopReason::TaggedSymbol)
17
+ MODEL_CONTEXT_WINDOW_EXCEEDED =
18
+ T.let(
19
+ :model_context_window_exceeded,
20
+ Anthropic::StopReason::TaggedSymbol
21
+ )
17
22
 
18
23
  sig { override.returns(T::Array[Anthropic::StopReason::TaggedSymbol]) }
19
24
  def self.values
@@ -30,18 +30,22 @@ module Anthropic
30
30
  def list(
31
31
  # Path param: Path parameter session_id
32
32
  session_id,
33
- # Query param: Return events created after this time (exclusive).
33
+ # Query param: Return events created after this time (exclusive). Compared against
34
+ # the event's `processed_at` value.
34
35
  created_at_gt: nil,
35
- # Query param: Return events created at or after this time (inclusive).
36
+ # Query param: Return events created at or after this time (inclusive). Compared
37
+ # against the event's `processed_at` value.
36
38
  created_at_gte: nil,
37
- # Query param: Return events created before this time (exclusive).
39
+ # Query param: Return events created before this time (exclusive). Compared
40
+ # against the event's `processed_at` value.
38
41
  created_at_lt: nil,
39
- # Query param: Return events created at or before this time (inclusive).
42
+ # Query param: Return events created at or before this time (inclusive). Compared
43
+ # against the event's `processed_at` value.
40
44
  created_at_lte: nil,
41
45
  # Query param: Query parameter for limit
42
46
  limit: nil,
43
- # Query param: Sort direction for results, ordered by created_at. Defaults to asc
44
- # (chronological).
47
+ # Query param: Sort direction for results, ordered by the event's `processed_at`.
48
+ # Defaults to asc (chronological).
45
49
  order: nil,
46
50
  # Query param: Opaque pagination cursor from a previous response's next_page.
47
51
  page: nil,
@@ -7,6 +7,7 @@ module Anthropic
7
7
  | :tool_use
8
8
  | :pause_turn
9
9
  | :refusal
10
+ | :model_context_window_exceeded
10
11
 
11
12
  module StopReason
12
13
  extend Anthropic::Internal::Type::Enum
@@ -17,6 +18,7 @@ module Anthropic
17
18
  TOOL_USE: :tool_use
18
19
  PAUSE_TURN: :pause_turn
19
20
  REFUSAL: :refusal
21
+ MODEL_CONTEXT_WINDOW_EXCEEDED: :model_context_window_exceeded
20
22
 
21
23
  def self?.values: -> ::Array[Anthropic::Models::stop_reason]
22
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anthropic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.57.0
4
+ version: 1.58.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-22 00:00:00.000000000 Z
11
+ date: 2026-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cgi