anthropic 1.11.0 → 1.12.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 +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +1 -1
- data/lib/anthropic/internal/page_cursor.rb +92 -0
- data/lib/anthropic/internal/token_page.rb +92 -0
- data/lib/anthropic/models/anthropic_beta.rb +3 -0
- data/lib/anthropic/models/beta/beta_clear_tool_uses_20250919_edit_response.rb +0 -2
- data/lib/anthropic/models/beta/beta_container.rb +9 -1
- data/lib/anthropic/models/beta/beta_container_params.rb +34 -0
- data/lib/anthropic/models/beta/beta_context_management_config.rb +0 -2
- data/lib/anthropic/models/beta/beta_context_management_response.rb +0 -2
- data/lib/anthropic/models/beta/beta_message.rb +4 -2
- data/lib/anthropic/models/beta/beta_raw_message_delta_event.rb +2 -2
- data/lib/anthropic/models/beta/beta_skill.rb +51 -0
- data/lib/anthropic/models/beta/beta_skill_params.rb +51 -0
- data/lib/anthropic/models/beta/beta_thinking_config_enabled.rb +1 -1
- data/lib/anthropic/models/beta/beta_thinking_config_param.rb +1 -1
- data/lib/anthropic/models/beta/message_count_tokens_params.rb +15 -12
- data/lib/anthropic/models/beta/message_create_params.rb +34 -18
- data/lib/anthropic/models/beta/messages/batch_create_params.rb +39 -20
- data/lib/anthropic/models/beta/skill_create_params.rb +49 -0
- data/lib/anthropic/models/beta/skill_create_response.rb +84 -0
- data/lib/anthropic/models/beta/skill_delete_params.rb +24 -0
- data/lib/anthropic/models/beta/skill_delete_response.rb +34 -0
- data/lib/anthropic/models/beta/skill_list_params.rb +61 -0
- data/lib/anthropic/models/beta/skill_list_response.rb +84 -0
- data/lib/anthropic/models/beta/skill_retrieve_params.rb +24 -0
- data/lib/anthropic/models/beta/skill_retrieve_response.rb +84 -0
- data/lib/anthropic/models/beta/skills/version_create_params.rb +42 -0
- data/lib/anthropic/models/beta/skills/version_create_response.rb +92 -0
- data/lib/anthropic/models/beta/skills/version_delete_params.rb +39 -0
- data/lib/anthropic/models/beta/skills/version_delete_response.rb +36 -0
- data/lib/anthropic/models/beta/skills/version_list_params.rb +47 -0
- data/lib/anthropic/models/beta/skills/version_list_response.rb +92 -0
- data/lib/anthropic/models/beta/skills/version_retrieve_params.rb +39 -0
- data/lib/anthropic/models/beta/skills/version_retrieve_response.rb +92 -0
- data/lib/anthropic/models/completion_create_params.rb +3 -4
- data/lib/anthropic/models/message_count_tokens_params.rb +10 -10
- data/lib/anthropic/models/message_create_params.rb +13 -13
- data/lib/anthropic/models/messages/batch_create_params.rb +14 -15
- data/lib/anthropic/models/stop_reason.rb +0 -1
- data/lib/anthropic/models/thinking_config_enabled.rb +1 -1
- data/lib/anthropic/models/thinking_config_param.rb +1 -1
- data/lib/anthropic/resources/beta/messages.rb +5 -5
- data/lib/anthropic/resources/beta/skills/versions.rb +154 -0
- data/lib/anthropic/resources/beta/skills.rb +144 -0
- data/lib/anthropic/resources/beta.rb +4 -0
- data/lib/anthropic/resources/completions.rb +4 -4
- data/lib/anthropic/version.rb +1 -1
- data/lib/anthropic.rb +23 -0
- data/rbi/anthropic/internal/page_cursor.rbi +25 -0
- data/rbi/anthropic/internal/token_page.rbi +25 -0
- data/rbi/anthropic/models/anthropic_beta.rbi +2 -0
- data/rbi/anthropic/models/beta/beta_clear_tool_uses_20250919_edit_response.rbi +0 -1
- data/rbi/anthropic/models/beta/beta_container.rbi +23 -3
- data/rbi/anthropic/models/beta/beta_container_params.rbi +54 -0
- data/rbi/anthropic/models/beta/beta_context_management_config.rbi +0 -1
- data/rbi/anthropic/models/beta/beta_context_management_response.rbi +0 -1
- data/rbi/anthropic/models/beta/beta_message.rbi +6 -2
- data/rbi/anthropic/models/beta/beta_raw_message_delta_event.rbi +2 -2
- data/rbi/anthropic/models/beta/beta_skill.rbi +80 -0
- data/rbi/anthropic/models/beta/beta_skill_params.rbi +91 -0
- data/rbi/anthropic/models/beta/beta_thinking_config_enabled.rbi +2 -2
- data/rbi/anthropic/models/beta/beta_thinking_config_param.rbi +1 -1
- data/rbi/anthropic/models/beta/message_count_tokens_params.rbi +27 -21
- data/rbi/anthropic/models/beta/message_create_params.rbi +61 -29
- data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +70 -33
- data/rbi/anthropic/models/beta/skill_create_params.rbi +90 -0
- data/rbi/anthropic/models/beta/skill_create_response.rbi +118 -0
- data/rbi/anthropic/models/beta/skill_delete_params.rbi +62 -0
- data/rbi/anthropic/models/beta/skill_delete_response.rbi +46 -0
- data/rbi/anthropic/models/beta/skill_list_params.rbi +109 -0
- data/rbi/anthropic/models/beta/skill_list_response.rbi +118 -0
- data/rbi/anthropic/models/beta/skill_retrieve_params.rbi +62 -0
- data/rbi/anthropic/models/beta/skill_retrieve_response.rbi +118 -0
- data/rbi/anthropic/models/beta/skills/version_create_params.rbi +79 -0
- data/rbi/anthropic/models/beta/skills/version_create_response.rbi +124 -0
- data/rbi/anthropic/models/beta/skills/version_delete_params.rbi +77 -0
- data/rbi/anthropic/models/beta/skills/version_delete_response.rbi +48 -0
- data/rbi/anthropic/models/beta/skills/version_list_params.rbi +85 -0
- data/rbi/anthropic/models/beta/skills/version_list_response.rbi +124 -0
- data/rbi/anthropic/models/beta/skills/version_retrieve_params.rbi +77 -0
- data/rbi/anthropic/models/beta/skills/version_retrieve_response.rbi +124 -0
- data/rbi/anthropic/models/completion_create_params.rbi +6 -8
- data/rbi/anthropic/models/message_count_tokens_params.rbi +19 -19
- data/rbi/anthropic/models/message_create_params.rbi +24 -24
- data/rbi/anthropic/models/messages/batch_create_params.rbi +26 -28
- data/rbi/anthropic/models/stop_reason.rbi +0 -5
- data/rbi/anthropic/models/thinking_config_enabled.rbi +2 -2
- data/rbi/anthropic/models/thinking_config_param.rbi +1 -1
- data/rbi/anthropic/resources/beta/messages.rbi +51 -36
- data/rbi/anthropic/resources/beta/skills/versions.rbi +124 -0
- data/rbi/anthropic/resources/beta/skills.rbi +118 -0
- data/rbi/anthropic/resources/beta.rbi +3 -0
- data/rbi/anthropic/resources/completions.rbi +10 -12
- data/rbi/anthropic/resources/messages.rbi +31 -31
- data/sig/anthropic/internal/page_cursor.rbs +15 -0
- data/sig/anthropic/internal/token_page.rbs +15 -0
- data/sig/anthropic/models/anthropic_beta.rbs +2 -0
- data/sig/anthropic/models/beta/beta_container.rbs +18 -3
- data/sig/anthropic/models/beta/beta_container_params.rbs +26 -0
- data/sig/anthropic/models/beta/beta_skill.rbs +45 -0
- data/sig/anthropic/models/beta/beta_skill_params.rbs +47 -0
- data/sig/anthropic/models/beta/message_create_params.rbs +12 -4
- data/sig/anthropic/models/beta/messages/batch_create_params.rbs +12 -4
- data/sig/anthropic/models/beta/skill_create_params.rbs +42 -0
- data/sig/anthropic/models/beta/skill_create_response.rbs +52 -0
- data/sig/anthropic/models/beta/skill_delete_params.rbs +30 -0
- data/sig/anthropic/models/beta/skill_delete_response.rbs +17 -0
- data/sig/anthropic/models/beta/skill_list_params.rbs +49 -0
- data/sig/anthropic/models/beta/skill_list_response.rbs +52 -0
- data/sig/anthropic/models/beta/skill_retrieve_params.rbs +30 -0
- data/sig/anthropic/models/beta/skill_retrieve_response.rbs +52 -0
- data/sig/anthropic/models/beta/skills/version_create_params.rbs +39 -0
- data/sig/anthropic/models/beta/skills/version_create_response.rbs +59 -0
- data/sig/anthropic/models/beta/skills/version_delete_params.rbs +39 -0
- data/sig/anthropic/models/beta/skills/version_delete_response.rbs +19 -0
- data/sig/anthropic/models/beta/skills/version_list_params.rbs +44 -0
- data/sig/anthropic/models/beta/skills/version_list_response.rbs +59 -0
- data/sig/anthropic/models/beta/skills/version_retrieve_params.rbs +39 -0
- data/sig/anthropic/models/beta/skills/version_retrieve_response.rbs +59 -0
- data/sig/anthropic/models/stop_reason.rbs +0 -2
- data/sig/anthropic/resources/beta/messages.rbs +2 -2
- data/sig/anthropic/resources/beta/skills/versions.rbs +40 -0
- data/sig/anthropic/resources/beta/skills.rbs +38 -0
- data/sig/anthropic/resources/beta.rbs +2 -0
- metadata +71 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 072bcc8438ad6e02e9f80e615c1945fc13d97c49ba16d41338bfaf864e667ea0
|
4
|
+
data.tar.gz: ade33da13ed3771ed37e71159e48b46524099ac289c0015018ac49aae05f3ad2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9cd69a70298a17a881e76419ad4f19348cd09e3c0eb30564635e1944839e4cc95d6aaae0c4614bea8e171c39c24302b10d3470362159b4364422c343eb91ba77
|
7
|
+
data.tar.gz: 4fd63f93dd2cbcf68a158c90848b0cc1ed2e55e30ea92e18a48a1c45649095a9dd4cf9686e76573e0592ffa1bf74a00362c0ad2a0146b63b0d31f7943c17815e
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 1.12.0 (2025-10-16)
|
4
|
+
|
5
|
+
Full Changelog: [v1.11.0...v1.12.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v1.11.0...v1.12.0)
|
6
|
+
|
7
|
+
### Features
|
8
|
+
|
9
|
+
* **api:** adding support for agent skills ([0e6b431](https://github.com/anthropics/anthropic-sdk-ruby/commit/0e6b431be2767a9674f80e3764955d8a5531cfec))
|
10
|
+
|
3
11
|
## 1.11.0 (2025-10-15)
|
4
12
|
|
5
13
|
Full Changelog: [v1.10.1...v1.11.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v1.10.1...v1.11.0)
|
data/README.md
CHANGED
@@ -0,0 +1,92 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Internal
|
5
|
+
# @generic Elem
|
6
|
+
#
|
7
|
+
# @example
|
8
|
+
# if page_cursor.has_next?
|
9
|
+
# page_cursor = page_cursor.next_page
|
10
|
+
# end
|
11
|
+
#
|
12
|
+
# @example
|
13
|
+
# page_cursor.auto_paging_each do |skill|
|
14
|
+
# puts(skill)
|
15
|
+
# end
|
16
|
+
class PageCursor
|
17
|
+
include Anthropic::Internal::Type::BasePage
|
18
|
+
|
19
|
+
# @return [Array<generic<Elem>>, nil]
|
20
|
+
attr_accessor :data
|
21
|
+
|
22
|
+
# @return [Boolean]
|
23
|
+
attr_accessor :has_more
|
24
|
+
|
25
|
+
# @return [String, nil]
|
26
|
+
attr_accessor :next_page_
|
27
|
+
|
28
|
+
# @return [Boolean]
|
29
|
+
def next_page?
|
30
|
+
has_more
|
31
|
+
end
|
32
|
+
|
33
|
+
# @raise [Anthropic::HTTP::Error]
|
34
|
+
# @return [self]
|
35
|
+
def next_page
|
36
|
+
unless next_page?
|
37
|
+
message = "No more pages available. Please check #next_page? before calling ##{__method__}"
|
38
|
+
raise RuntimeError.new(message)
|
39
|
+
end
|
40
|
+
|
41
|
+
req = Anthropic::Internal::Util.deep_merge(@req, {query: {page: next_page_}})
|
42
|
+
@client.request(req)
|
43
|
+
end
|
44
|
+
|
45
|
+
# @param blk [Proc]
|
46
|
+
#
|
47
|
+
# @yieldparam [generic<Elem>]
|
48
|
+
def auto_paging_each(&blk)
|
49
|
+
unless block_given?
|
50
|
+
raise ArgumentError.new("A block must be given to ##{__method__}")
|
51
|
+
end
|
52
|
+
|
53
|
+
page = self
|
54
|
+
loop do
|
55
|
+
page.data&.each(&blk)
|
56
|
+
|
57
|
+
break unless page.next_page?
|
58
|
+
page = page.next_page
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
# @api private
|
63
|
+
#
|
64
|
+
# @param client [Anthropic::Internal::Transport::BaseClient]
|
65
|
+
# @param req [Hash{Symbol=>Object}]
|
66
|
+
# @param headers [Hash{String=>String}]
|
67
|
+
# @param page_data [Hash{Symbol=>Object}]
|
68
|
+
def initialize(client:, req:, headers:, page_data:)
|
69
|
+
super
|
70
|
+
|
71
|
+
case page_data
|
72
|
+
in {data: Array => data}
|
73
|
+
@data = data.map { Anthropic::Internal::Type::Converter.coerce(@model, _1) }
|
74
|
+
else
|
75
|
+
end
|
76
|
+
@has_more = page_data[:has_more]
|
77
|
+
@next_page_ = page_data[:next_page]
|
78
|
+
end
|
79
|
+
|
80
|
+
# @api private
|
81
|
+
#
|
82
|
+
# @return [String]
|
83
|
+
def inspect
|
84
|
+
# rubocop:disable Layout/LineLength
|
85
|
+
model = Anthropic::Internal::Type::Converter.inspect(@model, depth: 1)
|
86
|
+
|
87
|
+
"#<#{self.class}[#{model}]:0x#{object_id.to_s(16)} has_more=#{has_more.inspect} next_page_=#{next_page_.inspect}>"
|
88
|
+
# rubocop:enable Layout/LineLength
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Internal
|
5
|
+
# @generic Elem
|
6
|
+
#
|
7
|
+
# @example
|
8
|
+
# if token_page.has_next?
|
9
|
+
# token_page = token_page.next_page
|
10
|
+
# end
|
11
|
+
#
|
12
|
+
# @example
|
13
|
+
# token_page.auto_paging_each do |item|
|
14
|
+
# puts(item)
|
15
|
+
# end
|
16
|
+
class TokenPage
|
17
|
+
include Anthropic::Internal::Type::BasePage
|
18
|
+
|
19
|
+
# @return [Array<generic<Elem>>, nil]
|
20
|
+
attr_accessor :data
|
21
|
+
|
22
|
+
# @return [Boolean]
|
23
|
+
attr_accessor :has_more
|
24
|
+
|
25
|
+
# @return [String, nil]
|
26
|
+
attr_accessor :next_page_
|
27
|
+
|
28
|
+
# @return [Boolean]
|
29
|
+
def next_page?
|
30
|
+
has_more
|
31
|
+
end
|
32
|
+
|
33
|
+
# @raise [Anthropic::HTTP::Error]
|
34
|
+
# @return [self]
|
35
|
+
def next_page
|
36
|
+
unless next_page?
|
37
|
+
message = "No more pages available. Please check #next_page? before calling ##{__method__}"
|
38
|
+
raise RuntimeError.new(message)
|
39
|
+
end
|
40
|
+
|
41
|
+
req = Anthropic::Internal::Util.deep_merge(@req, {query: {page_token: next_page_}})
|
42
|
+
@client.request(req)
|
43
|
+
end
|
44
|
+
|
45
|
+
# @param blk [Proc]
|
46
|
+
#
|
47
|
+
# @yieldparam [generic<Elem>]
|
48
|
+
def auto_paging_each(&blk)
|
49
|
+
unless block_given?
|
50
|
+
raise ArgumentError.new("A block must be given to ##{__method__}")
|
51
|
+
end
|
52
|
+
|
53
|
+
page = self
|
54
|
+
loop do
|
55
|
+
page.data&.each(&blk)
|
56
|
+
|
57
|
+
break unless page.next_page?
|
58
|
+
page = page.next_page
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
# @api private
|
63
|
+
#
|
64
|
+
# @param client [Anthropic::Internal::Transport::BaseClient]
|
65
|
+
# @param req [Hash{Symbol=>Object}]
|
66
|
+
# @param headers [Hash{String=>String}]
|
67
|
+
# @param page_data [Hash{Symbol=>Object}]
|
68
|
+
def initialize(client:, req:, headers:, page_data:)
|
69
|
+
super
|
70
|
+
|
71
|
+
case page_data
|
72
|
+
in {data: Array => data}
|
73
|
+
@data = data.map { Anthropic::Internal::Type::Converter.coerce(@model, _1) }
|
74
|
+
else
|
75
|
+
end
|
76
|
+
@has_more = page_data[:has_more]
|
77
|
+
@next_page_ = page_data[:next_page]
|
78
|
+
end
|
79
|
+
|
80
|
+
# @api private
|
81
|
+
#
|
82
|
+
# @return [String]
|
83
|
+
def inspect
|
84
|
+
# rubocop:disable Layout/LineLength
|
85
|
+
model = Anthropic::Internal::Type::Converter.inspect(@model, depth: 1)
|
86
|
+
|
87
|
+
"#<#{self.class}[#{model}]:0x#{object_id.to_s(16)} has_more=#{has_more.inspect} next_page_=#{next_page_.inspect}>"
|
88
|
+
# rubocop:enable Layout/LineLength
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
@@ -41,6 +41,8 @@ module Anthropic
|
|
41
41
|
|
42
42
|
variant const: -> { Anthropic::Models::AnthropicBeta::MODEL_CONTEXT_WINDOW_EXCEEDED_2025_08_26 }
|
43
43
|
|
44
|
+
variant const: -> { Anthropic::Models::AnthropicBeta::SKILLS_2025_10_02 }
|
45
|
+
|
44
46
|
# @!method self.variants
|
45
47
|
# @return [Array(String, Symbol)]
|
46
48
|
|
@@ -67,6 +69,7 @@ module Anthropic
|
|
67
69
|
CONTEXT_1M_2025_08_07 = :"context-1m-2025-08-07"
|
68
70
|
CONTEXT_MANAGEMENT_2025_06_27 = :"context-management-2025-06-27"
|
69
71
|
MODEL_CONTEXT_WINDOW_EXCEEDED_2025_08_26 = :"model-context-window-exceeded-2025-08-26"
|
72
|
+
SKILLS_2025_10_02 = :"skills-2025-10-02"
|
70
73
|
|
71
74
|
# @!endgroup
|
72
75
|
end
|
@@ -23,8 +23,6 @@ module Anthropic
|
|
23
23
|
required :type, const: :clear_tool_uses_20250919
|
24
24
|
|
25
25
|
# @!method initialize(cleared_input_tokens:, cleared_tool_uses:, type: :clear_tool_uses_20250919)
|
26
|
-
# Results for clear_tool_uses_20250919 edit.
|
27
|
-
#
|
28
26
|
# @param cleared_input_tokens [Integer] Number of input tokens cleared by this edit.
|
29
27
|
#
|
30
28
|
# @param cleared_tool_uses [Integer] Number of tool uses that were cleared.
|
@@ -16,13 +16,21 @@ module Anthropic
|
|
16
16
|
# @return [Time]
|
17
17
|
required :expires_at, Time
|
18
18
|
|
19
|
-
# @!
|
19
|
+
# @!attribute skills
|
20
|
+
# Skills loaded in the container
|
21
|
+
#
|
22
|
+
# @return [Array<Anthropic::Models::Beta::BetaSkill>, nil]
|
23
|
+
required :skills, -> { Anthropic::Internal::Type::ArrayOf[Anthropic::Beta::BetaSkill] }, nil?: true
|
24
|
+
|
25
|
+
# @!method initialize(id:, expires_at:, skills:)
|
20
26
|
# Information about the container used in the request (for the code execution
|
21
27
|
# tool)
|
22
28
|
#
|
23
29
|
# @param id [String] Identifier for the container used in this request
|
24
30
|
#
|
25
31
|
# @param expires_at [Time] The time at which the container will expire.
|
32
|
+
#
|
33
|
+
# @param skills [Array<Anthropic::Models::Beta::BetaSkill>, nil] Skills loaded in the container
|
26
34
|
end
|
27
35
|
end
|
28
36
|
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
class BetaContainerParams < Anthropic::Internal::Type::BaseModel
|
7
|
+
# @!attribute id
|
8
|
+
# Container id
|
9
|
+
#
|
10
|
+
# @return [String, nil]
|
11
|
+
optional :id, String, nil?: true
|
12
|
+
|
13
|
+
# @!attribute skills
|
14
|
+
# List of skills to load in the container
|
15
|
+
#
|
16
|
+
# @return [Array<Anthropic::Models::Beta::BetaSkillParams>, nil]
|
17
|
+
optional :skills,
|
18
|
+
-> {
|
19
|
+
Anthropic::Internal::Type::ArrayOf[Anthropic::Beta::BetaSkillParams]
|
20
|
+
},
|
21
|
+
nil?: true
|
22
|
+
|
23
|
+
# @!method initialize(id: nil, skills: nil)
|
24
|
+
# Container parameters with skills to be loaded.
|
25
|
+
#
|
26
|
+
# @param id [String, nil] Container id
|
27
|
+
#
|
28
|
+
# @param skills [Array<Anthropic::Models::Beta::BetaSkillParams>, nil] List of skills to load in the container
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
BetaContainerParams = Beta::BetaContainerParams
|
33
|
+
end
|
34
|
+
end
|
@@ -11,8 +11,6 @@ module Anthropic
|
|
11
11
|
optional :edits, -> { Anthropic::Internal::Type::ArrayOf[Anthropic::Beta::BetaClearToolUses20250919Edit] }
|
12
12
|
|
13
13
|
# @!method initialize(edits: nil)
|
14
|
-
# Configuration for context management operations.
|
15
|
-
#
|
16
14
|
# @param edits [Array<Anthropic::Models::Beta::BetaClearToolUses20250919Edit>] List of context management edits to apply
|
17
15
|
end
|
18
16
|
end
|
@@ -12,8 +12,6 @@ module Anthropic
|
|
12
12
|
-> { Anthropic::Internal::Type::ArrayOf[Anthropic::Beta::BetaClearToolUses20250919EditResponse] }
|
13
13
|
|
14
14
|
# @!method initialize(applied_edits:)
|
15
|
-
# Information about context management operations applied during the request.
|
16
|
-
#
|
17
15
|
# @param applied_edits [Array<Anthropic::Models::Beta::BetaClearToolUses20250919EditResponse>] List of context management edits that were applied.
|
18
16
|
end
|
19
17
|
end
|
@@ -60,7 +60,9 @@ module Anthropic
|
|
60
60
|
required :content, -> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::Beta::BetaContentBlock] }
|
61
61
|
|
62
62
|
# @!attribute context_management
|
63
|
-
#
|
63
|
+
# Context management response.
|
64
|
+
#
|
65
|
+
# Information about context management strategies applied during the request.
|
64
66
|
#
|
65
67
|
# @return [Anthropic::Models::Beta::BetaContextManagementResponse, nil]
|
66
68
|
required :context_management, -> { Anthropic::Beta::BetaContextManagementResponse }, nil?: true
|
@@ -148,7 +150,7 @@ module Anthropic
|
|
148
150
|
#
|
149
151
|
# @param content [Array<Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaWebFetchToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock>] Content generated by the model.
|
150
152
|
#
|
151
|
-
# @param context_management [Anthropic::Models::Beta::BetaContextManagementResponse, nil]
|
153
|
+
# @param context_management [Anthropic::Models::Beta::BetaContextManagementResponse, nil] Context management response.
|
152
154
|
#
|
153
155
|
# @param model [Symbol, String, Anthropic::Models::Model] The model that will complete your prompt.\n\nSee [models](https://docs.anthropic
|
154
156
|
#
|
@@ -5,7 +5,7 @@ module Anthropic
|
|
5
5
|
module Beta
|
6
6
|
class BetaRawMessageDeltaEvent < Anthropic::Internal::Type::BaseModel
|
7
7
|
# @!attribute context_management
|
8
|
-
# Information about context management
|
8
|
+
# Information about context management strategies applied during the request
|
9
9
|
#
|
10
10
|
# @return [Anthropic::Models::Beta::BetaContextManagementResponse, nil]
|
11
11
|
required :context_management, -> { Anthropic::Beta::BetaContextManagementResponse }, nil?: true
|
@@ -44,7 +44,7 @@ module Anthropic
|
|
44
44
|
# Some parameter documentations has been truncated, see
|
45
45
|
# {Anthropic::Models::Beta::BetaRawMessageDeltaEvent} for more details.
|
46
46
|
#
|
47
|
-
# @param context_management [Anthropic::Models::Beta::BetaContextManagementResponse, nil] Information about context management
|
47
|
+
# @param context_management [Anthropic::Models::Beta::BetaContextManagementResponse, nil] Information about context management strategies applied during the request
|
48
48
|
#
|
49
49
|
# @param delta [Anthropic::Models::Beta::BetaRawMessageDeltaEvent::Delta]
|
50
50
|
#
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
class BetaSkill < Anthropic::Internal::Type::BaseModel
|
7
|
+
# @!attribute skill_id
|
8
|
+
# Skill ID
|
9
|
+
#
|
10
|
+
# @return [String]
|
11
|
+
required :skill_id, String
|
12
|
+
|
13
|
+
# @!attribute type
|
14
|
+
# Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
|
15
|
+
#
|
16
|
+
# @return [Symbol, Anthropic::Models::Beta::BetaSkill::Type]
|
17
|
+
required :type, enum: -> { Anthropic::Beta::BetaSkill::Type }
|
18
|
+
|
19
|
+
# @!attribute version
|
20
|
+
# Skill version or 'latest' for most recent version
|
21
|
+
#
|
22
|
+
# @return [String]
|
23
|
+
required :version, String
|
24
|
+
|
25
|
+
# @!method initialize(skill_id:, type:, version:)
|
26
|
+
# A skill that was loaded in a container (response model).
|
27
|
+
#
|
28
|
+
# @param skill_id [String] Skill ID
|
29
|
+
#
|
30
|
+
# @param type [Symbol, Anthropic::Models::Beta::BetaSkill::Type] Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
|
31
|
+
#
|
32
|
+
# @param version [String] Skill version or 'latest' for most recent version
|
33
|
+
|
34
|
+
# Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
|
35
|
+
#
|
36
|
+
# @see Anthropic::Models::Beta::BetaSkill#type
|
37
|
+
module Type
|
38
|
+
extend Anthropic::Internal::Type::Enum
|
39
|
+
|
40
|
+
ANTHROPIC = :anthropic
|
41
|
+
CUSTOM = :custom
|
42
|
+
|
43
|
+
# @!method self.values
|
44
|
+
# @return [Array<Symbol>]
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
BetaSkill = Beta::BetaSkill
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Anthropic
|
4
|
+
module Models
|
5
|
+
module Beta
|
6
|
+
class BetaSkillParams < Anthropic::Internal::Type::BaseModel
|
7
|
+
# @!attribute skill_id
|
8
|
+
# Skill ID
|
9
|
+
#
|
10
|
+
# @return [String]
|
11
|
+
required :skill_id, String
|
12
|
+
|
13
|
+
# @!attribute type
|
14
|
+
# Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
|
15
|
+
#
|
16
|
+
# @return [Symbol, Anthropic::Models::Beta::BetaSkillParams::Type]
|
17
|
+
required :type, enum: -> { Anthropic::Beta::BetaSkillParams::Type }
|
18
|
+
|
19
|
+
# @!attribute version
|
20
|
+
# Skill version or 'latest' for most recent version
|
21
|
+
#
|
22
|
+
# @return [String, nil]
|
23
|
+
optional :version, String
|
24
|
+
|
25
|
+
# @!method initialize(skill_id:, type:, version: nil)
|
26
|
+
# Specification for a skill to be loaded in a container (request model).
|
27
|
+
#
|
28
|
+
# @param skill_id [String] Skill ID
|
29
|
+
#
|
30
|
+
# @param type [Symbol, Anthropic::Models::Beta::BetaSkillParams::Type] Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
|
31
|
+
#
|
32
|
+
# @param version [String] Skill version or 'latest' for most recent version
|
33
|
+
|
34
|
+
# Type of skill - either 'anthropic' (built-in) or 'custom' (user-defined)
|
35
|
+
#
|
36
|
+
# @see Anthropic::Models::Beta::BetaSkillParams#type
|
37
|
+
module Type
|
38
|
+
extend Anthropic::Internal::Type::Enum
|
39
|
+
|
40
|
+
ANTHROPIC = :anthropic
|
41
|
+
CUSTOM = :custom
|
42
|
+
|
43
|
+
# @!method self.values
|
44
|
+
# @return [Array<Symbol>]
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
BetaSkillParams = Beta::BetaSkillParams
|
50
|
+
end
|
51
|
+
end
|
@@ -12,7 +12,7 @@ module Anthropic
|
|
12
12
|
# Must be ≥1024 and less than `max_tokens`.
|
13
13
|
#
|
14
14
|
# See
|
15
|
-
# [extended thinking](https://docs.
|
15
|
+
# [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
|
16
16
|
# for details.
|
17
17
|
#
|
18
18
|
# @return [Integer]
|
@@ -10,7 +10,7 @@ module Anthropic
|
|
10
10
|
# tokens and counts towards your `max_tokens` limit.
|
11
11
|
#
|
12
12
|
# See
|
13
|
-
# [extended thinking](https://docs.
|
13
|
+
# [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
|
14
14
|
# for details.
|
15
15
|
module BetaThinkingConfigParam
|
16
16
|
extend Anthropic::Internal::Type::Union
|
@@ -66,12 +66,12 @@ module Anthropic
|
|
66
66
|
# { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
|
67
67
|
# ```
|
68
68
|
#
|
69
|
-
# See [input examples](https://docs.
|
69
|
+
# See [input examples](https://docs.claude.com/en/api/messages-examples).
|
70
70
|
#
|
71
71
|
# Note that if you want to include a
|
72
|
-
# [system prompt](https://docs.
|
73
|
-
#
|
74
|
-
#
|
72
|
+
# [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the
|
73
|
+
# top-level `system` parameter — there is no `"system"` role for input messages in
|
74
|
+
# the Messages API.
|
75
75
|
#
|
76
76
|
# There is a limit of 100,000 messages in a single request.
|
77
77
|
#
|
@@ -87,7 +87,10 @@ module Anthropic
|
|
87
87
|
required :model, union: -> { Anthropic::Model }
|
88
88
|
|
89
89
|
# @!attribute context_management
|
90
|
-
#
|
90
|
+
# Context management configuration.
|
91
|
+
#
|
92
|
+
# This allows you to control how Claude manages context across multiple requests,
|
93
|
+
# such as whether to clear function results or not.
|
91
94
|
#
|
92
95
|
# @return [Anthropic::Models::Beta::BetaContextManagementConfig, nil]
|
93
96
|
optional :context_management, -> { Anthropic::Beta::BetaContextManagementConfig }, nil?: true
|
@@ -104,7 +107,7 @@ module Anthropic
|
|
104
107
|
#
|
105
108
|
# A system prompt is a way of providing context and instructions to Claude, such
|
106
109
|
# as specifying a particular goal or role. See our
|
107
|
-
# [guide to system prompts](https://docs.
|
110
|
+
# [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
|
108
111
|
#
|
109
112
|
# @return [String, Array<Anthropic::Models::Beta::BetaTextBlockParam>, nil]
|
110
113
|
optional :system_, union: -> { Anthropic::Beta::MessageCountTokensParams::System }, api_name: :system
|
@@ -117,7 +120,7 @@ module Anthropic
|
|
117
120
|
# tokens and counts towards your `max_tokens` limit.
|
118
121
|
#
|
119
122
|
# See
|
120
|
-
# [extended thinking](https://docs.
|
123
|
+
# [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
|
121
124
|
# for details.
|
122
125
|
#
|
123
126
|
# @return [Anthropic::Models::Beta::BetaThinkingConfigEnabled, Anthropic::Models::Beta::BetaThinkingConfigDisabled, nil]
|
@@ -140,9 +143,9 @@ module Anthropic
|
|
140
143
|
#
|
141
144
|
# There are two types of tools: **client tools** and **server tools**. The
|
142
145
|
# behavior described below applies to client tools. For
|
143
|
-
# [server tools](https://docs.
|
146
|
+
# [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
|
144
147
|
# see their individual documentation as each has its own behavior (e.g., the
|
145
|
-
# [web search tool](https://docs.
|
148
|
+
# [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
|
146
149
|
#
|
147
150
|
# Each tool definition includes:
|
148
151
|
#
|
@@ -205,7 +208,7 @@ module Anthropic
|
|
205
208
|
# functions, or more generally whenever you want the model to produce a particular
|
206
209
|
# JSON structure of output.
|
207
210
|
#
|
208
|
-
# See our [guide](https://docs.
|
211
|
+
# See our [guide](https://docs.claude.com/en/docs/tool-use) for more details.
|
209
212
|
#
|
210
213
|
# @return [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, Anthropic::Models::Beta::BetaCodeExecutionTool20250825, Anthropic::Models::Beta::BetaToolComputerUse20241022, Anthropic::Models::Beta::BetaMemoryTool20250818, Anthropic::Models::Beta::BetaToolComputerUse20250124, Anthropic::Models::Beta::BetaToolTextEditor20241022, Anthropic::Models::Beta::BetaToolTextEditor20250124, Anthropic::Models::Beta::BetaToolTextEditor20250429, Anthropic::Models::Beta::BetaToolTextEditor20250728, Anthropic::Models::Beta::BetaWebSearchTool20250305, Anthropic::Models::Beta::BetaWebFetchTool20250910>, nil]
|
211
214
|
optional :tools,
|
@@ -225,7 +228,7 @@ module Anthropic
|
|
225
228
|
#
|
226
229
|
# @param model [Symbol, String, Anthropic::Models::Model] The model that will complete your prompt.\n\nSee [models](https://docs.anthropic
|
227
230
|
#
|
228
|
-
# @param context_management [Anthropic::Models::Beta::BetaContextManagementConfig, nil]
|
231
|
+
# @param context_management [Anthropic::Models::Beta::BetaContextManagementConfig, nil] Context management configuration.
|
229
232
|
#
|
230
233
|
# @param mcp_servers [Array<Anthropic::Models::Beta::BetaRequestMCPServerURLDefinition>] MCP servers to be utilized in this request
|
231
234
|
#
|
@@ -245,7 +248,7 @@ module Anthropic
|
|
245
248
|
#
|
246
249
|
# A system prompt is a way of providing context and instructions to Claude, such
|
247
250
|
# as specifying a particular goal or role. See our
|
248
|
-
# [guide to system prompts](https://docs.
|
251
|
+
# [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
|
249
252
|
module System
|
250
253
|
extend Anthropic::Internal::Type::Union
|
251
254
|
|