anthropic 1.7.0 → 1.8.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 (134) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +20 -0
  3. data/README.md +1 -1
  4. data/lib/anthropic/helpers/input_schema/array_of.rb +41 -0
  5. data/lib/anthropic/helpers/input_schema/base_model.rb +86 -0
  6. data/lib/anthropic/helpers/input_schema/boolean.rb +29 -0
  7. data/lib/anthropic/helpers/input_schema/enum_of.rb +63 -0
  8. data/lib/anthropic/helpers/input_schema/json_schema_converter.rb +199 -0
  9. data/lib/anthropic/helpers/input_schema/parsed_json.rb +39 -0
  10. data/lib/anthropic/helpers/input_schema/property_mapping.rb +47 -0
  11. data/lib/anthropic/helpers/input_schema/union_of.rb +56 -0
  12. data/lib/anthropic/helpers/input_schema.rb +16 -0
  13. data/lib/anthropic/helpers/streaming/message_stream.rb +41 -1
  14. data/lib/anthropic/input_schema.rb +10 -0
  15. data/lib/anthropic/internal/stream.rb +2 -1
  16. data/lib/anthropic/internal/transport/base_client.rb +1 -2
  17. data/lib/anthropic/internal/transport/pooled_net_requester.rb +1 -9
  18. data/lib/anthropic/internal/type/base_model.rb +2 -9
  19. data/lib/anthropic/internal/util.rb +1 -1
  20. data/lib/anthropic/models/beta/beta_bash_code_execution_output_block.rb +25 -0
  21. data/lib/anthropic/models/beta/beta_bash_code_execution_output_block_param.rb +25 -0
  22. data/lib/anthropic/models/beta/beta_bash_code_execution_result_block.rb +44 -0
  23. data/lib/anthropic/models/beta/beta_bash_code_execution_result_block_param.rb +44 -0
  24. data/lib/anthropic/models/beta/beta_bash_code_execution_tool_result_block.rb +43 -0
  25. data/lib/anthropic/models/beta/beta_bash_code_execution_tool_result_block_param.rb +53 -0
  26. data/lib/anthropic/models/beta/beta_bash_code_execution_tool_result_error.rb +39 -0
  27. data/lib/anthropic/models/beta/beta_bash_code_execution_tool_result_error_param.rb +39 -0
  28. data/lib/anthropic/models/beta/beta_code_execution_tool_20250825.rb +40 -0
  29. data/lib/anthropic/models/beta/beta_content_block.rb +6 -1
  30. data/lib/anthropic/models/beta/beta_content_block_param.rb +7 -1
  31. data/lib/anthropic/models/beta/beta_message.rb +2 -2
  32. data/lib/anthropic/models/beta/beta_message_param.rb +3 -3
  33. data/lib/anthropic/models/beta/beta_raw_content_block_start_event.rb +8 -3
  34. data/lib/anthropic/models/beta/beta_server_tool_use_block.rb +2 -0
  35. data/lib/anthropic/models/beta/beta_server_tool_use_block_param.rb +2 -0
  36. data/lib/anthropic/models/beta/beta_text_editor_code_execution_create_result_block.rb +25 -0
  37. data/lib/anthropic/models/beta/beta_text_editor_code_execution_create_result_block_param.rb +26 -0
  38. data/lib/anthropic/models/beta/beta_text_editor_code_execution_str_replace_result_block.rb +49 -0
  39. data/lib/anthropic/models/beta/beta_text_editor_code_execution_str_replace_result_block_param.rb +50 -0
  40. data/lib/anthropic/models/beta/beta_text_editor_code_execution_tool_result_block.rb +47 -0
  41. data/lib/anthropic/models/beta/beta_text_editor_code_execution_tool_result_block_param.rb +57 -0
  42. data/lib/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error.rb +45 -0
  43. data/lib/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error_param.rb +46 -0
  44. data/lib/anthropic/models/beta/beta_text_editor_code_execution_view_result_block.rb +61 -0
  45. data/lib/anthropic/models/beta/beta_text_editor_code_execution_view_result_block_param.rb +62 -0
  46. data/lib/anthropic/models/beta/beta_tool_union.rb +3 -1
  47. data/lib/anthropic/models/beta/message_count_tokens_params.rb +7 -30
  48. data/lib/anthropic/models/beta/message_create_params.rb +3 -26
  49. data/lib/anthropic/models/beta/messages/batch_create_params.rb +6 -36
  50. data/lib/anthropic/models/beta/messages/beta_message_batch.rb +1 -4
  51. data/lib/anthropic/models/beta_error_response.rb +7 -1
  52. data/lib/anthropic/models/error_response.rb +7 -1
  53. data/lib/anthropic/models/message_count_tokens_params.rb +1 -24
  54. data/lib/anthropic/models/message_create_params.rb +1 -24
  55. data/lib/anthropic/models/messages/batch_create_params.rb +2 -28
  56. data/lib/anthropic/models/tool_use_block.rb +8 -0
  57. data/lib/anthropic/resources/beta/messages.rb +3 -3
  58. data/lib/anthropic/resources/messages.rb +85 -1
  59. data/lib/anthropic/version.rb +1 -1
  60. data/lib/anthropic.rb +29 -0
  61. data/rbi/anthropic/errors.rbi +2 -2
  62. data/rbi/anthropic/helpers/input_schema/array_of.rbi +16 -0
  63. data/rbi/anthropic/helpers/input_schema/base_model.rbi +21 -0
  64. data/rbi/anthropic/helpers/input_schema/boolean.rbi +11 -0
  65. data/rbi/anthropic/helpers/input_schema/enum_of.rbi +30 -0
  66. data/rbi/anthropic/helpers/input_schema/json_schema_converter.rbi +89 -0
  67. data/rbi/anthropic/helpers/input_schema/union_of.rbi +23 -0
  68. data/rbi/anthropic/helpers/structured_output.rbi +16 -0
  69. data/rbi/anthropic/input_schema.rbi +12 -0
  70. data/rbi/anthropic/models/beta/beta_bash_code_execution_output_block.rbi +33 -0
  71. data/rbi/anthropic/models/beta/beta_bash_code_execution_output_block_param.rbi +34 -0
  72. data/rbi/anthropic/models/beta/beta_bash_code_execution_result_block.rbi +72 -0
  73. data/rbi/anthropic/models/beta/beta_bash_code_execution_result_block_param.rbi +77 -0
  74. data/rbi/anthropic/models/beta/beta_bash_code_execution_tool_result_block.rbi +86 -0
  75. data/rbi/anthropic/models/beta/beta_bash_code_execution_tool_result_block_param.rbi +110 -0
  76. data/rbi/anthropic/models/beta/beta_bash_code_execution_tool_result_error.rbi +101 -0
  77. data/rbi/anthropic/models/beta/beta_bash_code_execution_tool_result_error_param.rbi +101 -0
  78. data/rbi/anthropic/models/beta/beta_code_execution_tool_20250825.rbi +72 -0
  79. data/rbi/anthropic/models/beta/beta_content_block.rbi +2 -0
  80. data/rbi/anthropic/models/beta/beta_content_block_param.rbi +2 -0
  81. data/rbi/anthropic/models/beta/beta_message.rbi +2 -0
  82. data/rbi/anthropic/models/beta/beta_raw_content_block_start_event.rbi +4 -0
  83. data/rbi/anthropic/models/beta/beta_server_tool_use_block.rbi +10 -0
  84. data/rbi/anthropic/models/beta/beta_server_tool_use_block_param.rbi +10 -0
  85. data/rbi/anthropic/models/beta/beta_text_editor_code_execution_create_result_block.rbi +41 -0
  86. data/rbi/anthropic/models/beta/beta_text_editor_code_execution_create_result_block_param.rbi +41 -0
  87. data/rbi/anthropic/models/beta/beta_text_editor_code_execution_str_replace_result_block.rbi +73 -0
  88. data/rbi/anthropic/models/beta/beta_text_editor_code_execution_str_replace_result_block_param.rbi +73 -0
  89. data/rbi/anthropic/models/beta/beta_text_editor_code_execution_tool_result_block.rbi +90 -0
  90. data/rbi/anthropic/models/beta/beta_text_editor_code_execution_tool_result_block_param.rbi +118 -0
  91. data/rbi/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error.rbi +110 -0
  92. data/rbi/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error_param.rbi +110 -0
  93. data/rbi/anthropic/models/beta/beta_text_editor_code_execution_view_result_block.rbi +118 -0
  94. data/rbi/anthropic/models/beta/beta_text_editor_code_execution_view_result_block_param.rbi +118 -0
  95. data/rbi/anthropic/models/beta/beta_tool_union.rbi +1 -0
  96. data/rbi/anthropic/models/beta/message_count_tokens_params.rbi +7 -48
  97. data/rbi/anthropic/models/beta/message_create_params.rbi +6 -48
  98. data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +6 -48
  99. data/rbi/anthropic/models/beta_error_response.rbi +10 -2
  100. data/rbi/anthropic/models/error_response.rbi +10 -2
  101. data/rbi/anthropic/models/message_count_tokens_params.rbi +2 -48
  102. data/rbi/anthropic/models/message_create_params.rbi +2 -48
  103. data/rbi/anthropic/models/messages/batch_create_params.rbi +2 -48
  104. data/rbi/anthropic/resources/beta/messages.rbi +6 -72
  105. data/rbi/anthropic/resources/messages.rbi +3 -72
  106. data/sig/anthropic/models/beta/beta_bash_code_execution_output_block.rbs +23 -0
  107. data/sig/anthropic/models/beta/beta_bash_code_execution_output_block_param.rbs +23 -0
  108. data/sig/anthropic/models/beta/beta_bash_code_execution_result_block.rbs +44 -0
  109. data/sig/anthropic/models/beta/beta_bash_code_execution_result_block_param.rbs +44 -0
  110. data/sig/anthropic/models/beta/beta_bash_code_execution_tool_result_block.rbs +44 -0
  111. data/sig/anthropic/models/beta/beta_bash_code_execution_tool_result_block_param.rbs +49 -0
  112. data/sig/anthropic/models/beta/beta_bash_code_execution_tool_result_error.rbs +48 -0
  113. data/sig/anthropic/models/beta/beta_bash_code_execution_tool_result_error_param.rbs +48 -0
  114. data/sig/anthropic/models/beta/beta_code_execution_tool_20250825.rbs +34 -0
  115. data/sig/anthropic/models/beta/beta_content_block.rbs +2 -0
  116. data/sig/anthropic/models/beta/beta_content_block_param.rbs +2 -0
  117. data/sig/anthropic/models/beta/beta_raw_content_block_start_event.rbs +2 -0
  118. data/sig/anthropic/models/beta/beta_server_tool_use_block.rbs +7 -1
  119. data/sig/anthropic/models/beta/beta_server_tool_use_block_param.rbs +7 -1
  120. data/sig/anthropic/models/beta/beta_text_editor_code_execution_create_result_block.rbs +29 -0
  121. data/sig/anthropic/models/beta/beta_text_editor_code_execution_create_result_block_param.rbs +29 -0
  122. data/sig/anthropic/models/beta/beta_text_editor_code_execution_str_replace_result_block.rbs +49 -0
  123. data/sig/anthropic/models/beta/beta_text_editor_code_execution_str_replace_result_block_param.rbs +49 -0
  124. data/sig/anthropic/models/beta/beta_text_editor_code_execution_tool_result_block.rbs +46 -0
  125. data/sig/anthropic/models/beta/beta_text_editor_code_execution_tool_result_block_param.rbs +51 -0
  126. data/sig/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error.rbs +53 -0
  127. data/sig/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error_param.rbs +53 -0
  128. data/sig/anthropic/models/beta/beta_text_editor_code_execution_view_result_block.rbs +61 -0
  129. data/sig/anthropic/models/beta/beta_text_editor_code_execution_view_result_block_param.rbs +61 -0
  130. data/sig/anthropic/models/beta/beta_tool_union.rbs +1 -0
  131. data/sig/anthropic/models/beta/message_count_tokens_params.rbs +1 -0
  132. data/sig/anthropic/models/beta_error_response.rbs +13 -2
  133. data/sig/anthropic/models/error_response.rbs +13 -2
  134. metadata +77 -2
@@ -0,0 +1,44 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaBashCodeExecutionResultBlockParam = Beta::BetaBashCodeExecutionResultBlockParam
4
+
5
+ module Beta
6
+ type beta_bash_code_execution_result_block_param =
7
+ {
8
+ content: ::Array[Anthropic::Beta::BetaBashCodeExecutionOutputBlockParam],
9
+ return_code: Integer,
10
+ stderr: String,
11
+ stdout: String,
12
+ type: :bash_code_execution_result
13
+ }
14
+
15
+ class BetaBashCodeExecutionResultBlockParam < Anthropic::Internal::Type::BaseModel
16
+ attr_accessor content: ::Array[Anthropic::Beta::BetaBashCodeExecutionOutputBlockParam]
17
+
18
+ attr_accessor return_code: Integer
19
+
20
+ attr_accessor stderr: String
21
+
22
+ attr_accessor stdout: String
23
+
24
+ attr_accessor type: :bash_code_execution_result
25
+
26
+ def initialize: (
27
+ content: ::Array[Anthropic::Beta::BetaBashCodeExecutionOutputBlockParam],
28
+ return_code: Integer,
29
+ stderr: String,
30
+ stdout: String,
31
+ ?type: :bash_code_execution_result
32
+ ) -> void
33
+
34
+ def to_hash: -> {
35
+ content: ::Array[Anthropic::Beta::BetaBashCodeExecutionOutputBlockParam],
36
+ return_code: Integer,
37
+ stderr: String,
38
+ stdout: String,
39
+ type: :bash_code_execution_result
40
+ }
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,44 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaBashCodeExecutionToolResultBlock = Beta::BetaBashCodeExecutionToolResultBlock
4
+
5
+ module Beta
6
+ type beta_bash_code_execution_tool_result_block =
7
+ {
8
+ content: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock::content,
9
+ tool_use_id: String,
10
+ type: :bash_code_execution_tool_result
11
+ }
12
+
13
+ class BetaBashCodeExecutionToolResultBlock < Anthropic::Internal::Type::BaseModel
14
+ attr_accessor content: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock::content
15
+
16
+ attr_accessor tool_use_id: String
17
+
18
+ attr_accessor type: :bash_code_execution_tool_result
19
+
20
+ def initialize: (
21
+ content: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock::content,
22
+ tool_use_id: String,
23
+ ?type: :bash_code_execution_tool_result
24
+ ) -> void
25
+
26
+ def to_hash: -> {
27
+ content: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock::content,
28
+ tool_use_id: String,
29
+ type: :bash_code_execution_tool_result
30
+ }
31
+
32
+ type content =
33
+ Anthropic::Beta::BetaBashCodeExecutionToolResultError
34
+ | Anthropic::Beta::BetaBashCodeExecutionResultBlock
35
+
36
+ module Content
37
+ extend Anthropic::Internal::Type::Union
38
+
39
+ def self?.variants: -> ::Array[Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock::content]
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,49 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaBashCodeExecutionToolResultBlockParam = Beta::BetaBashCodeExecutionToolResultBlockParam
4
+
5
+ module Beta
6
+ type beta_bash_code_execution_tool_result_block_param =
7
+ {
8
+ content: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam::content,
9
+ tool_use_id: String,
10
+ type: :bash_code_execution_tool_result,
11
+ cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
12
+ }
13
+
14
+ class BetaBashCodeExecutionToolResultBlockParam < Anthropic::Internal::Type::BaseModel
15
+ attr_accessor content: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam::content
16
+
17
+ attr_accessor tool_use_id: String
18
+
19
+ attr_accessor type: :bash_code_execution_tool_result
20
+
21
+ attr_accessor cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
22
+
23
+ def initialize: (
24
+ content: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam::content,
25
+ tool_use_id: String,
26
+ ?cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
27
+ ?type: :bash_code_execution_tool_result
28
+ ) -> void
29
+
30
+ def to_hash: -> {
31
+ content: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam::content,
32
+ tool_use_id: String,
33
+ type: :bash_code_execution_tool_result,
34
+ cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
35
+ }
36
+
37
+ type content =
38
+ Anthropic::Beta::BetaBashCodeExecutionToolResultErrorParam
39
+ | Anthropic::Beta::BetaBashCodeExecutionResultBlockParam
40
+
41
+ module Content
42
+ extend Anthropic::Internal::Type::Union
43
+
44
+ def self?.variants: -> ::Array[Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam::content]
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,48 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaBashCodeExecutionToolResultError = Beta::BetaBashCodeExecutionToolResultError
4
+
5
+ module Beta
6
+ type beta_bash_code_execution_tool_result_error =
7
+ {
8
+ error_code: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultError::error_code,
9
+ type: :bash_code_execution_tool_result_error
10
+ }
11
+
12
+ class BetaBashCodeExecutionToolResultError < Anthropic::Internal::Type::BaseModel
13
+ attr_accessor error_code: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultError::error_code
14
+
15
+ attr_accessor type: :bash_code_execution_tool_result_error
16
+
17
+ def initialize: (
18
+ error_code: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultError::error_code,
19
+ ?type: :bash_code_execution_tool_result_error
20
+ ) -> void
21
+
22
+ def to_hash: -> {
23
+ error_code: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultError::error_code,
24
+ type: :bash_code_execution_tool_result_error
25
+ }
26
+
27
+ type error_code =
28
+ :invalid_tool_input
29
+ | :unavailable
30
+ | :too_many_requests
31
+ | :execution_time_exceeded
32
+ | :output_file_too_large
33
+
34
+ module ErrorCode
35
+ extend Anthropic::Internal::Type::Enum
36
+
37
+ INVALID_TOOL_INPUT: :invalid_tool_input
38
+ UNAVAILABLE: :unavailable
39
+ TOO_MANY_REQUESTS: :too_many_requests
40
+ EXECUTION_TIME_EXCEEDED: :execution_time_exceeded
41
+ OUTPUT_FILE_TOO_LARGE: :output_file_too_large
42
+
43
+ def self?.values: -> ::Array[Anthropic::Models::Beta::BetaBashCodeExecutionToolResultError::error_code]
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,48 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaBashCodeExecutionToolResultErrorParam = Beta::BetaBashCodeExecutionToolResultErrorParam
4
+
5
+ module Beta
6
+ type beta_bash_code_execution_tool_result_error_param =
7
+ {
8
+ error_code: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultErrorParam::error_code,
9
+ type: :bash_code_execution_tool_result_error
10
+ }
11
+
12
+ class BetaBashCodeExecutionToolResultErrorParam < Anthropic::Internal::Type::BaseModel
13
+ attr_accessor error_code: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultErrorParam::error_code
14
+
15
+ attr_accessor type: :bash_code_execution_tool_result_error
16
+
17
+ def initialize: (
18
+ error_code: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultErrorParam::error_code,
19
+ ?type: :bash_code_execution_tool_result_error
20
+ ) -> void
21
+
22
+ def to_hash: -> {
23
+ error_code: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultErrorParam::error_code,
24
+ type: :bash_code_execution_tool_result_error
25
+ }
26
+
27
+ type error_code =
28
+ :invalid_tool_input
29
+ | :unavailable
30
+ | :too_many_requests
31
+ | :execution_time_exceeded
32
+ | :output_file_too_large
33
+
34
+ module ErrorCode
35
+ extend Anthropic::Internal::Type::Enum
36
+
37
+ INVALID_TOOL_INPUT: :invalid_tool_input
38
+ UNAVAILABLE: :unavailable
39
+ TOO_MANY_REQUESTS: :too_many_requests
40
+ EXECUTION_TIME_EXCEEDED: :execution_time_exceeded
41
+ OUTPUT_FILE_TOO_LARGE: :output_file_too_large
42
+
43
+ def self?.values: -> ::Array[Anthropic::Models::Beta::BetaBashCodeExecutionToolResultErrorParam::error_code]
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,34 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaCodeExecutionTool20250825 = Beta::BetaCodeExecutionTool20250825
4
+
5
+ module Beta
6
+ type beta_code_execution_tool20250825 =
7
+ {
8
+ name: :code_execution,
9
+ type: :code_execution_20250825,
10
+ cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
11
+ }
12
+
13
+ class BetaCodeExecutionTool20250825 < Anthropic::Internal::Type::BaseModel
14
+ attr_accessor name: :code_execution
15
+
16
+ attr_accessor type: :code_execution_20250825
17
+
18
+ attr_accessor cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
19
+
20
+ def initialize: (
21
+ ?cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
22
+ ?name: :code_execution,
23
+ ?type: :code_execution_20250825
24
+ ) -> void
25
+
26
+ def to_hash: -> {
27
+ name: :code_execution,
28
+ type: :code_execution_20250825,
29
+ cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
30
+ }
31
+ end
32
+ end
33
+ end
34
+ end
@@ -11,6 +11,8 @@ module Anthropic
11
11
  | Anthropic::Beta::BetaServerToolUseBlock
12
12
  | Anthropic::Beta::BetaWebSearchToolResultBlock
13
13
  | Anthropic::Beta::BetaCodeExecutionToolResultBlock
14
+ | Anthropic::Beta::BetaBashCodeExecutionToolResultBlock
15
+ | Anthropic::Beta::BetaTextEditorCodeExecutionToolResultBlock
14
16
  | Anthropic::Beta::BetaMCPToolUseBlock
15
17
  | Anthropic::Beta::BetaMCPToolResultBlock
16
18
  | Anthropic::Beta::BetaContainerUploadBlock
@@ -15,6 +15,8 @@ module Anthropic
15
15
  | Anthropic::Beta::BetaServerToolUseBlockParam
16
16
  | Anthropic::Beta::BetaWebSearchToolResultBlockParam
17
17
  | Anthropic::Beta::BetaCodeExecutionToolResultBlockParam
18
+ | Anthropic::Beta::BetaBashCodeExecutionToolResultBlockParam
19
+ | Anthropic::Beta::BetaTextEditorCodeExecutionToolResultBlockParam
18
20
  | Anthropic::Beta::BetaMCPToolUseBlockParam
19
21
  | Anthropic::Beta::BetaRequestMCPToolResultBlockParam
20
22
  | Anthropic::Beta::BetaContainerUploadBlockParam
@@ -37,6 +37,8 @@ module Anthropic
37
37
  | Anthropic::Beta::BetaServerToolUseBlock
38
38
  | Anthropic::Beta::BetaWebSearchToolResultBlock
39
39
  | Anthropic::Beta::BetaCodeExecutionToolResultBlock
40
+ | Anthropic::Beta::BetaBashCodeExecutionToolResultBlock
41
+ | Anthropic::Beta::BetaTextEditorCodeExecutionToolResultBlock
40
42
  | Anthropic::Beta::BetaMCPToolUseBlock
41
43
  | Anthropic::Beta::BetaMCPToolResultBlock
42
44
  | Anthropic::Beta::BetaContainerUploadBlock
@@ -34,13 +34,19 @@ module Anthropic
34
34
  type: :server_tool_use
35
35
  }
36
36
 
37
- type name_ = :web_search | :code_execution
37
+ type name_ =
38
+ :web_search
39
+ | :code_execution
40
+ | :bash_code_execution
41
+ | :text_editor_code_execution
38
42
 
39
43
  module Name
40
44
  extend Anthropic::Internal::Type::Enum
41
45
 
42
46
  WEB_SEARCH: :web_search
43
47
  CODE_EXECUTION: :code_execution
48
+ BASH_CODE_EXECUTION: :bash_code_execution
49
+ TEXT_EDITOR_CODE_EXECUTION: :text_editor_code_execution
44
50
 
45
51
  def self?.values: -> ::Array[Anthropic::Models::Beta::BetaServerToolUseBlock::name_]
46
52
  end
@@ -39,13 +39,19 @@ module Anthropic
39
39
  cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
40
40
  }
41
41
 
42
- type name_ = :web_search | :code_execution
42
+ type name_ =
43
+ :web_search
44
+ | :code_execution
45
+ | :bash_code_execution
46
+ | :text_editor_code_execution
43
47
 
44
48
  module Name
45
49
  extend Anthropic::Internal::Type::Enum
46
50
 
47
51
  WEB_SEARCH: :web_search
48
52
  CODE_EXECUTION: :code_execution
53
+ BASH_CODE_EXECUTION: :bash_code_execution
54
+ TEXT_EDITOR_CODE_EXECUTION: :text_editor_code_execution
49
55
 
50
56
  def self?.values: -> ::Array[Anthropic::Models::Beta::BetaServerToolUseBlockParam::name_]
51
57
  end
@@ -0,0 +1,29 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaTextEditorCodeExecutionCreateResultBlock = Beta::BetaTextEditorCodeExecutionCreateResultBlock
4
+
5
+ module Beta
6
+ type beta_text_editor_code_execution_create_result_block =
7
+ {
8
+ is_file_update: bool,
9
+ type: :text_editor_code_execution_create_result
10
+ }
11
+
12
+ class BetaTextEditorCodeExecutionCreateResultBlock < Anthropic::Internal::Type::BaseModel
13
+ attr_accessor is_file_update: bool
14
+
15
+ attr_accessor type: :text_editor_code_execution_create_result
16
+
17
+ def initialize: (
18
+ is_file_update: bool,
19
+ ?type: :text_editor_code_execution_create_result
20
+ ) -> void
21
+
22
+ def to_hash: -> {
23
+ is_file_update: bool,
24
+ type: :text_editor_code_execution_create_result
25
+ }
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,29 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaTextEditorCodeExecutionCreateResultBlockParam = Beta::BetaTextEditorCodeExecutionCreateResultBlockParam
4
+
5
+ module Beta
6
+ type beta_text_editor_code_execution_create_result_block_param =
7
+ {
8
+ is_file_update: bool,
9
+ type: :text_editor_code_execution_create_result
10
+ }
11
+
12
+ class BetaTextEditorCodeExecutionCreateResultBlockParam < Anthropic::Internal::Type::BaseModel
13
+ attr_accessor is_file_update: bool
14
+
15
+ attr_accessor type: :text_editor_code_execution_create_result
16
+
17
+ def initialize: (
18
+ is_file_update: bool,
19
+ ?type: :text_editor_code_execution_create_result
20
+ ) -> void
21
+
22
+ def to_hash: -> {
23
+ is_file_update: bool,
24
+ type: :text_editor_code_execution_create_result
25
+ }
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,49 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaTextEditorCodeExecutionStrReplaceResultBlock = Beta::BetaTextEditorCodeExecutionStrReplaceResultBlock
4
+
5
+ module Beta
6
+ type beta_text_editor_code_execution_str_replace_result_block =
7
+ {
8
+ lines: ::Array[String]?,
9
+ new_lines: Integer?,
10
+ new_start: Integer?,
11
+ old_lines: Integer?,
12
+ old_start: Integer?,
13
+ type: :text_editor_code_execution_str_replace_result
14
+ }
15
+
16
+ class BetaTextEditorCodeExecutionStrReplaceResultBlock < Anthropic::Internal::Type::BaseModel
17
+ attr_accessor lines: ::Array[String]?
18
+
19
+ attr_accessor new_lines: Integer?
20
+
21
+ attr_accessor new_start: Integer?
22
+
23
+ attr_accessor old_lines: Integer?
24
+
25
+ attr_accessor old_start: Integer?
26
+
27
+ attr_accessor type: :text_editor_code_execution_str_replace_result
28
+
29
+ def initialize: (
30
+ lines: ::Array[String]?,
31
+ new_lines: Integer?,
32
+ new_start: Integer?,
33
+ old_lines: Integer?,
34
+ old_start: Integer?,
35
+ ?type: :text_editor_code_execution_str_replace_result
36
+ ) -> void
37
+
38
+ def to_hash: -> {
39
+ lines: ::Array[String]?,
40
+ new_lines: Integer?,
41
+ new_start: Integer?,
42
+ old_lines: Integer?,
43
+ old_start: Integer?,
44
+ type: :text_editor_code_execution_str_replace_result
45
+ }
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,49 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaTextEditorCodeExecutionStrReplaceResultBlockParam = Beta::BetaTextEditorCodeExecutionStrReplaceResultBlockParam
4
+
5
+ module Beta
6
+ type beta_text_editor_code_execution_str_replace_result_block_param =
7
+ {
8
+ type: :text_editor_code_execution_str_replace_result,
9
+ lines: ::Array[String]?,
10
+ new_lines: Integer?,
11
+ new_start: Integer?,
12
+ old_lines: Integer?,
13
+ old_start: Integer?
14
+ }
15
+
16
+ class BetaTextEditorCodeExecutionStrReplaceResultBlockParam < Anthropic::Internal::Type::BaseModel
17
+ attr_accessor type: :text_editor_code_execution_str_replace_result
18
+
19
+ attr_accessor lines: ::Array[String]?
20
+
21
+ attr_accessor new_lines: Integer?
22
+
23
+ attr_accessor new_start: Integer?
24
+
25
+ attr_accessor old_lines: Integer?
26
+
27
+ attr_accessor old_start: Integer?
28
+
29
+ def initialize: (
30
+ ?lines: ::Array[String]?,
31
+ ?new_lines: Integer?,
32
+ ?new_start: Integer?,
33
+ ?old_lines: Integer?,
34
+ ?old_start: Integer?,
35
+ ?type: :text_editor_code_execution_str_replace_result
36
+ ) -> void
37
+
38
+ def to_hash: -> {
39
+ type: :text_editor_code_execution_str_replace_result,
40
+ lines: ::Array[String]?,
41
+ new_lines: Integer?,
42
+ new_start: Integer?,
43
+ old_lines: Integer?,
44
+ old_start: Integer?
45
+ }
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,46 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaTextEditorCodeExecutionToolResultBlock = Beta::BetaTextEditorCodeExecutionToolResultBlock
4
+
5
+ module Beta
6
+ type beta_text_editor_code_execution_tool_result_block =
7
+ {
8
+ content: Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock::content,
9
+ tool_use_id: String,
10
+ type: :text_editor_code_execution_tool_result
11
+ }
12
+
13
+ class BetaTextEditorCodeExecutionToolResultBlock < Anthropic::Internal::Type::BaseModel
14
+ attr_accessor content: Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock::content
15
+
16
+ attr_accessor tool_use_id: String
17
+
18
+ attr_accessor type: :text_editor_code_execution_tool_result
19
+
20
+ def initialize: (
21
+ content: Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock::content,
22
+ tool_use_id: String,
23
+ ?type: :text_editor_code_execution_tool_result
24
+ ) -> void
25
+
26
+ def to_hash: -> {
27
+ content: Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock::content,
28
+ tool_use_id: String,
29
+ type: :text_editor_code_execution_tool_result
30
+ }
31
+
32
+ type content =
33
+ Anthropic::Beta::BetaTextEditorCodeExecutionToolResultError
34
+ | Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlock
35
+ | Anthropic::Beta::BetaTextEditorCodeExecutionCreateResultBlock
36
+ | Anthropic::Beta::BetaTextEditorCodeExecutionStrReplaceResultBlock
37
+
38
+ module Content
39
+ extend Anthropic::Internal::Type::Union
40
+
41
+ def self?.variants: -> ::Array[Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock::content]
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,51 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaTextEditorCodeExecutionToolResultBlockParam = Beta::BetaTextEditorCodeExecutionToolResultBlockParam
4
+
5
+ module Beta
6
+ type beta_text_editor_code_execution_tool_result_block_param =
7
+ {
8
+ content: Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam::content,
9
+ tool_use_id: String,
10
+ type: :text_editor_code_execution_tool_result,
11
+ cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
12
+ }
13
+
14
+ class BetaTextEditorCodeExecutionToolResultBlockParam < Anthropic::Internal::Type::BaseModel
15
+ attr_accessor content: Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam::content
16
+
17
+ attr_accessor tool_use_id: String
18
+
19
+ attr_accessor type: :text_editor_code_execution_tool_result
20
+
21
+ attr_accessor cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
22
+
23
+ def initialize: (
24
+ content: Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam::content,
25
+ tool_use_id: String,
26
+ ?cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
27
+ ?type: :text_editor_code_execution_tool_result
28
+ ) -> void
29
+
30
+ def to_hash: -> {
31
+ content: Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam::content,
32
+ tool_use_id: String,
33
+ type: :text_editor_code_execution_tool_result,
34
+ cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
35
+ }
36
+
37
+ type content =
38
+ Anthropic::Beta::BetaTextEditorCodeExecutionToolResultErrorParam
39
+ | Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlockParam
40
+ | Anthropic::Beta::BetaTextEditorCodeExecutionCreateResultBlockParam
41
+ | Anthropic::Beta::BetaTextEditorCodeExecutionStrReplaceResultBlockParam
42
+
43
+ module Content
44
+ extend Anthropic::Internal::Type::Union
45
+
46
+ def self?.variants: -> ::Array[Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam::content]
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,53 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaTextEditorCodeExecutionToolResultError = Beta::BetaTextEditorCodeExecutionToolResultError
4
+
5
+ module Beta
6
+ type beta_text_editor_code_execution_tool_result_error =
7
+ {
8
+ error_code: Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultError::error_code,
9
+ error_message: String?,
10
+ type: :text_editor_code_execution_tool_result_error
11
+ }
12
+
13
+ class BetaTextEditorCodeExecutionToolResultError < Anthropic::Internal::Type::BaseModel
14
+ attr_accessor error_code: Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultError::error_code
15
+
16
+ attr_accessor error_message: String?
17
+
18
+ attr_accessor type: :text_editor_code_execution_tool_result_error
19
+
20
+ def initialize: (
21
+ error_code: Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultError::error_code,
22
+ error_message: String?,
23
+ ?type: :text_editor_code_execution_tool_result_error
24
+ ) -> void
25
+
26
+ def to_hash: -> {
27
+ error_code: Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultError::error_code,
28
+ error_message: String?,
29
+ type: :text_editor_code_execution_tool_result_error
30
+ }
31
+
32
+ type error_code =
33
+ :invalid_tool_input
34
+ | :unavailable
35
+ | :too_many_requests
36
+ | :execution_time_exceeded
37
+ | :file_not_found
38
+
39
+ module ErrorCode
40
+ extend Anthropic::Internal::Type::Enum
41
+
42
+ INVALID_TOOL_INPUT: :invalid_tool_input
43
+ UNAVAILABLE: :unavailable
44
+ TOO_MANY_REQUESTS: :too_many_requests
45
+ EXECUTION_TIME_EXCEEDED: :execution_time_exceeded
46
+ FILE_NOT_FOUND: :file_not_found
47
+
48
+ def self?.values: -> ::Array[Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultError::error_code]
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end