anthropic 1.8.0 → 1.10.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 +42 -0
- data/README.md +12 -12
- data/lib/anthropic/errors.rb +25 -11
- data/lib/anthropic/internal/page.rb +1 -1
- data/lib/anthropic/internal/stream.rb +1 -0
- data/lib/anthropic/internal/transport/base_client.rb +11 -7
- data/lib/anthropic/internal/type/base_page.rb +1 -1
- data/lib/anthropic/internal/type/base_stream.rb +9 -1
- data/lib/anthropic/internal/util.rb +3 -2
- data/lib/anthropic/models/beta/beta_citation_config.rb +19 -0
- data/lib/anthropic/models/beta/beta_clear_tool_uses_20250919_edit.rb +98 -0
- data/lib/anthropic/models/beta/beta_clear_tool_uses_20250919_edit_response.rb +38 -0
- data/lib/anthropic/models/beta/beta_content_block.rb +3 -1
- data/lib/anthropic/models/beta/beta_content_block_param.rb +3 -1
- data/lib/anthropic/models/beta/beta_context_management_config.rb +22 -0
- data/lib/anthropic/models/beta/beta_context_management_response.rb +23 -0
- data/lib/anthropic/models/beta/beta_count_tokens_context_management_response.rb +20 -0
- data/lib/anthropic/models/beta/beta_document_block.rb +56 -0
- data/lib/anthropic/models/beta/beta_input_tokens_clear_at_least.rb +25 -0
- data/lib/anthropic/models/beta/beta_input_tokens_trigger.rb +25 -0
- data/lib/anthropic/models/beta/beta_memory_tool_20250818.rb +40 -0
- data/lib/anthropic/models/beta/beta_memory_tool_20250818_command.rb +30 -0
- data/lib/anthropic/models/beta/beta_memory_tool_20250818_create_command.rb +36 -0
- data/lib/anthropic/models/beta/beta_memory_tool_20250818_delete_command.rb +28 -0
- data/lib/anthropic/models/beta/beta_memory_tool_20250818_insert_command.rb +44 -0
- data/lib/anthropic/models/beta/beta_memory_tool_20250818_rename_command.rb +36 -0
- data/lib/anthropic/models/beta/beta_memory_tool_20250818_str_replace_command.rb +44 -0
- data/lib/anthropic/models/beta/beta_memory_tool_20250818_view_command.rb +36 -0
- data/lib/anthropic/models/beta/beta_message.rb +11 -3
- data/lib/anthropic/models/beta/beta_message_param.rb +3 -3
- data/lib/anthropic/models/beta/beta_message_tokens_count.rb +13 -1
- data/lib/anthropic/models/beta/beta_raw_content_block_start_event.rb +5 -3
- data/lib/anthropic/models/beta/beta_raw_message_delta_event.rb +9 -1
- data/lib/anthropic/models/beta/beta_request_document_block.rb +2 -2
- data/lib/anthropic/models/beta/beta_server_tool_usage.rb +9 -1
- data/lib/anthropic/models/beta/beta_server_tool_use_block.rb +1 -0
- data/lib/anthropic/models/beta/beta_server_tool_use_block_param.rb +1 -0
- data/lib/anthropic/models/beta/beta_stop_reason.rb +1 -0
- data/lib/anthropic/models/beta/beta_tool_result_block_param.rb +6 -4
- data/lib/anthropic/models/beta/beta_tool_union.rb +5 -1
- data/lib/anthropic/models/beta/beta_tool_uses_keep.rb +25 -0
- data/lib/anthropic/models/beta/beta_tool_uses_trigger.rb +25 -0
- data/lib/anthropic/models/beta/beta_web_fetch_block.rb +42 -0
- data/lib/anthropic/models/beta/beta_web_fetch_block_param.rb +42 -0
- data/lib/anthropic/models/beta/beta_web_fetch_tool_20250910.rb +82 -0
- data/lib/anthropic/models/beta/beta_web_fetch_tool_result_block.rb +43 -0
- data/lib/anthropic/models/beta/beta_web_fetch_tool_result_block_param.rb +53 -0
- data/lib/anthropic/models/beta/beta_web_fetch_tool_result_error_block.rb +25 -0
- data/lib/anthropic/models/beta/beta_web_fetch_tool_result_error_block_param.rb +25 -0
- data/lib/anthropic/models/beta/beta_web_fetch_tool_result_error_code.rb +25 -0
- data/lib/anthropic/models/beta/message_count_tokens_params.rb +16 -4
- data/lib/anthropic/models/beta/message_create_params.rb +11 -3
- data/lib/anthropic/models/beta/messages/batch_create_params.rb +11 -3
- data/lib/anthropic/models/document_block_param.rb +2 -2
- data/lib/anthropic/models/model.rb +10 -0
- data/lib/anthropic/models/stop_reason.rb +1 -0
- data/lib/anthropic/models/tool_result_block_param.rb +6 -4
- data/lib/anthropic/resources/beta/messages.rb +12 -6
- data/lib/anthropic/version.rb +1 -1
- data/lib/anthropic.rb +27 -0
- data/rbi/anthropic/errors.rbi +29 -2
- data/rbi/anthropic/internal/transport/base_client.rbi +4 -5
- data/rbi/anthropic/internal/type/base_page.rbi +1 -1
- data/rbi/anthropic/internal/type/base_stream.rbi +16 -1
- data/rbi/anthropic/internal/util.rbi +1 -1
- data/rbi/anthropic/models/beta/beta_citation_config.rbi +30 -0
- data/rbi/anthropic/models/beta/beta_clear_tool_uses_20250919_edit.rbi +183 -0
- data/rbi/anthropic/models/beta/beta_clear_tool_uses_20250919_edit_response.rbi +62 -0
- data/rbi/anthropic/models/beta/beta_content_block.rbi +1 -0
- data/rbi/anthropic/models/beta/beta_content_block_param.rbi +1 -0
- data/rbi/anthropic/models/beta/beta_context_management_config.rbi +56 -0
- data/rbi/anthropic/models/beta/beta_context_management_response.rbi +53 -0
- data/rbi/anthropic/models/beta/beta_count_tokens_context_management_response.rbi +35 -0
- data/rbi/anthropic/models/beta/beta_document_block.rbi +95 -0
- data/rbi/anthropic/models/beta/beta_input_tokens_clear_at_least.rbi +33 -0
- data/rbi/anthropic/models/beta/beta_input_tokens_trigger.rbi +33 -0
- data/rbi/anthropic/models/beta/beta_memory_tool_20250818.rbi +72 -0
- data/rbi/anthropic/models/beta/beta_memory_tool_20250818_command.rbi +33 -0
- data/rbi/anthropic/models/beta/beta_memory_tool_20250818_create_command.rbi +53 -0
- data/rbi/anthropic/models/beta/beta_memory_tool_20250818_delete_command.rbi +41 -0
- data/rbi/anthropic/models/beta/beta_memory_tool_20250818_insert_command.rbi +69 -0
- data/rbi/anthropic/models/beta/beta_memory_tool_20250818_rename_command.rbi +55 -0
- data/rbi/anthropic/models/beta/beta_memory_tool_20250818_str_replace_command.rbi +64 -0
- data/rbi/anthropic/models/beta/beta_memory_tool_20250818_view_command.rbi +59 -0
- data/rbi/anthropic/models/beta/beta_message.rbi +21 -0
- data/rbi/anthropic/models/beta/beta_message_tokens_count.rbi +40 -2
- data/rbi/anthropic/models/beta/beta_raw_content_block_start_event.rbi +2 -0
- data/rbi/anthropic/models/beta/beta_raw_message_delta_event.rbi +20 -0
- data/rbi/anthropic/models/beta/beta_request_document_block.rbi +5 -3
- data/rbi/anthropic/models/beta/beta_server_tool_usage.rbi +17 -2
- data/rbi/anthropic/models/beta/beta_server_tool_use_block.rbi +5 -0
- data/rbi/anthropic/models/beta/beta_server_tool_use_block_param.rbi +5 -0
- data/rbi/anthropic/models/beta/beta_stop_reason.rbi +5 -0
- data/rbi/anthropic/models/beta/beta_tool_result_block_param.rbi +2 -1
- data/rbi/anthropic/models/beta/beta_tool_union.rbi +3 -1
- data/rbi/anthropic/models/beta/beta_tool_uses_keep.rbi +33 -0
- data/rbi/anthropic/models/beta/beta_tool_uses_trigger.rbi +33 -0
- data/rbi/anthropic/models/beta/beta_web_fetch_block.rbi +67 -0
- data/rbi/anthropic/models/beta/beta_web_fetch_block_param.rbi +71 -0
- data/rbi/anthropic/models/beta/beta_web_fetch_tool_20250910.rbi +125 -0
- data/rbi/anthropic/models/beta/beta_web_fetch_tool_result_block.rbi +81 -0
- data/rbi/anthropic/models/beta/beta_web_fetch_tool_result_block_param.rbi +109 -0
- data/rbi/anthropic/models/beta/beta_web_fetch_tool_result_error_block.rbi +51 -0
- data/rbi/anthropic/models/beta/beta_web_fetch_tool_result_error_block_param.rbi +50 -0
- data/rbi/anthropic/models/beta/beta_web_fetch_tool_result_error_code.rbi +70 -0
- data/rbi/anthropic/models/beta/message_count_tokens_params.rbi +33 -5
- data/rbi/anthropic/models/beta/message_create_params.rbi +30 -4
- data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +36 -4
- data/rbi/anthropic/models/document_block_param.rbi +7 -3
- data/rbi/anthropic/models/model.rbi +8 -0
- data/rbi/anthropic/models/stop_reason.rbi +5 -0
- data/rbi/anthropic/models/tool_result_block_param.rbi +2 -1
- data/rbi/anthropic/resources/beta/messages.rbi +21 -3
- data/sig/anthropic/errors.rbs +7 -0
- data/sig/anthropic/internal/type/base_stream.rbs +5 -0
- data/sig/anthropic/models/beta/beta_citation_config.rbs +17 -0
- data/sig/anthropic/models/beta/beta_clear_tool_uses_20250919_edit.rbs +77 -0
- data/sig/anthropic/models/beta/beta_clear_tool_uses_20250919_edit_response.rbs +34 -0
- data/sig/anthropic/models/beta/beta_content_block.rbs +1 -0
- data/sig/anthropic/models/beta/beta_content_block_param.rbs +1 -0
- data/sig/anthropic/models/beta/beta_context_management_config.rbs +26 -0
- data/sig/anthropic/models/beta/beta_context_management_response.rbs +24 -0
- data/sig/anthropic/models/beta/beta_count_tokens_context_management_response.rbs +18 -0
- data/sig/anthropic/models/beta/beta_document_block.rbs +49 -0
- data/sig/anthropic/models/beta/beta_input_tokens_clear_at_least.rbs +20 -0
- data/sig/anthropic/models/beta/beta_input_tokens_trigger.rbs +19 -0
- data/sig/anthropic/models/beta/beta_memory_tool_20250818.rbs +34 -0
- data/sig/anthropic/models/beta/beta_memory_tool_20250818_command.rbs +21 -0
- data/sig/anthropic/models/beta/beta_memory_tool_20250818_create_command.rbs +26 -0
- data/sig/anthropic/models/beta/beta_memory_tool_20250818_delete_command.rbs +20 -0
- data/sig/anthropic/models/beta/beta_memory_tool_20250818_insert_command.rbs +39 -0
- data/sig/anthropic/models/beta/beta_memory_tool_20250818_rename_command.rbs +26 -0
- data/sig/anthropic/models/beta/beta_memory_tool_20250818_str_replace_command.rbs +39 -0
- data/sig/anthropic/models/beta/beta_memory_tool_20250818_view_command.rbs +32 -0
- data/sig/anthropic/models/beta/beta_message.rbs +5 -0
- data/sig/anthropic/models/beta/beta_message_tokens_count.rbs +15 -3
- data/sig/anthropic/models/beta/beta_raw_content_block_start_event.rbs +1 -0
- data/sig/anthropic/models/beta/beta_raw_message_delta_event.rbs +5 -0
- data/sig/anthropic/models/beta/beta_request_document_block.rbs +4 -8
- data/sig/anthropic/models/beta/beta_server_tool_usage.rbs +12 -3
- data/sig/anthropic/models/beta/beta_server_tool_use_block.rbs +2 -0
- data/sig/anthropic/models/beta/beta_server_tool_use_block_param.rbs +2 -0
- data/sig/anthropic/models/beta/beta_stop_reason.rbs +2 -0
- data/sig/anthropic/models/beta/beta_tool_result_block_param.rbs +1 -0
- data/sig/anthropic/models/beta/beta_tool_union.rbs +2 -0
- data/sig/anthropic/models/beta/beta_tool_uses_keep.rbs +19 -0
- data/sig/anthropic/models/beta/beta_tool_uses_trigger.rbs +19 -0
- data/sig/anthropic/models/beta/beta_web_fetch_block.rbs +39 -0
- data/sig/anthropic/models/beta/beta_web_fetch_block_param.rbs +39 -0
- data/sig/anthropic/models/beta/beta_web_fetch_tool_20250910.rbs +59 -0
- data/sig/anthropic/models/beta/beta_web_fetch_tool_result_block.rbs +44 -0
- data/sig/anthropic/models/beta/beta_web_fetch_tool_result_block_param.rbs +49 -0
- data/sig/anthropic/models/beta/beta_web_fetch_tool_result_error_block.rbs +29 -0
- data/sig/anthropic/models/beta/beta_web_fetch_tool_result_error_block_param.rbs +29 -0
- data/sig/anthropic/models/beta/beta_web_fetch_tool_result_error_code.rbs +32 -0
- data/sig/anthropic/models/beta/message_count_tokens_params.rbs +7 -0
- data/sig/anthropic/models/beta/message_create_params.rbs +5 -0
- data/sig/anthropic/models/beta/messages/batch_create_params.rbs +5 -0
- data/sig/anthropic/models/document_block_param.rbs +4 -8
- data/sig/anthropic/models/model.rbs +8 -0
- data/sig/anthropic/models/stop_reason.rbs +2 -0
- data/sig/anthropic/models/tool_result_block_param.rbs +1 -0
- data/sig/anthropic/resources/beta/messages.rbs +3 -0
- metadata +83 -2
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
class BetaContextManagementResponse < Anthropic::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute applied_edits
|
|
8
|
+
# List of context management edits that were applied.
|
|
9
|
+
#
|
|
10
|
+
# @return [Array<Anthropic::Models::Beta::BetaClearToolUses20250919EditResponse>]
|
|
11
|
+
required :applied_edits,
|
|
12
|
+
-> { Anthropic::Internal::Type::ArrayOf[Anthropic::Beta::BetaClearToolUses20250919EditResponse] }
|
|
13
|
+
|
|
14
|
+
# @!method initialize(applied_edits:)
|
|
15
|
+
# Information about context management operations applied during the request.
|
|
16
|
+
#
|
|
17
|
+
# @param applied_edits [Array<Anthropic::Models::Beta::BetaClearToolUses20250919EditResponse>] List of context management edits that were applied.
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
BetaContextManagementResponse = Beta::BetaContextManagementResponse
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
class BetaCountTokensContextManagementResponse < Anthropic::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute original_input_tokens
|
|
8
|
+
# The original token count before context management was applied
|
|
9
|
+
#
|
|
10
|
+
# @return [Integer]
|
|
11
|
+
required :original_input_tokens, Integer
|
|
12
|
+
|
|
13
|
+
# @!method initialize(original_input_tokens:)
|
|
14
|
+
# @param original_input_tokens [Integer] The original token count before context management was applied
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
BetaCountTokensContextManagementResponse = Beta::BetaCountTokensContextManagementResponse
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
class BetaDocumentBlock < Anthropic::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute citations
|
|
8
|
+
# Citation configuration for the document
|
|
9
|
+
#
|
|
10
|
+
# @return [Anthropic::Models::Beta::BetaCitationConfig, nil]
|
|
11
|
+
required :citations, -> { Anthropic::Beta::BetaCitationConfig }, nil?: true
|
|
12
|
+
|
|
13
|
+
# @!attribute source
|
|
14
|
+
#
|
|
15
|
+
# @return [Anthropic::Models::Beta::BetaBase64PDFSource, Anthropic::Models::Beta::BetaPlainTextSource]
|
|
16
|
+
required :source, union: -> { Anthropic::Beta::BetaDocumentBlock::Source }
|
|
17
|
+
|
|
18
|
+
# @!attribute title
|
|
19
|
+
# The title of the document
|
|
20
|
+
#
|
|
21
|
+
# @return [String, nil]
|
|
22
|
+
required :title, String, nil?: true
|
|
23
|
+
|
|
24
|
+
# @!attribute type
|
|
25
|
+
#
|
|
26
|
+
# @return [Symbol, :document]
|
|
27
|
+
required :type, const: :document
|
|
28
|
+
|
|
29
|
+
# @!method initialize(citations:, source:, title:, type: :document)
|
|
30
|
+
# @param citations [Anthropic::Models::Beta::BetaCitationConfig, nil] Citation configuration for the document
|
|
31
|
+
#
|
|
32
|
+
# @param source [Anthropic::Models::Beta::BetaBase64PDFSource, Anthropic::Models::Beta::BetaPlainTextSource]
|
|
33
|
+
#
|
|
34
|
+
# @param title [String, nil] The title of the document
|
|
35
|
+
#
|
|
36
|
+
# @param type [Symbol, :document]
|
|
37
|
+
|
|
38
|
+
# @see Anthropic::Models::Beta::BetaDocumentBlock#source
|
|
39
|
+
module Source
|
|
40
|
+
extend Anthropic::Internal::Type::Union
|
|
41
|
+
|
|
42
|
+
discriminator :type
|
|
43
|
+
|
|
44
|
+
variant :base64, -> { Anthropic::Beta::BetaBase64PDFSource }
|
|
45
|
+
|
|
46
|
+
variant :text, -> { Anthropic::Beta::BetaPlainTextSource }
|
|
47
|
+
|
|
48
|
+
# @!method self.variants
|
|
49
|
+
# @return [Array(Anthropic::Models::Beta::BetaBase64PDFSource, Anthropic::Models::Beta::BetaPlainTextSource)]
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
BetaDocumentBlock = Beta::BetaDocumentBlock
|
|
55
|
+
end
|
|
56
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
class BetaInputTokensClearAtLeast < Anthropic::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute type
|
|
8
|
+
#
|
|
9
|
+
# @return [Symbol, :input_tokens]
|
|
10
|
+
required :type, const: :input_tokens
|
|
11
|
+
|
|
12
|
+
# @!attribute value
|
|
13
|
+
#
|
|
14
|
+
# @return [Integer]
|
|
15
|
+
required :value, Integer
|
|
16
|
+
|
|
17
|
+
# @!method initialize(value:, type: :input_tokens)
|
|
18
|
+
# @param value [Integer]
|
|
19
|
+
# @param type [Symbol, :input_tokens]
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
BetaInputTokensClearAtLeast = Beta::BetaInputTokensClearAtLeast
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
class BetaInputTokensTrigger < Anthropic::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute type
|
|
8
|
+
#
|
|
9
|
+
# @return [Symbol, :input_tokens]
|
|
10
|
+
required :type, const: :input_tokens
|
|
11
|
+
|
|
12
|
+
# @!attribute value
|
|
13
|
+
#
|
|
14
|
+
# @return [Integer]
|
|
15
|
+
required :value, Integer
|
|
16
|
+
|
|
17
|
+
# @!method initialize(value:, type: :input_tokens)
|
|
18
|
+
# @param value [Integer]
|
|
19
|
+
# @param type [Symbol, :input_tokens]
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
BetaInputTokensTrigger = Beta::BetaInputTokensTrigger
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
class BetaMemoryTool20250818 < Anthropic::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute name
|
|
8
|
+
# Name of the tool.
|
|
9
|
+
#
|
|
10
|
+
# This is how the tool will be called by the model and in `tool_use` blocks.
|
|
11
|
+
#
|
|
12
|
+
# @return [Symbol, :memory]
|
|
13
|
+
required :name, const: :memory
|
|
14
|
+
|
|
15
|
+
# @!attribute type
|
|
16
|
+
#
|
|
17
|
+
# @return [Symbol, :memory_20250818]
|
|
18
|
+
required :type, const: :memory_20250818
|
|
19
|
+
|
|
20
|
+
# @!attribute cache_control
|
|
21
|
+
# Create a cache control breakpoint at this content block.
|
|
22
|
+
#
|
|
23
|
+
# @return [Anthropic::Models::Beta::BetaCacheControlEphemeral, nil]
|
|
24
|
+
optional :cache_control, -> { Anthropic::Beta::BetaCacheControlEphemeral }, nil?: true
|
|
25
|
+
|
|
26
|
+
# @!method initialize(cache_control: nil, name: :memory, type: :memory_20250818)
|
|
27
|
+
# Some parameter documentations has been truncated, see
|
|
28
|
+
# {Anthropic::Models::Beta::BetaMemoryTool20250818} for more details.
|
|
29
|
+
#
|
|
30
|
+
# @param cache_control [Anthropic::Models::Beta::BetaCacheControlEphemeral, nil] Create a cache control breakpoint at this content block.
|
|
31
|
+
#
|
|
32
|
+
# @param name [Symbol, :memory] Name of the tool.
|
|
33
|
+
#
|
|
34
|
+
# @param type [Symbol, :memory_20250818]
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
BetaMemoryTool20250818 = Beta::BetaMemoryTool20250818
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
module BetaMemoryTool20250818Command
|
|
7
|
+
extend Anthropic::Internal::Type::Union
|
|
8
|
+
|
|
9
|
+
discriminator :command
|
|
10
|
+
|
|
11
|
+
variant :view, -> { Anthropic::Beta::BetaMemoryTool20250818ViewCommand }
|
|
12
|
+
|
|
13
|
+
variant :create, -> { Anthropic::Beta::BetaMemoryTool20250818CreateCommand }
|
|
14
|
+
|
|
15
|
+
variant :str_replace, -> { Anthropic::Beta::BetaMemoryTool20250818StrReplaceCommand }
|
|
16
|
+
|
|
17
|
+
variant :insert, -> { Anthropic::Beta::BetaMemoryTool20250818InsertCommand }
|
|
18
|
+
|
|
19
|
+
variant :delete, -> { Anthropic::Beta::BetaMemoryTool20250818DeleteCommand }
|
|
20
|
+
|
|
21
|
+
variant :rename, -> { Anthropic::Beta::BetaMemoryTool20250818RenameCommand }
|
|
22
|
+
|
|
23
|
+
# @!method self.variants
|
|
24
|
+
# @return [Array(Anthropic::Models::Beta::BetaMemoryTool20250818ViewCommand, Anthropic::Models::Beta::BetaMemoryTool20250818CreateCommand, Anthropic::Models::Beta::BetaMemoryTool20250818StrReplaceCommand, Anthropic::Models::Beta::BetaMemoryTool20250818InsertCommand, Anthropic::Models::Beta::BetaMemoryTool20250818DeleteCommand, Anthropic::Models::Beta::BetaMemoryTool20250818RenameCommand)]
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
BetaMemoryTool20250818Command = Beta::BetaMemoryTool20250818Command
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
class BetaMemoryTool20250818CreateCommand < Anthropic::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute command
|
|
8
|
+
# Command type identifier
|
|
9
|
+
#
|
|
10
|
+
# @return [Symbol, :create]
|
|
11
|
+
required :command, const: :create
|
|
12
|
+
|
|
13
|
+
# @!attribute file_text
|
|
14
|
+
# Content to write to the file
|
|
15
|
+
#
|
|
16
|
+
# @return [String]
|
|
17
|
+
required :file_text, String
|
|
18
|
+
|
|
19
|
+
# @!attribute path
|
|
20
|
+
# Path where the file should be created
|
|
21
|
+
#
|
|
22
|
+
# @return [String]
|
|
23
|
+
required :path, String
|
|
24
|
+
|
|
25
|
+
# @!method initialize(file_text:, path:, command: :create)
|
|
26
|
+
# @param file_text [String] Content to write to the file
|
|
27
|
+
#
|
|
28
|
+
# @param path [String] Path where the file should be created
|
|
29
|
+
#
|
|
30
|
+
# @param command [Symbol, :create] Command type identifier
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
BetaMemoryTool20250818CreateCommand = Beta::BetaMemoryTool20250818CreateCommand
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
class BetaMemoryTool20250818DeleteCommand < Anthropic::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute command
|
|
8
|
+
# Command type identifier
|
|
9
|
+
#
|
|
10
|
+
# @return [Symbol, :delete]
|
|
11
|
+
required :command, const: :delete
|
|
12
|
+
|
|
13
|
+
# @!attribute path
|
|
14
|
+
# Path to the file or directory to delete
|
|
15
|
+
#
|
|
16
|
+
# @return [String]
|
|
17
|
+
required :path, String
|
|
18
|
+
|
|
19
|
+
# @!method initialize(path:, command: :delete)
|
|
20
|
+
# @param path [String] Path to the file or directory to delete
|
|
21
|
+
#
|
|
22
|
+
# @param command [Symbol, :delete] Command type identifier
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
BetaMemoryTool20250818DeleteCommand = Beta::BetaMemoryTool20250818DeleteCommand
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
class BetaMemoryTool20250818InsertCommand < Anthropic::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute command
|
|
8
|
+
# Command type identifier
|
|
9
|
+
#
|
|
10
|
+
# @return [Symbol, :insert]
|
|
11
|
+
required :command, const: :insert
|
|
12
|
+
|
|
13
|
+
# @!attribute insert_line
|
|
14
|
+
# Line number where text should be inserted
|
|
15
|
+
#
|
|
16
|
+
# @return [Integer]
|
|
17
|
+
required :insert_line, Integer
|
|
18
|
+
|
|
19
|
+
# @!attribute insert_text
|
|
20
|
+
# Text to insert at the specified line
|
|
21
|
+
#
|
|
22
|
+
# @return [String]
|
|
23
|
+
required :insert_text, String
|
|
24
|
+
|
|
25
|
+
# @!attribute path
|
|
26
|
+
# Path to the file where text should be inserted
|
|
27
|
+
#
|
|
28
|
+
# @return [String]
|
|
29
|
+
required :path, String
|
|
30
|
+
|
|
31
|
+
# @!method initialize(insert_line:, insert_text:, path:, command: :insert)
|
|
32
|
+
# @param insert_line [Integer] Line number where text should be inserted
|
|
33
|
+
#
|
|
34
|
+
# @param insert_text [String] Text to insert at the specified line
|
|
35
|
+
#
|
|
36
|
+
# @param path [String] Path to the file where text should be inserted
|
|
37
|
+
#
|
|
38
|
+
# @param command [Symbol, :insert] Command type identifier
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
BetaMemoryTool20250818InsertCommand = Beta::BetaMemoryTool20250818InsertCommand
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
class BetaMemoryTool20250818RenameCommand < Anthropic::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute command
|
|
8
|
+
# Command type identifier
|
|
9
|
+
#
|
|
10
|
+
# @return [Symbol, :rename]
|
|
11
|
+
required :command, const: :rename
|
|
12
|
+
|
|
13
|
+
# @!attribute new_path
|
|
14
|
+
# New path for the file or directory
|
|
15
|
+
#
|
|
16
|
+
# @return [String]
|
|
17
|
+
required :new_path, String
|
|
18
|
+
|
|
19
|
+
# @!attribute old_path
|
|
20
|
+
# Current path of the file or directory
|
|
21
|
+
#
|
|
22
|
+
# @return [String]
|
|
23
|
+
required :old_path, String
|
|
24
|
+
|
|
25
|
+
# @!method initialize(new_path:, old_path:, command: :rename)
|
|
26
|
+
# @param new_path [String] New path for the file or directory
|
|
27
|
+
#
|
|
28
|
+
# @param old_path [String] Current path of the file or directory
|
|
29
|
+
#
|
|
30
|
+
# @param command [Symbol, :rename] Command type identifier
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
BetaMemoryTool20250818RenameCommand = Beta::BetaMemoryTool20250818RenameCommand
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
class BetaMemoryTool20250818StrReplaceCommand < Anthropic::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute command
|
|
8
|
+
# Command type identifier
|
|
9
|
+
#
|
|
10
|
+
# @return [Symbol, :str_replace]
|
|
11
|
+
required :command, const: :str_replace
|
|
12
|
+
|
|
13
|
+
# @!attribute new_str
|
|
14
|
+
# Text to replace with
|
|
15
|
+
#
|
|
16
|
+
# @return [String]
|
|
17
|
+
required :new_str, String
|
|
18
|
+
|
|
19
|
+
# @!attribute old_str
|
|
20
|
+
# Text to search for and replace
|
|
21
|
+
#
|
|
22
|
+
# @return [String]
|
|
23
|
+
required :old_str, String
|
|
24
|
+
|
|
25
|
+
# @!attribute path
|
|
26
|
+
# Path to the file where text should be replaced
|
|
27
|
+
#
|
|
28
|
+
# @return [String]
|
|
29
|
+
required :path, String
|
|
30
|
+
|
|
31
|
+
# @!method initialize(new_str:, old_str:, path:, command: :str_replace)
|
|
32
|
+
# @param new_str [String] Text to replace with
|
|
33
|
+
#
|
|
34
|
+
# @param old_str [String] Text to search for and replace
|
|
35
|
+
#
|
|
36
|
+
# @param path [String] Path to the file where text should be replaced
|
|
37
|
+
#
|
|
38
|
+
# @param command [Symbol, :str_replace] Command type identifier
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
BetaMemoryTool20250818StrReplaceCommand = Beta::BetaMemoryTool20250818StrReplaceCommand
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
class BetaMemoryTool20250818ViewCommand < Anthropic::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute command
|
|
8
|
+
# Command type identifier
|
|
9
|
+
#
|
|
10
|
+
# @return [Symbol, :view]
|
|
11
|
+
required :command, const: :view
|
|
12
|
+
|
|
13
|
+
# @!attribute path
|
|
14
|
+
# Path to directory or file to view
|
|
15
|
+
#
|
|
16
|
+
# @return [String]
|
|
17
|
+
required :path, String
|
|
18
|
+
|
|
19
|
+
# @!attribute view_range
|
|
20
|
+
# Optional line range for viewing specific lines
|
|
21
|
+
#
|
|
22
|
+
# @return [Array<Integer>, nil]
|
|
23
|
+
optional :view_range, Anthropic::Internal::Type::ArrayOf[Integer]
|
|
24
|
+
|
|
25
|
+
# @!method initialize(path:, view_range: nil, command: :view)
|
|
26
|
+
# @param path [String] Path to directory or file to view
|
|
27
|
+
#
|
|
28
|
+
# @param view_range [Array<Integer>] Optional line range for viewing specific lines
|
|
29
|
+
#
|
|
30
|
+
# @param command [Symbol, :view] Command type identifier
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
BetaMemoryTool20250818ViewCommand = Beta::BetaMemoryTool20250818ViewCommand
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -56,9 +56,15 @@ module Anthropic
|
|
|
56
56
|
# [{ "type": "text", "text": "B)" }]
|
|
57
57
|
# ```
|
|
58
58
|
#
|
|
59
|
-
# @return [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::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock>]
|
|
59
|
+
# @return [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>]
|
|
60
60
|
required :content, -> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::Beta::BetaContentBlock] }
|
|
61
61
|
|
|
62
|
+
# @!attribute context_management
|
|
63
|
+
# Information about context management operations applied during the request.
|
|
64
|
+
#
|
|
65
|
+
# @return [Anthropic::Models::Beta::BetaContextManagementResponse, nil]
|
|
66
|
+
required :context_management, -> { Anthropic::Beta::BetaContextManagementResponse }, nil?: true
|
|
67
|
+
|
|
62
68
|
# @!attribute model
|
|
63
69
|
# The model that will complete your prompt.\n\nSee
|
|
64
70
|
# [models](https://docs.anthropic.com/en/docs/models-overview) for additional
|
|
@@ -132,7 +138,7 @@ module Anthropic
|
|
|
132
138
|
# @return [Anthropic::Models::Beta::BetaUsage]
|
|
133
139
|
required :usage, -> { Anthropic::Beta::BetaUsage }
|
|
134
140
|
|
|
135
|
-
# @!method initialize(id:, container:, content:, model:, stop_reason:, stop_sequence:, usage:, role: :assistant, type: :message)
|
|
141
|
+
# @!method initialize(id:, container:, content:, context_management:, model:, stop_reason:, stop_sequence:, usage:, role: :assistant, type: :message)
|
|
136
142
|
# Some parameter documentations has been truncated, see
|
|
137
143
|
# {Anthropic::Models::Beta::BetaMessage} for more details.
|
|
138
144
|
#
|
|
@@ -140,7 +146,9 @@ module Anthropic
|
|
|
140
146
|
#
|
|
141
147
|
# @param container [Anthropic::Models::Beta::BetaContainer, nil] Information about the container used in the request (for the code execution tool
|
|
142
148
|
#
|
|
143
|
-
# @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::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.
|
|
149
|
+
# @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
|
+
#
|
|
151
|
+
# @param context_management [Anthropic::Models::Beta::BetaContextManagementResponse, nil] Information about context management operations applied during the request.
|
|
144
152
|
#
|
|
145
153
|
# @param model [Symbol, String, Anthropic::Models::Model] The model that will complete your prompt.\n\nSee [models](https://docs.anthropic
|
|
146
154
|
#
|
|
@@ -6,7 +6,7 @@ module Anthropic
|
|
|
6
6
|
class BetaMessageParam < Anthropic::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute content
|
|
8
8
|
#
|
|
9
|
-
# @return [String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam>]
|
|
9
|
+
# @return [String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaWebFetchToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam>]
|
|
10
10
|
required :content, union: -> { Anthropic::Beta::BetaMessageParam::Content }
|
|
11
11
|
|
|
12
12
|
# @!attribute role
|
|
@@ -15,7 +15,7 @@ module Anthropic
|
|
|
15
15
|
required :role, enum: -> { Anthropic::Beta::BetaMessageParam::Role }
|
|
16
16
|
|
|
17
17
|
# @!method initialize(content:, role:)
|
|
18
|
-
# @param content [String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam>]
|
|
18
|
+
# @param content [String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaWebFetchToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam>]
|
|
19
19
|
# @param role [Symbol, Anthropic::Models::Beta::BetaMessageParam::Role]
|
|
20
20
|
|
|
21
21
|
# @see Anthropic::Models::Beta::BetaMessageParam#content
|
|
@@ -27,7 +27,7 @@ module Anthropic
|
|
|
27
27
|
variant -> { Anthropic::Models::Beta::BetaMessageParam::Content::BetaContentBlockParamArray }
|
|
28
28
|
|
|
29
29
|
# @!method self.variants
|
|
30
|
-
# @return [Array(String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam>)]
|
|
30
|
+
# @return [Array(String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaWebFetchToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam>)]
|
|
31
31
|
|
|
32
32
|
# @type [Anthropic::Internal::Type::Converter]
|
|
33
33
|
BetaContentBlockParamArray =
|
|
@@ -5,6 +5,16 @@ module Anthropic
|
|
|
5
5
|
module Beta
|
|
6
6
|
# @see Anthropic::Resources::Beta::Messages#count_tokens
|
|
7
7
|
class BetaMessageTokensCount < Anthropic::Internal::Type::BaseModel
|
|
8
|
+
# @!attribute context_management
|
|
9
|
+
# Information about context management applied to the message.
|
|
10
|
+
#
|
|
11
|
+
# @return [Anthropic::Models::Beta::BetaCountTokensContextManagementResponse, nil]
|
|
12
|
+
required :context_management,
|
|
13
|
+
-> {
|
|
14
|
+
Anthropic::Beta::BetaCountTokensContextManagementResponse
|
|
15
|
+
},
|
|
16
|
+
nil?: true
|
|
17
|
+
|
|
8
18
|
# @!attribute input_tokens
|
|
9
19
|
# The total number of tokens across the provided list of messages, system prompt,
|
|
10
20
|
# and tools.
|
|
@@ -12,10 +22,12 @@ module Anthropic
|
|
|
12
22
|
# @return [Integer]
|
|
13
23
|
required :input_tokens, Integer
|
|
14
24
|
|
|
15
|
-
# @!method initialize(input_tokens:)
|
|
25
|
+
# @!method initialize(context_management:, input_tokens:)
|
|
16
26
|
# Some parameter documentations has been truncated, see
|
|
17
27
|
# {Anthropic::Models::Beta::BetaMessageTokensCount} for more details.
|
|
18
28
|
#
|
|
29
|
+
# @param context_management [Anthropic::Models::Beta::BetaCountTokensContextManagementResponse, nil] Information about context management applied to the message.
|
|
30
|
+
#
|
|
19
31
|
# @param input_tokens [Integer] The total number of tokens across the provided list of messages, system prompt,
|
|
20
32
|
end
|
|
21
33
|
end
|
|
@@ -7,7 +7,7 @@ module Anthropic
|
|
|
7
7
|
# @!attribute content_block
|
|
8
8
|
# Response model for a file uploaded to the container.
|
|
9
9
|
#
|
|
10
|
-
# @return [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::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock]
|
|
10
|
+
# @return [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]
|
|
11
11
|
required :content_block, union: -> { Anthropic::Beta::BetaRawContentBlockStartEvent::ContentBlock }
|
|
12
12
|
|
|
13
13
|
# @!attribute index
|
|
@@ -21,7 +21,7 @@ module Anthropic
|
|
|
21
21
|
required :type, const: :content_block_start
|
|
22
22
|
|
|
23
23
|
# @!method initialize(content_block:, index:, type: :content_block_start)
|
|
24
|
-
# @param content_block [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::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock] Response model for a file uploaded to the container.
|
|
24
|
+
# @param content_block [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] Response model for a file uploaded to the container.
|
|
25
25
|
#
|
|
26
26
|
# @param index [Integer]
|
|
27
27
|
#
|
|
@@ -47,6 +47,8 @@ module Anthropic
|
|
|
47
47
|
|
|
48
48
|
variant :web_search_tool_result, -> { Anthropic::Beta::BetaWebSearchToolResultBlock }
|
|
49
49
|
|
|
50
|
+
variant :web_fetch_tool_result, -> { Anthropic::Beta::BetaWebFetchToolResultBlock }
|
|
51
|
+
|
|
50
52
|
variant :code_execution_tool_result, -> { Anthropic::Beta::BetaCodeExecutionToolResultBlock }
|
|
51
53
|
|
|
52
54
|
variant :bash_code_execution_tool_result, -> { Anthropic::Beta::BetaBashCodeExecutionToolResultBlock }
|
|
@@ -62,7 +64,7 @@ module Anthropic
|
|
|
62
64
|
variant :container_upload, -> { Anthropic::Beta::BetaContainerUploadBlock }
|
|
63
65
|
|
|
64
66
|
# @!method self.variants
|
|
65
|
-
# @return [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::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock)]
|
|
67
|
+
# @return [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)]
|
|
66
68
|
end
|
|
67
69
|
end
|
|
68
70
|
end
|
|
@@ -4,6 +4,12 @@ module Anthropic
|
|
|
4
4
|
module Models
|
|
5
5
|
module Beta
|
|
6
6
|
class BetaRawMessageDeltaEvent < Anthropic::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute context_management
|
|
8
|
+
# Information about context management operations applied during the request.
|
|
9
|
+
#
|
|
10
|
+
# @return [Anthropic::Models::Beta::BetaContextManagementResponse, nil]
|
|
11
|
+
required :context_management, -> { Anthropic::Beta::BetaContextManagementResponse }, nil?: true
|
|
12
|
+
|
|
7
13
|
# @!attribute delta
|
|
8
14
|
#
|
|
9
15
|
# @return [Anthropic::Models::Beta::BetaRawMessageDeltaEvent::Delta]
|
|
@@ -34,10 +40,12 @@ module Anthropic
|
|
|
34
40
|
# @return [Anthropic::Models::Beta::BetaMessageDeltaUsage]
|
|
35
41
|
required :usage, -> { Anthropic::Beta::BetaMessageDeltaUsage }
|
|
36
42
|
|
|
37
|
-
# @!method initialize(delta:, usage:, type: :message_delta)
|
|
43
|
+
# @!method initialize(context_management:, delta:, usage:, type: :message_delta)
|
|
38
44
|
# Some parameter documentations has been truncated, see
|
|
39
45
|
# {Anthropic::Models::Beta::BetaRawMessageDeltaEvent} for more details.
|
|
40
46
|
#
|
|
47
|
+
# @param context_management [Anthropic::Models::Beta::BetaContextManagementResponse, nil] Information about context management operations applied during the request.
|
|
48
|
+
#
|
|
41
49
|
# @param delta [Anthropic::Models::Beta::BetaRawMessageDeltaEvent::Delta]
|
|
42
50
|
#
|
|
43
51
|
# @param usage [Anthropic::Models::Beta::BetaMessageDeltaUsage] Billing and rate-limit usage.
|
|
@@ -23,7 +23,7 @@ module Anthropic
|
|
|
23
23
|
# @!attribute citations
|
|
24
24
|
#
|
|
25
25
|
# @return [Anthropic::Models::Beta::BetaCitationsConfigParam, nil]
|
|
26
|
-
optional :citations, -> { Anthropic::Beta::BetaCitationsConfigParam }
|
|
26
|
+
optional :citations, -> { Anthropic::Beta::BetaCitationsConfigParam }, nil?: true
|
|
27
27
|
|
|
28
28
|
# @!attribute context
|
|
29
29
|
#
|
|
@@ -40,7 +40,7 @@ module Anthropic
|
|
|
40
40
|
#
|
|
41
41
|
# @param cache_control [Anthropic::Models::Beta::BetaCacheControlEphemeral, nil] Create a cache control breakpoint at this content block.
|
|
42
42
|
#
|
|
43
|
-
# @param citations [Anthropic::Models::Beta::BetaCitationsConfigParam]
|
|
43
|
+
# @param citations [Anthropic::Models::Beta::BetaCitationsConfigParam, nil]
|
|
44
44
|
#
|
|
45
45
|
# @param context [String, nil]
|
|
46
46
|
#
|