anthropic 1.11.0 → 1.13.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 (177) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +29 -0
  3. data/README.md +1 -1
  4. data/lib/anthropic/helpers/streaming/message_stream.rb +3 -0
  5. data/lib/anthropic/internal/page_cursor.rb +92 -0
  6. data/lib/anthropic/internal/token_page.rb +92 -0
  7. data/lib/anthropic/internal/transport/pooled_net_requester.rb +30 -24
  8. data/lib/anthropic/models/anthropic_beta.rb +3 -0
  9. data/lib/anthropic/models/beta/beta_all_thinking_turns.rb +19 -0
  10. data/lib/anthropic/models/beta/beta_clear_thinking_20251015_edit.rb +48 -0
  11. data/lib/anthropic/models/beta/beta_clear_thinking_20251015_edit_response.rb +36 -0
  12. data/lib/anthropic/models/beta/beta_clear_tool_uses_20250919_edit_response.rb +0 -2
  13. data/lib/anthropic/models/beta/beta_container.rb +9 -1
  14. data/lib/anthropic/models/beta/beta_container_params.rb +34 -0
  15. data/lib/anthropic/models/beta/beta_context_management_config.rb +17 -5
  16. data/lib/anthropic/models/beta/beta_context_management_response.rb +16 -5
  17. data/lib/anthropic/models/beta/beta_mcp_tool_use_block_param.rb +3 -3
  18. data/lib/anthropic/models/beta/beta_message.rb +4 -2
  19. data/lib/anthropic/models/beta/beta_raw_message_delta_event.rb +2 -2
  20. data/lib/anthropic/models/beta/beta_server_tool_use_block_param.rb +3 -3
  21. data/lib/anthropic/models/beta/beta_skill.rb +51 -0
  22. data/lib/anthropic/models/beta/beta_skill_params.rb +51 -0
  23. data/lib/anthropic/models/beta/beta_thinking_config_enabled.rb +1 -1
  24. data/lib/anthropic/models/beta/beta_thinking_config_param.rb +1 -1
  25. data/lib/anthropic/models/beta/beta_thinking_turns.rb +25 -0
  26. data/lib/anthropic/models/beta/beta_tool.rb +5 -3
  27. data/lib/anthropic/models/beta/beta_tool_use_block_param.rb +3 -3
  28. data/lib/anthropic/models/beta/message_count_tokens_params.rb +15 -12
  29. data/lib/anthropic/models/beta/message_create_params.rb +34 -18
  30. data/lib/anthropic/models/beta/messages/batch_create_params.rb +39 -20
  31. data/lib/anthropic/models/beta/skill_create_params.rb +49 -0
  32. data/lib/anthropic/models/beta/skill_create_response.rb +84 -0
  33. data/lib/anthropic/models/beta/skill_delete_params.rb +24 -0
  34. data/lib/anthropic/models/beta/skill_delete_response.rb +34 -0
  35. data/lib/anthropic/models/beta/skill_list_params.rb +61 -0
  36. data/lib/anthropic/models/beta/skill_list_response.rb +84 -0
  37. data/lib/anthropic/models/beta/skill_retrieve_params.rb +24 -0
  38. data/lib/anthropic/models/beta/skill_retrieve_response.rb +84 -0
  39. data/lib/anthropic/models/beta/skills/version_create_params.rb +42 -0
  40. data/lib/anthropic/models/beta/skills/version_create_response.rb +92 -0
  41. data/lib/anthropic/models/beta/skills/version_delete_params.rb +39 -0
  42. data/lib/anthropic/models/beta/skills/version_delete_response.rb +36 -0
  43. data/lib/anthropic/models/beta/skills/version_list_params.rb +47 -0
  44. data/lib/anthropic/models/beta/skills/version_list_response.rb +92 -0
  45. data/lib/anthropic/models/beta/skills/version_retrieve_params.rb +39 -0
  46. data/lib/anthropic/models/beta/skills/version_retrieve_response.rb +92 -0
  47. data/lib/anthropic/models/completion_create_params.rb +3 -4
  48. data/lib/anthropic/models/message_count_tokens_params.rb +10 -10
  49. data/lib/anthropic/models/message_create_params.rb +13 -13
  50. data/lib/anthropic/models/messages/batch_create_params.rb +14 -15
  51. data/lib/anthropic/models/model.rb +6 -20
  52. data/lib/anthropic/models/server_tool_use_block_param.rb +3 -3
  53. data/lib/anthropic/models/stop_reason.rb +0 -1
  54. data/lib/anthropic/models/thinking_config_enabled.rb +1 -1
  55. data/lib/anthropic/models/thinking_config_param.rb +1 -1
  56. data/lib/anthropic/models/tool.rb +5 -3
  57. data/lib/anthropic/models/tool_use_block_param.rb +3 -3
  58. data/lib/anthropic/resources/beta/messages.rb +5 -5
  59. data/lib/anthropic/resources/beta/skills/versions.rb +154 -0
  60. data/lib/anthropic/resources/beta/skills.rb +144 -0
  61. data/lib/anthropic/resources/beta.rb +4 -0
  62. data/lib/anthropic/resources/completions.rb +4 -4
  63. data/lib/anthropic/version.rb +1 -1
  64. data/lib/anthropic.rb +27 -0
  65. data/rbi/anthropic/internal/page_cursor.rbi +25 -0
  66. data/rbi/anthropic/internal/token_page.rbi +25 -0
  67. data/rbi/anthropic/models/anthropic_beta.rbi +2 -0
  68. data/rbi/anthropic/models/beta/beta_all_thinking_turns.rbi +30 -0
  69. data/rbi/anthropic/models/beta/beta_clear_thinking_20251015_edit.rbi +109 -0
  70. data/rbi/anthropic/models/beta/beta_clear_thinking_20251015_edit_response.rbi +61 -0
  71. data/rbi/anthropic/models/beta/beta_clear_tool_uses_20250919_edit_response.rbi +0 -1
  72. data/rbi/anthropic/models/beta/beta_container.rbi +23 -3
  73. data/rbi/anthropic/models/beta/beta_container_params.rbi +54 -0
  74. data/rbi/anthropic/models/beta/beta_context_management_config.rbi +51 -5
  75. data/rbi/anthropic/models/beta/beta_context_management_response.rbi +32 -4
  76. data/rbi/anthropic/models/beta/beta_mcp_tool_use_block.rbi +3 -3
  77. data/rbi/anthropic/models/beta/beta_mcp_tool_use_block_param.rbi +3 -3
  78. data/rbi/anthropic/models/beta/beta_message.rbi +6 -2
  79. data/rbi/anthropic/models/beta/beta_raw_message_delta_event.rbi +2 -2
  80. data/rbi/anthropic/models/beta/beta_server_tool_use_block.rbi +3 -3
  81. data/rbi/anthropic/models/beta/beta_server_tool_use_block_param.rbi +3 -3
  82. data/rbi/anthropic/models/beta/beta_skill.rbi +80 -0
  83. data/rbi/anthropic/models/beta/beta_skill_params.rbi +91 -0
  84. data/rbi/anthropic/models/beta/beta_thinking_config_enabled.rbi +2 -2
  85. data/rbi/anthropic/models/beta/beta_thinking_config_param.rbi +1 -1
  86. data/rbi/anthropic/models/beta/beta_thinking_turns.rbi +33 -0
  87. data/rbi/anthropic/models/beta/beta_tool.rbi +3 -3
  88. data/rbi/anthropic/models/beta/beta_tool_use_block.rbi +8 -3
  89. data/rbi/anthropic/models/beta/beta_tool_use_block_param.rbi +3 -3
  90. data/rbi/anthropic/models/beta/message_count_tokens_params.rbi +27 -21
  91. data/rbi/anthropic/models/beta/message_create_params.rbi +61 -29
  92. data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +70 -33
  93. data/rbi/anthropic/models/beta/skill_create_params.rbi +90 -0
  94. data/rbi/anthropic/models/beta/skill_create_response.rbi +118 -0
  95. data/rbi/anthropic/models/beta/skill_delete_params.rbi +62 -0
  96. data/rbi/anthropic/models/beta/skill_delete_response.rbi +46 -0
  97. data/rbi/anthropic/models/beta/skill_list_params.rbi +109 -0
  98. data/rbi/anthropic/models/beta/skill_list_response.rbi +118 -0
  99. data/rbi/anthropic/models/beta/skill_retrieve_params.rbi +62 -0
  100. data/rbi/anthropic/models/beta/skill_retrieve_response.rbi +118 -0
  101. data/rbi/anthropic/models/beta/skills/version_create_params.rbi +79 -0
  102. data/rbi/anthropic/models/beta/skills/version_create_response.rbi +124 -0
  103. data/rbi/anthropic/models/beta/skills/version_delete_params.rbi +77 -0
  104. data/rbi/anthropic/models/beta/skills/version_delete_response.rbi +48 -0
  105. data/rbi/anthropic/models/beta/skills/version_list_params.rbi +85 -0
  106. data/rbi/anthropic/models/beta/skills/version_list_response.rbi +124 -0
  107. data/rbi/anthropic/models/beta/skills/version_retrieve_params.rbi +77 -0
  108. data/rbi/anthropic/models/beta/skills/version_retrieve_response.rbi +124 -0
  109. data/rbi/anthropic/models/completion_create_params.rbi +6 -8
  110. data/rbi/anthropic/models/message_count_tokens_params.rbi +19 -19
  111. data/rbi/anthropic/models/message_create_params.rbi +24 -24
  112. data/rbi/anthropic/models/messages/batch_create_params.rbi +26 -28
  113. data/rbi/anthropic/models/model.rbi +0 -11
  114. data/rbi/anthropic/models/server_tool_use_block.rbi +8 -3
  115. data/rbi/anthropic/models/server_tool_use_block_param.rbi +3 -3
  116. data/rbi/anthropic/models/stop_reason.rbi +0 -5
  117. data/rbi/anthropic/models/thinking_config_enabled.rbi +2 -2
  118. data/rbi/anthropic/models/thinking_config_param.rbi +1 -1
  119. data/rbi/anthropic/models/tool.rbi +3 -3
  120. data/rbi/anthropic/models/tool_use_block.rbi +8 -3
  121. data/rbi/anthropic/models/tool_use_block_param.rbi +3 -3
  122. data/rbi/anthropic/resources/beta/messages.rbi +51 -36
  123. data/rbi/anthropic/resources/beta/skills/versions.rbi +124 -0
  124. data/rbi/anthropic/resources/beta/skills.rbi +118 -0
  125. data/rbi/anthropic/resources/beta.rbi +3 -0
  126. data/rbi/anthropic/resources/completions.rbi +10 -12
  127. data/rbi/anthropic/resources/messages.rbi +31 -31
  128. data/sig/anthropic/internal/page_cursor.rbs +15 -0
  129. data/sig/anthropic/internal/token_page.rbs +15 -0
  130. data/sig/anthropic/models/anthropic_beta.rbs +2 -0
  131. data/sig/anthropic/models/beta/beta_all_thinking_turns.rbs +17 -0
  132. data/sig/anthropic/models/beta/beta_clear_thinking_20251015_edit.rbs +44 -0
  133. data/sig/anthropic/models/beta/beta_clear_thinking_20251015_edit_response.rbs +34 -0
  134. data/sig/anthropic/models/beta/beta_container.rbs +18 -3
  135. data/sig/anthropic/models/beta/beta_container_params.rbs +26 -0
  136. data/sig/anthropic/models/beta/beta_context_management_config.rbs +18 -6
  137. data/sig/anthropic/models/beta/beta_context_management_response.rbs +14 -4
  138. data/sig/anthropic/models/beta/beta_mcp_tool_use_block.rbs +4 -4
  139. data/sig/anthropic/models/beta/beta_mcp_tool_use_block_param.rbs +4 -4
  140. data/sig/anthropic/models/beta/beta_server_tool_use_block.rbs +4 -4
  141. data/sig/anthropic/models/beta/beta_server_tool_use_block_param.rbs +4 -4
  142. data/sig/anthropic/models/beta/beta_skill.rbs +45 -0
  143. data/sig/anthropic/models/beta/beta_skill_params.rbs +47 -0
  144. data/sig/anthropic/models/beta/beta_thinking_turns.rbs +19 -0
  145. data/sig/anthropic/models/beta/beta_tool.rbs +8 -4
  146. data/sig/anthropic/models/beta/beta_tool_use_block.rbs +9 -4
  147. data/sig/anthropic/models/beta/beta_tool_use_block_param.rbs +4 -4
  148. data/sig/anthropic/models/beta/message_create_params.rbs +12 -4
  149. data/sig/anthropic/models/beta/messages/batch_create_params.rbs +12 -4
  150. data/sig/anthropic/models/beta/skill_create_params.rbs +42 -0
  151. data/sig/anthropic/models/beta/skill_create_response.rbs +52 -0
  152. data/sig/anthropic/models/beta/skill_delete_params.rbs +30 -0
  153. data/sig/anthropic/models/beta/skill_delete_response.rbs +17 -0
  154. data/sig/anthropic/models/beta/skill_list_params.rbs +49 -0
  155. data/sig/anthropic/models/beta/skill_list_response.rbs +52 -0
  156. data/sig/anthropic/models/beta/skill_retrieve_params.rbs +30 -0
  157. data/sig/anthropic/models/beta/skill_retrieve_response.rbs +52 -0
  158. data/sig/anthropic/models/beta/skills/version_create_params.rbs +39 -0
  159. data/sig/anthropic/models/beta/skills/version_create_response.rbs +59 -0
  160. data/sig/anthropic/models/beta/skills/version_delete_params.rbs +39 -0
  161. data/sig/anthropic/models/beta/skills/version_delete_response.rbs +19 -0
  162. data/sig/anthropic/models/beta/skills/version_list_params.rbs +44 -0
  163. data/sig/anthropic/models/beta/skills/version_list_response.rbs +59 -0
  164. data/sig/anthropic/models/beta/skills/version_retrieve_params.rbs +39 -0
  165. data/sig/anthropic/models/beta/skills/version_retrieve_response.rbs +59 -0
  166. data/sig/anthropic/models/model.rbs +0 -11
  167. data/sig/anthropic/models/server_tool_use_block.rbs +9 -4
  168. data/sig/anthropic/models/server_tool_use_block_param.rbs +4 -4
  169. data/sig/anthropic/models/stop_reason.rbs +0 -2
  170. data/sig/anthropic/models/tool.rbs +8 -4
  171. data/sig/anthropic/models/tool_use_block.rbs +9 -4
  172. data/sig/anthropic/models/tool_use_block_param.rbs +4 -4
  173. data/sig/anthropic/resources/beta/messages.rbs +2 -2
  174. data/sig/anthropic/resources/beta/skills/versions.rbs +40 -0
  175. data/sig/anthropic/resources/beta/skills.rbs +38 -0
  176. data/sig/anthropic/resources/beta.rbs +2 -0
  177. metadata +83 -2
@@ -0,0 +1,61 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ BetaClearThinking20251015EditResponse =
6
+ Beta::BetaClearThinking20251015EditResponse
7
+
8
+ module Beta
9
+ class BetaClearThinking20251015EditResponse < Anthropic::Internal::Type::BaseModel
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Anthropic::Beta::BetaClearThinking20251015EditResponse,
14
+ Anthropic::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ # Number of input tokens cleared by this edit.
19
+ sig { returns(Integer) }
20
+ attr_accessor :cleared_input_tokens
21
+
22
+ # Number of thinking turns that were cleared.
23
+ sig { returns(Integer) }
24
+ attr_accessor :cleared_thinking_turns
25
+
26
+ # The type of context management edit applied.
27
+ sig { returns(Symbol) }
28
+ attr_accessor :type
29
+
30
+ sig do
31
+ params(
32
+ cleared_input_tokens: Integer,
33
+ cleared_thinking_turns: Integer,
34
+ type: Symbol
35
+ ).returns(T.attached_class)
36
+ end
37
+ def self.new(
38
+ # Number of input tokens cleared by this edit.
39
+ cleared_input_tokens:,
40
+ # Number of thinking turns that were cleared.
41
+ cleared_thinking_turns:,
42
+ # The type of context management edit applied.
43
+ type: :clear_thinking_20251015
44
+ )
45
+ end
46
+
47
+ sig do
48
+ override.returns(
49
+ {
50
+ cleared_input_tokens: Integer,
51
+ cleared_thinking_turns: Integer,
52
+ type: Symbol
53
+ }
54
+ )
55
+ end
56
+ def to_hash
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
@@ -27,7 +27,6 @@ module Anthropic
27
27
  sig { returns(Symbol) }
28
28
  attr_accessor :type
29
29
 
30
- # Results for clear_tool_uses_20250919 edit.
31
30
  sig do
32
31
  params(
33
32
  cleared_input_tokens: Integer,
@@ -19,18 +19,38 @@ module Anthropic
19
19
  sig { returns(Time) }
20
20
  attr_accessor :expires_at
21
21
 
22
+ # Skills loaded in the container
23
+ sig { returns(T.nilable(T::Array[Anthropic::Beta::BetaSkill])) }
24
+ attr_accessor :skills
25
+
22
26
  # Information about the container used in the request (for the code execution
23
27
  # tool)
24
- sig { params(id: String, expires_at: Time).returns(T.attached_class) }
28
+ sig do
29
+ params(
30
+ id: String,
31
+ expires_at: Time,
32
+ skills: T.nilable(T::Array[Anthropic::Beta::BetaSkill::OrHash])
33
+ ).returns(T.attached_class)
34
+ end
25
35
  def self.new(
26
36
  # Identifier for the container used in this request
27
37
  id:,
28
38
  # The time at which the container will expire.
29
- expires_at:
39
+ expires_at:,
40
+ # Skills loaded in the container
41
+ skills:
30
42
  )
31
43
  end
32
44
 
33
- sig { override.returns({ id: String, expires_at: Time }) }
45
+ sig do
46
+ override.returns(
47
+ {
48
+ id: String,
49
+ expires_at: Time,
50
+ skills: T.nilable(T::Array[Anthropic::Beta::BetaSkill])
51
+ }
52
+ )
53
+ end
34
54
  def to_hash
35
55
  end
36
56
  end
@@ -0,0 +1,54 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ BetaContainerParams = Beta::BetaContainerParams
6
+
7
+ module Beta
8
+ class BetaContainerParams < Anthropic::Internal::Type::BaseModel
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(
12
+ Anthropic::Beta::BetaContainerParams,
13
+ Anthropic::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ # Container id
18
+ sig { returns(T.nilable(String)) }
19
+ attr_accessor :id
20
+
21
+ # List of skills to load in the container
22
+ sig { returns(T.nilable(T::Array[Anthropic::Beta::BetaSkillParams])) }
23
+ attr_accessor :skills
24
+
25
+ # Container parameters with skills to be loaded.
26
+ sig do
27
+ params(
28
+ id: T.nilable(String),
29
+ skills:
30
+ T.nilable(T::Array[Anthropic::Beta::BetaSkillParams::OrHash])
31
+ ).returns(T.attached_class)
32
+ end
33
+ def self.new(
34
+ # Container id
35
+ id: nil,
36
+ # List of skills to load in the container
37
+ skills: nil
38
+ )
39
+ end
40
+
41
+ sig do
42
+ override.returns(
43
+ {
44
+ id: T.nilable(String),
45
+ skills: T.nilable(T::Array[Anthropic::Beta::BetaSkillParams])
46
+ }
47
+ )
48
+ end
49
+ def to_hash
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
@@ -17,7 +17,14 @@ module Anthropic
17
17
  # List of context management edits to apply
18
18
  sig do
19
19
  returns(
20
- T.nilable(T::Array[Anthropic::Beta::BetaClearToolUses20250919Edit])
20
+ T.nilable(
21
+ T::Array[
22
+ T.any(
23
+ Anthropic::Beta::BetaClearToolUses20250919Edit,
24
+ Anthropic::Beta::BetaClearThinking20251015Edit
25
+ )
26
+ ]
27
+ )
21
28
  )
22
29
  end
23
30
  attr_reader :edits
@@ -25,16 +32,25 @@ module Anthropic
25
32
  sig do
26
33
  params(
27
34
  edits:
28
- T::Array[Anthropic::Beta::BetaClearToolUses20250919Edit::OrHash]
35
+ T::Array[
36
+ T.any(
37
+ Anthropic::Beta::BetaClearToolUses20250919Edit::OrHash,
38
+ Anthropic::Beta::BetaClearThinking20251015Edit::OrHash
39
+ )
40
+ ]
29
41
  ).void
30
42
  end
31
43
  attr_writer :edits
32
44
 
33
- # Configuration for context management operations.
34
45
  sig do
35
46
  params(
36
47
  edits:
37
- T::Array[Anthropic::Beta::BetaClearToolUses20250919Edit::OrHash]
48
+ T::Array[
49
+ T.any(
50
+ Anthropic::Beta::BetaClearToolUses20250919Edit::OrHash,
51
+ Anthropic::Beta::BetaClearThinking20251015Edit::OrHash
52
+ )
53
+ ]
38
54
  ).returns(T.attached_class)
39
55
  end
40
56
  def self.new(
@@ -45,11 +61,41 @@ module Anthropic
45
61
 
46
62
  sig do
47
63
  override.returns(
48
- { edits: T::Array[Anthropic::Beta::BetaClearToolUses20250919Edit] }
64
+ {
65
+ edits:
66
+ T::Array[
67
+ T.any(
68
+ Anthropic::Beta::BetaClearToolUses20250919Edit,
69
+ Anthropic::Beta::BetaClearThinking20251015Edit
70
+ )
71
+ ]
72
+ }
49
73
  )
50
74
  end
51
75
  def to_hash
52
76
  end
77
+
78
+ module Edit
79
+ extend Anthropic::Internal::Type::Union
80
+
81
+ Variants =
82
+ T.type_alias do
83
+ T.any(
84
+ Anthropic::Beta::BetaClearToolUses20250919Edit,
85
+ Anthropic::Beta::BetaClearThinking20251015Edit
86
+ )
87
+ end
88
+
89
+ sig do
90
+ override.returns(
91
+ T::Array[
92
+ Anthropic::Beta::BetaContextManagementConfig::Edit::Variants
93
+ ]
94
+ )
95
+ end
96
+ def self.variants
97
+ end
98
+ end
53
99
  end
54
100
  end
55
101
  end
@@ -17,17 +17,21 @@ module Anthropic
17
17
  # List of context management edits that were applied.
18
18
  sig do
19
19
  returns(
20
- T::Array[Anthropic::Beta::BetaClearToolUses20250919EditResponse]
20
+ T::Array[
21
+ Anthropic::Beta::BetaContextManagementResponse::AppliedEdit::Variants
22
+ ]
21
23
  )
22
24
  end
23
25
  attr_accessor :applied_edits
24
26
 
25
- # Information about context management operations applied during the request.
26
27
  sig do
27
28
  params(
28
29
  applied_edits:
29
30
  T::Array[
30
- Anthropic::Beta::BetaClearToolUses20250919EditResponse::OrHash
31
+ T.any(
32
+ Anthropic::Beta::BetaClearToolUses20250919EditResponse::OrHash,
33
+ Anthropic::Beta::BetaClearThinking20251015EditResponse::OrHash
34
+ )
31
35
  ]
32
36
  ).returns(T.attached_class)
33
37
  end
@@ -41,12 +45,36 @@ module Anthropic
41
45
  override.returns(
42
46
  {
43
47
  applied_edits:
44
- T::Array[Anthropic::Beta::BetaClearToolUses20250919EditResponse]
48
+ T::Array[
49
+ Anthropic::Beta::BetaContextManagementResponse::AppliedEdit::Variants
50
+ ]
45
51
  }
46
52
  )
47
53
  end
48
54
  def to_hash
49
55
  end
56
+
57
+ module AppliedEdit
58
+ extend Anthropic::Internal::Type::Union
59
+
60
+ Variants =
61
+ T.type_alias do
62
+ T.any(
63
+ Anthropic::Beta::BetaClearToolUses20250919EditResponse,
64
+ Anthropic::Beta::BetaClearThinking20251015EditResponse
65
+ )
66
+ end
67
+
68
+ sig do
69
+ override.returns(
70
+ T::Array[
71
+ Anthropic::Beta::BetaContextManagementResponse::AppliedEdit::Variants
72
+ ]
73
+ )
74
+ end
75
+ def self.variants
76
+ end
77
+ end
50
78
  end
51
79
  end
52
80
  end
@@ -17,7 +17,7 @@ module Anthropic
17
17
  sig { returns(String) }
18
18
  attr_accessor :id
19
19
 
20
- sig { returns(T.anything) }
20
+ sig { returns(T::Hash[Symbol, T.anything]) }
21
21
  attr_accessor :input
22
22
 
23
23
  # The name of the MCP tool
@@ -34,7 +34,7 @@ module Anthropic
34
34
  sig do
35
35
  params(
36
36
  id: String,
37
- input: T.anything,
37
+ input: T::Hash[Symbol, T.anything],
38
38
  name: String,
39
39
  server_name: String,
40
40
  type: Symbol
@@ -55,7 +55,7 @@ module Anthropic
55
55
  override.returns(
56
56
  {
57
57
  id: String,
58
- input: T.anything,
58
+ input: T::Hash[Symbol, T.anything],
59
59
  name: String,
60
60
  server_name: String,
61
61
  type: Symbol
@@ -17,7 +17,7 @@ module Anthropic
17
17
  sig { returns(String) }
18
18
  attr_accessor :id
19
19
 
20
- sig { returns(T.anything) }
20
+ sig { returns(T::Hash[Symbol, T.anything]) }
21
21
  attr_accessor :input
22
22
 
23
23
  sig { returns(String) }
@@ -45,7 +45,7 @@ module Anthropic
45
45
  sig do
46
46
  params(
47
47
  id: String,
48
- input: T.anything,
48
+ input: T::Hash[Symbol, T.anything],
49
49
  name: String,
50
50
  server_name: String,
51
51
  cache_control:
@@ -69,7 +69,7 @@ module Anthropic
69
69
  override.returns(
70
70
  {
71
71
  id: String,
72
- input: T.anything,
72
+ input: T::Hash[Symbol, T.anything],
73
73
  name: String,
74
74
  server_name: String,
75
75
  type: Symbol,
@@ -64,7 +64,9 @@ module Anthropic
64
64
  sig { returns(T::Array[Anthropic::Beta::BetaContentBlock::Variants]) }
65
65
  attr_accessor :content
66
66
 
67
- # Information about context management operations applied during the request.
67
+ # Context management response.
68
+ #
69
+ # Information about context management strategies applied during the request.
68
70
  sig do
69
71
  returns(T.nilable(Anthropic::Beta::BetaContextManagementResponse))
70
72
  end
@@ -217,7 +219,9 @@ module Anthropic
217
219
  # [{ "type": "text", "text": "B)" }]
218
220
  # ```
219
221
  content:,
220
- # Information about context management operations applied during the request.
222
+ # Context management response.
223
+ #
224
+ # Information about context management strategies applied during the request.
221
225
  context_management:,
222
226
  # The model that will complete your prompt.\n\nSee
223
227
  # [models](https://docs.anthropic.com/en/docs/models-overview) for additional
@@ -14,7 +14,7 @@ module Anthropic
14
14
  )
15
15
  end
16
16
 
17
- # Information about context management operations applied during the request.
17
+ # Information about context management strategies applied during the request
18
18
  sig do
19
19
  returns(T.nilable(Anthropic::Beta::BetaContextManagementResponse))
20
20
  end
@@ -74,7 +74,7 @@ module Anthropic
74
74
  ).returns(T.attached_class)
75
75
  end
76
76
  def self.new(
77
- # Information about context management operations applied during the request.
77
+ # Information about context management strategies applied during the request
78
78
  context_management:,
79
79
  delta:,
80
80
  # Billing and rate-limit usage.
@@ -17,7 +17,7 @@ module Anthropic
17
17
  sig { returns(String) }
18
18
  attr_accessor :id
19
19
 
20
- sig { returns(T.anything) }
20
+ sig { returns(T::Hash[Symbol, T.anything]) }
21
21
  attr_accessor :input
22
22
 
23
23
  sig do
@@ -31,7 +31,7 @@ module Anthropic
31
31
  sig do
32
32
  params(
33
33
  id: String,
34
- input: T.anything,
34
+ input: T::Hash[Symbol, T.anything],
35
35
  name: Anthropic::Beta::BetaServerToolUseBlock::Name::OrSymbol,
36
36
  type: Symbol
37
37
  ).returns(T.attached_class)
@@ -43,7 +43,7 @@ module Anthropic
43
43
  override.returns(
44
44
  {
45
45
  id: String,
46
- input: T.anything,
46
+ input: T::Hash[Symbol, T.anything],
47
47
  name: Anthropic::Beta::BetaServerToolUseBlock::Name::TaggedSymbol,
48
48
  type: Symbol
49
49
  }
@@ -17,7 +17,7 @@ module Anthropic
17
17
  sig { returns(String) }
18
18
  attr_accessor :id
19
19
 
20
- sig { returns(T.anything) }
20
+ sig { returns(T::Hash[Symbol, T.anything]) }
21
21
  attr_accessor :input
22
22
 
23
23
  sig do
@@ -43,7 +43,7 @@ module Anthropic
43
43
  sig do
44
44
  params(
45
45
  id: String,
46
- input: T.anything,
46
+ input: T::Hash[Symbol, T.anything],
47
47
  name: Anthropic::Beta::BetaServerToolUseBlockParam::Name::OrSymbol,
48
48
  cache_control:
49
49
  T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash),
@@ -64,7 +64,7 @@ module Anthropic
64
64
  override.returns(
65
65
  {
66
66
  id: String,
67
- input: T.anything,
67
+ input: T::Hash[Symbol, T.anything],
68
68
  name:
69
69
  Anthropic::Beta::BetaServerToolUseBlockParam::Name::OrSymbol,
70
70
  type: Symbol,
@@ -0,0 +1,80 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ BetaSkill = Beta::BetaSkill
6
+
7
+ module Beta
8
+ class BetaSkill < Anthropic::Internal::Type::BaseModel
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(Anthropic::Beta::BetaSkill, Anthropic::Internal::AnyHash)
12
+ end
13
+
14
+ # Skill ID
15
+ sig { returns(String) }
16
+ attr_accessor :skill_id
17
+
18
+ # Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
19
+ sig { returns(Anthropic::Beta::BetaSkill::Type::TaggedSymbol) }
20
+ attr_accessor :type
21
+
22
+ # Skill version or 'latest' for most recent version
23
+ sig { returns(String) }
24
+ attr_accessor :version
25
+
26
+ # A skill that was loaded in a container (response model).
27
+ sig do
28
+ params(
29
+ skill_id: String,
30
+ type: Anthropic::Beta::BetaSkill::Type::OrSymbol,
31
+ version: String
32
+ ).returns(T.attached_class)
33
+ end
34
+ def self.new(
35
+ # Skill ID
36
+ skill_id:,
37
+ # Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
38
+ type:,
39
+ # Skill version or 'latest' for most recent version
40
+ version:
41
+ )
42
+ end
43
+
44
+ sig do
45
+ override.returns(
46
+ {
47
+ skill_id: String,
48
+ type: Anthropic::Beta::BetaSkill::Type::TaggedSymbol,
49
+ version: String
50
+ }
51
+ )
52
+ end
53
+ def to_hash
54
+ end
55
+
56
+ # Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
57
+ module Type
58
+ extend Anthropic::Internal::Type::Enum
59
+
60
+ TaggedSymbol =
61
+ T.type_alias { T.all(Symbol, Anthropic::Beta::BetaSkill::Type) }
62
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
63
+
64
+ ANTHROPIC =
65
+ T.let(:anthropic, Anthropic::Beta::BetaSkill::Type::TaggedSymbol)
66
+ CUSTOM =
67
+ T.let(:custom, Anthropic::Beta::BetaSkill::Type::TaggedSymbol)
68
+
69
+ sig do
70
+ override.returns(
71
+ T::Array[Anthropic::Beta::BetaSkill::Type::TaggedSymbol]
72
+ )
73
+ end
74
+ def self.values
75
+ end
76
+ end
77
+ end
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,91 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ BetaSkillParams = Beta::BetaSkillParams
6
+
7
+ module Beta
8
+ class BetaSkillParams < Anthropic::Internal::Type::BaseModel
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(
12
+ Anthropic::Beta::BetaSkillParams,
13
+ Anthropic::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ # Skill ID
18
+ sig { returns(String) }
19
+ attr_accessor :skill_id
20
+
21
+ # Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
22
+ sig { returns(Anthropic::Beta::BetaSkillParams::Type::OrSymbol) }
23
+ attr_accessor :type
24
+
25
+ # Skill version or 'latest' for most recent version
26
+ sig { returns(T.nilable(String)) }
27
+ attr_reader :version
28
+
29
+ sig { params(version: String).void }
30
+ attr_writer :version
31
+
32
+ # Specification for a skill to be loaded in a container (request model).
33
+ sig do
34
+ params(
35
+ skill_id: String,
36
+ type: Anthropic::Beta::BetaSkillParams::Type::OrSymbol,
37
+ version: String
38
+ ).returns(T.attached_class)
39
+ end
40
+ def self.new(
41
+ # Skill ID
42
+ skill_id:,
43
+ # Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
44
+ type:,
45
+ # Skill version or 'latest' for most recent version
46
+ version: nil
47
+ )
48
+ end
49
+
50
+ sig do
51
+ override.returns(
52
+ {
53
+ skill_id: String,
54
+ type: Anthropic::Beta::BetaSkillParams::Type::OrSymbol,
55
+ version: String
56
+ }
57
+ )
58
+ end
59
+ def to_hash
60
+ end
61
+
62
+ # Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
63
+ module Type
64
+ extend Anthropic::Internal::Type::Enum
65
+
66
+ TaggedSymbol =
67
+ T.type_alias do
68
+ T.all(Symbol, Anthropic::Beta::BetaSkillParams::Type)
69
+ end
70
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
71
+
72
+ ANTHROPIC =
73
+ T.let(
74
+ :anthropic,
75
+ Anthropic::Beta::BetaSkillParams::Type::TaggedSymbol
76
+ )
77
+ CUSTOM =
78
+ T.let(:custom, Anthropic::Beta::BetaSkillParams::Type::TaggedSymbol)
79
+
80
+ sig do
81
+ override.returns(
82
+ T::Array[Anthropic::Beta::BetaSkillParams::Type::TaggedSymbol]
83
+ )
84
+ end
85
+ def self.values
86
+ end
87
+ end
88
+ end
89
+ end
90
+ end
91
+ end
@@ -21,7 +21,7 @@ module Anthropic
21
21
  # Must be ≥1024 and less than `max_tokens`.
22
22
  #
23
23
  # See
24
- # [extended thinking](https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking)
24
+ # [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
25
25
  # for details.
26
26
  sig { returns(Integer) }
27
27
  attr_accessor :budget_tokens
@@ -40,7 +40,7 @@ module Anthropic
40
40
  # Must be ≥1024 and less than `max_tokens`.
41
41
  #
42
42
  # See
43
- # [extended thinking](https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking)
43
+ # [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
44
44
  # for details.
45
45
  budget_tokens:,
46
46
  type: :enabled
@@ -12,7 +12,7 @@ module Anthropic
12
12
  # tokens and counts towards your `max_tokens` limit.
13
13
  #
14
14
  # See
15
- # [extended thinking](https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking)
15
+ # [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
16
16
  # for details.
17
17
  module BetaThinkingConfigParam
18
18
  extend Anthropic::Internal::Type::Union