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,118 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ class SkillListResponse < Anthropic::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ Anthropic::Models::Beta::SkillListResponse,
11
+ Anthropic::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ # Unique identifier for the skill.
16
+ #
17
+ # The format and length of IDs may change over time.
18
+ sig { returns(String) }
19
+ attr_accessor :id
20
+
21
+ # ISO 8601 timestamp of when the skill was created.
22
+ sig { returns(String) }
23
+ attr_accessor :created_at
24
+
25
+ # Display title for the skill.
26
+ #
27
+ # This is a human-readable label that is not included in the prompt sent to the
28
+ # model.
29
+ sig { returns(T.nilable(String)) }
30
+ attr_accessor :display_title
31
+
32
+ # The latest version identifier for the skill.
33
+ #
34
+ # This represents the most recent version of the skill that has been created.
35
+ sig { returns(T.nilable(String)) }
36
+ attr_accessor :latest_version
37
+
38
+ # Source of the skill.
39
+ #
40
+ # This may be one of the following values:
41
+ #
42
+ # - `"custom"`: the skill was created by a user
43
+ # - `"anthropic"`: the skill was created by Anthropic
44
+ sig { returns(String) }
45
+ attr_accessor :source
46
+
47
+ # Object type.
48
+ #
49
+ # For Skills, this is always `"skill"`.
50
+ sig { returns(String) }
51
+ attr_accessor :type
52
+
53
+ # ISO 8601 timestamp of when the skill was last updated.
54
+ sig { returns(String) }
55
+ attr_accessor :updated_at
56
+
57
+ sig do
58
+ params(
59
+ id: String,
60
+ created_at: String,
61
+ display_title: T.nilable(String),
62
+ latest_version: T.nilable(String),
63
+ source: String,
64
+ type: String,
65
+ updated_at: String
66
+ ).returns(T.attached_class)
67
+ end
68
+ def self.new(
69
+ # Unique identifier for the skill.
70
+ #
71
+ # The format and length of IDs may change over time.
72
+ id:,
73
+ # ISO 8601 timestamp of when the skill was created.
74
+ created_at:,
75
+ # Display title for the skill.
76
+ #
77
+ # This is a human-readable label that is not included in the prompt sent to the
78
+ # model.
79
+ display_title:,
80
+ # The latest version identifier for the skill.
81
+ #
82
+ # This represents the most recent version of the skill that has been created.
83
+ latest_version:,
84
+ # Source of the skill.
85
+ #
86
+ # This may be one of the following values:
87
+ #
88
+ # - `"custom"`: the skill was created by a user
89
+ # - `"anthropic"`: the skill was created by Anthropic
90
+ source:,
91
+ # Object type.
92
+ #
93
+ # For Skills, this is always `"skill"`.
94
+ type:,
95
+ # ISO 8601 timestamp of when the skill was last updated.
96
+ updated_at:
97
+ )
98
+ end
99
+
100
+ sig do
101
+ override.returns(
102
+ {
103
+ id: String,
104
+ created_at: String,
105
+ display_title: T.nilable(String),
106
+ latest_version: T.nilable(String),
107
+ source: String,
108
+ type: String,
109
+ updated_at: String
110
+ }
111
+ )
112
+ end
113
+ def to_hash
114
+ end
115
+ end
116
+ end
117
+ end
118
+ end
@@ -0,0 +1,62 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ class SkillRetrieveParams < Anthropic::Internal::Type::BaseModel
7
+ extend Anthropic::Internal::Type::RequestParameters::Converter
8
+ include Anthropic::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Anthropic::Beta::SkillRetrieveParams,
14
+ Anthropic::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ # Optional header to specify the beta version(s) you want to use.
19
+ sig do
20
+ returns(
21
+ T.nilable(
22
+ T::Array[T.any(String, Anthropic::AnthropicBeta::OrSymbol)]
23
+ )
24
+ )
25
+ end
26
+ attr_reader :betas
27
+
28
+ sig do
29
+ params(
30
+ betas: T::Array[T.any(String, Anthropic::AnthropicBeta::OrSymbol)]
31
+ ).void
32
+ end
33
+ attr_writer :betas
34
+
35
+ sig do
36
+ params(
37
+ betas: T::Array[T.any(String, Anthropic::AnthropicBeta::OrSymbol)],
38
+ request_options: Anthropic::RequestOptions::OrHash
39
+ ).returns(T.attached_class)
40
+ end
41
+ def self.new(
42
+ # Optional header to specify the beta version(s) you want to use.
43
+ betas: nil,
44
+ request_options: {}
45
+ )
46
+ end
47
+
48
+ sig do
49
+ override.returns(
50
+ {
51
+ betas:
52
+ T::Array[T.any(String, Anthropic::AnthropicBeta::OrSymbol)],
53
+ request_options: Anthropic::RequestOptions
54
+ }
55
+ )
56
+ end
57
+ def to_hash
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,118 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ class SkillRetrieveResponse < Anthropic::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ Anthropic::Models::Beta::SkillRetrieveResponse,
11
+ Anthropic::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ # Unique identifier for the skill.
16
+ #
17
+ # The format and length of IDs may change over time.
18
+ sig { returns(String) }
19
+ attr_accessor :id
20
+
21
+ # ISO 8601 timestamp of when the skill was created.
22
+ sig { returns(String) }
23
+ attr_accessor :created_at
24
+
25
+ # Display title for the skill.
26
+ #
27
+ # This is a human-readable label that is not included in the prompt sent to the
28
+ # model.
29
+ sig { returns(T.nilable(String)) }
30
+ attr_accessor :display_title
31
+
32
+ # The latest version identifier for the skill.
33
+ #
34
+ # This represents the most recent version of the skill that has been created.
35
+ sig { returns(T.nilable(String)) }
36
+ attr_accessor :latest_version
37
+
38
+ # Source of the skill.
39
+ #
40
+ # This may be one of the following values:
41
+ #
42
+ # - `"custom"`: the skill was created by a user
43
+ # - `"anthropic"`: the skill was created by Anthropic
44
+ sig { returns(String) }
45
+ attr_accessor :source
46
+
47
+ # Object type.
48
+ #
49
+ # For Skills, this is always `"skill"`.
50
+ sig { returns(String) }
51
+ attr_accessor :type
52
+
53
+ # ISO 8601 timestamp of when the skill was last updated.
54
+ sig { returns(String) }
55
+ attr_accessor :updated_at
56
+
57
+ sig do
58
+ params(
59
+ id: String,
60
+ created_at: String,
61
+ display_title: T.nilable(String),
62
+ latest_version: T.nilable(String),
63
+ source: String,
64
+ type: String,
65
+ updated_at: String
66
+ ).returns(T.attached_class)
67
+ end
68
+ def self.new(
69
+ # Unique identifier for the skill.
70
+ #
71
+ # The format and length of IDs may change over time.
72
+ id:,
73
+ # ISO 8601 timestamp of when the skill was created.
74
+ created_at:,
75
+ # Display title for the skill.
76
+ #
77
+ # This is a human-readable label that is not included in the prompt sent to the
78
+ # model.
79
+ display_title:,
80
+ # The latest version identifier for the skill.
81
+ #
82
+ # This represents the most recent version of the skill that has been created.
83
+ latest_version:,
84
+ # Source of the skill.
85
+ #
86
+ # This may be one of the following values:
87
+ #
88
+ # - `"custom"`: the skill was created by a user
89
+ # - `"anthropic"`: the skill was created by Anthropic
90
+ source:,
91
+ # Object type.
92
+ #
93
+ # For Skills, this is always `"skill"`.
94
+ type:,
95
+ # ISO 8601 timestamp of when the skill was last updated.
96
+ updated_at:
97
+ )
98
+ end
99
+
100
+ sig do
101
+ override.returns(
102
+ {
103
+ id: String,
104
+ created_at: String,
105
+ display_title: T.nilable(String),
106
+ latest_version: T.nilable(String),
107
+ source: String,
108
+ type: String,
109
+ updated_at: String
110
+ }
111
+ )
112
+ end
113
+ def to_hash
114
+ end
115
+ end
116
+ end
117
+ end
118
+ end
@@ -0,0 +1,79 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ module Skills
7
+ class VersionCreateParams < Anthropic::Internal::Type::BaseModel
8
+ extend Anthropic::Internal::Type::RequestParameters::Converter
9
+ include Anthropic::Internal::Type::RequestParameters
10
+
11
+ OrHash =
12
+ T.type_alias do
13
+ T.any(
14
+ Anthropic::Beta::Skills::VersionCreateParams,
15
+ Anthropic::Internal::AnyHash
16
+ )
17
+ end
18
+
19
+ # Files to upload for the skill.
20
+ #
21
+ # All files must be in the same top-level directory and must include a SKILL.md
22
+ # file at the root of that directory.
23
+ sig { returns(T.nilable(T::Array[Anthropic::Internal::FileInput])) }
24
+ attr_accessor :files
25
+
26
+ # Optional header to specify the beta version(s) you want to use.
27
+ sig do
28
+ returns(
29
+ T.nilable(
30
+ T::Array[T.any(String, Anthropic::AnthropicBeta::OrSymbol)]
31
+ )
32
+ )
33
+ end
34
+ attr_reader :betas
35
+
36
+ sig do
37
+ params(
38
+ betas: T::Array[T.any(String, Anthropic::AnthropicBeta::OrSymbol)]
39
+ ).void
40
+ end
41
+ attr_writer :betas
42
+
43
+ sig do
44
+ params(
45
+ files: T.nilable(T::Array[Anthropic::Internal::FileInput]),
46
+ betas:
47
+ T::Array[T.any(String, Anthropic::AnthropicBeta::OrSymbol)],
48
+ request_options: Anthropic::RequestOptions::OrHash
49
+ ).returns(T.attached_class)
50
+ end
51
+ def self.new(
52
+ # Files to upload for the skill.
53
+ #
54
+ # All files must be in the same top-level directory and must include a SKILL.md
55
+ # file at the root of that directory.
56
+ files: nil,
57
+ # Optional header to specify the beta version(s) you want to use.
58
+ betas: nil,
59
+ request_options: {}
60
+ )
61
+ end
62
+
63
+ sig do
64
+ override.returns(
65
+ {
66
+ files: T.nilable(T::Array[Anthropic::Internal::FileInput]),
67
+ betas:
68
+ T::Array[T.any(String, Anthropic::AnthropicBeta::OrSymbol)],
69
+ request_options: Anthropic::RequestOptions
70
+ }
71
+ )
72
+ end
73
+ def to_hash
74
+ end
75
+ end
76
+ end
77
+ end
78
+ end
79
+ end
@@ -0,0 +1,124 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ module Skills
7
+ class VersionCreateResponse < Anthropic::Internal::Type::BaseModel
8
+ OrHash =
9
+ T.type_alias do
10
+ T.any(
11
+ Anthropic::Models::Beta::Skills::VersionCreateResponse,
12
+ Anthropic::Internal::AnyHash
13
+ )
14
+ end
15
+
16
+ # Unique identifier for the skill version.
17
+ #
18
+ # The format and length of IDs may change over time.
19
+ sig { returns(String) }
20
+ attr_accessor :id
21
+
22
+ # ISO 8601 timestamp of when the skill version was created.
23
+ sig { returns(String) }
24
+ attr_accessor :created_at
25
+
26
+ # Description of the skill version.
27
+ #
28
+ # This is extracted from the SKILL.md file in the skill upload.
29
+ sig { returns(String) }
30
+ attr_accessor :description
31
+
32
+ # Directory name of the skill version.
33
+ #
34
+ # This is the top-level directory name that was extracted from the uploaded files.
35
+ sig { returns(String) }
36
+ attr_accessor :directory
37
+
38
+ # Human-readable name of the skill version.
39
+ #
40
+ # This is extracted from the SKILL.md file in the skill upload.
41
+ sig { returns(String) }
42
+ attr_accessor :name
43
+
44
+ # Identifier for the skill that this version belongs to.
45
+ sig { returns(String) }
46
+ attr_accessor :skill_id
47
+
48
+ # Object type.
49
+ #
50
+ # For Skill Versions, this is always `"skill_version"`.
51
+ sig { returns(String) }
52
+ attr_accessor :type
53
+
54
+ # Version identifier for the skill.
55
+ #
56
+ # Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
57
+ sig { returns(String) }
58
+ attr_accessor :version
59
+
60
+ sig do
61
+ params(
62
+ id: String,
63
+ created_at: String,
64
+ description: String,
65
+ directory: String,
66
+ name: String,
67
+ skill_id: String,
68
+ type: String,
69
+ version: String
70
+ ).returns(T.attached_class)
71
+ end
72
+ def self.new(
73
+ # Unique identifier for the skill version.
74
+ #
75
+ # The format and length of IDs may change over time.
76
+ id:,
77
+ # ISO 8601 timestamp of when the skill version was created.
78
+ created_at:,
79
+ # Description of the skill version.
80
+ #
81
+ # This is extracted from the SKILL.md file in the skill upload.
82
+ description:,
83
+ # Directory name of the skill version.
84
+ #
85
+ # This is the top-level directory name that was extracted from the uploaded files.
86
+ directory:,
87
+ # Human-readable name of the skill version.
88
+ #
89
+ # This is extracted from the SKILL.md file in the skill upload.
90
+ name:,
91
+ # Identifier for the skill that this version belongs to.
92
+ skill_id:,
93
+ # Object type.
94
+ #
95
+ # For Skill Versions, this is always `"skill_version"`.
96
+ type:,
97
+ # Version identifier for the skill.
98
+ #
99
+ # Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
100
+ version:
101
+ )
102
+ end
103
+
104
+ sig do
105
+ override.returns(
106
+ {
107
+ id: String,
108
+ created_at: String,
109
+ description: String,
110
+ directory: String,
111
+ name: String,
112
+ skill_id: String,
113
+ type: String,
114
+ version: String
115
+ }
116
+ )
117
+ end
118
+ def to_hash
119
+ end
120
+ end
121
+ end
122
+ end
123
+ end
124
+ end
@@ -0,0 +1,77 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ module Skills
7
+ class VersionDeleteParams < Anthropic::Internal::Type::BaseModel
8
+ extend Anthropic::Internal::Type::RequestParameters::Converter
9
+ include Anthropic::Internal::Type::RequestParameters
10
+
11
+ OrHash =
12
+ T.type_alias do
13
+ T.any(
14
+ Anthropic::Beta::Skills::VersionDeleteParams,
15
+ Anthropic::Internal::AnyHash
16
+ )
17
+ end
18
+
19
+ # Unique identifier for the skill.
20
+ #
21
+ # The format and length of IDs may change over time.
22
+ sig { returns(String) }
23
+ attr_accessor :skill_id
24
+
25
+ # Optional header to specify the beta version(s) you want to use.
26
+ sig do
27
+ returns(
28
+ T.nilable(
29
+ T::Array[T.any(String, Anthropic::AnthropicBeta::OrSymbol)]
30
+ )
31
+ )
32
+ end
33
+ attr_reader :betas
34
+
35
+ sig do
36
+ params(
37
+ betas: T::Array[T.any(String, Anthropic::AnthropicBeta::OrSymbol)]
38
+ ).void
39
+ end
40
+ attr_writer :betas
41
+
42
+ sig do
43
+ params(
44
+ skill_id: String,
45
+ betas:
46
+ T::Array[T.any(String, Anthropic::AnthropicBeta::OrSymbol)],
47
+ request_options: Anthropic::RequestOptions::OrHash
48
+ ).returns(T.attached_class)
49
+ end
50
+ def self.new(
51
+ # Unique identifier for the skill.
52
+ #
53
+ # The format and length of IDs may change over time.
54
+ skill_id:,
55
+ # Optional header to specify the beta version(s) you want to use.
56
+ betas: nil,
57
+ request_options: {}
58
+ )
59
+ end
60
+
61
+ sig do
62
+ override.returns(
63
+ {
64
+ skill_id: String,
65
+ betas:
66
+ T::Array[T.any(String, Anthropic::AnthropicBeta::OrSymbol)],
67
+ request_options: Anthropic::RequestOptions
68
+ }
69
+ )
70
+ end
71
+ def to_hash
72
+ end
73
+ end
74
+ end
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,48 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ module Skills
7
+ class VersionDeleteResponse < Anthropic::Internal::Type::BaseModel
8
+ OrHash =
9
+ T.type_alias do
10
+ T.any(
11
+ Anthropic::Models::Beta::Skills::VersionDeleteResponse,
12
+ Anthropic::Internal::AnyHash
13
+ )
14
+ end
15
+
16
+ # Version identifier for the skill.
17
+ #
18
+ # Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
19
+ sig { returns(String) }
20
+ attr_accessor :id
21
+
22
+ # Deleted object type.
23
+ #
24
+ # For Skill Versions, this is always `"skill_version_deleted"`.
25
+ sig { returns(String) }
26
+ attr_accessor :type
27
+
28
+ sig { params(id: String, type: String).returns(T.attached_class) }
29
+ def self.new(
30
+ # Version identifier for the skill.
31
+ #
32
+ # Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
33
+ id:,
34
+ # Deleted object type.
35
+ #
36
+ # For Skill Versions, this is always `"skill_version_deleted"`.
37
+ type:
38
+ )
39
+ end
40
+
41
+ sig { override.returns({ id: String, type: String }) }
42
+ def to_hash
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end