anthropic 1.7.0 → 1.9.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 (179) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +34 -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 +2 -2
  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_citation_config.rb +19 -0
  29. data/lib/anthropic/models/beta/beta_code_execution_tool_20250825.rb +40 -0
  30. data/lib/anthropic/models/beta/beta_content_block.rb +8 -1
  31. data/lib/anthropic/models/beta/beta_content_block_param.rb +9 -1
  32. data/lib/anthropic/models/beta/beta_document_block.rb +56 -0
  33. data/lib/anthropic/models/beta/beta_message.rb +2 -2
  34. data/lib/anthropic/models/beta/beta_message_param.rb +3 -3
  35. data/lib/anthropic/models/beta/beta_raw_content_block_start_event.rb +10 -3
  36. data/lib/anthropic/models/beta/beta_request_document_block.rb +2 -2
  37. data/lib/anthropic/models/beta/beta_server_tool_usage.rb +9 -1
  38. data/lib/anthropic/models/beta/beta_server_tool_use_block.rb +3 -0
  39. data/lib/anthropic/models/beta/beta_server_tool_use_block_param.rb +3 -0
  40. data/lib/anthropic/models/beta/beta_text_editor_code_execution_create_result_block.rb +25 -0
  41. data/lib/anthropic/models/beta/beta_text_editor_code_execution_create_result_block_param.rb +26 -0
  42. data/lib/anthropic/models/beta/beta_text_editor_code_execution_str_replace_result_block.rb +49 -0
  43. data/lib/anthropic/models/beta/beta_text_editor_code_execution_str_replace_result_block_param.rb +50 -0
  44. data/lib/anthropic/models/beta/beta_text_editor_code_execution_tool_result_block.rb +47 -0
  45. data/lib/anthropic/models/beta/beta_text_editor_code_execution_tool_result_block_param.rb +57 -0
  46. data/lib/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error.rb +45 -0
  47. data/lib/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error_param.rb +46 -0
  48. data/lib/anthropic/models/beta/beta_text_editor_code_execution_view_result_block.rb +61 -0
  49. data/lib/anthropic/models/beta/beta_text_editor_code_execution_view_result_block_param.rb +62 -0
  50. data/lib/anthropic/models/beta/beta_tool_result_block_param.rb +6 -4
  51. data/lib/anthropic/models/beta/beta_tool_union.rb +5 -1
  52. data/lib/anthropic/models/beta/beta_web_fetch_block.rb +42 -0
  53. data/lib/anthropic/models/beta/beta_web_fetch_block_param.rb +42 -0
  54. data/lib/anthropic/models/beta/beta_web_fetch_tool_20250910.rb +82 -0
  55. data/lib/anthropic/models/beta/beta_web_fetch_tool_result_block.rb +43 -0
  56. data/lib/anthropic/models/beta/beta_web_fetch_tool_result_block_param.rb +53 -0
  57. data/lib/anthropic/models/beta/beta_web_fetch_tool_result_error_block.rb +25 -0
  58. data/lib/anthropic/models/beta/beta_web_fetch_tool_result_error_block_param.rb +25 -0
  59. data/lib/anthropic/models/beta/beta_web_fetch_tool_result_error_code.rb +25 -0
  60. data/lib/anthropic/models/beta/message_count_tokens_params.rb +9 -30
  61. data/lib/anthropic/models/beta/message_create_params.rb +3 -26
  62. data/lib/anthropic/models/beta/messages/batch_create_params.rb +6 -36
  63. data/lib/anthropic/models/beta/messages/beta_message_batch.rb +1 -4
  64. data/lib/anthropic/models/beta_error_response.rb +7 -1
  65. data/lib/anthropic/models/document_block_param.rb +2 -2
  66. data/lib/anthropic/models/error_response.rb +7 -1
  67. data/lib/anthropic/models/message_count_tokens_params.rb +1 -24
  68. data/lib/anthropic/models/message_create_params.rb +1 -24
  69. data/lib/anthropic/models/messages/batch_create_params.rb +2 -28
  70. data/lib/anthropic/models/tool_result_block_param.rb +6 -4
  71. data/lib/anthropic/models/tool_use_block.rb +8 -0
  72. data/lib/anthropic/resources/beta/messages.rb +3 -3
  73. data/lib/anthropic/resources/messages.rb +85 -1
  74. data/lib/anthropic/version.rb +1 -1
  75. data/lib/anthropic.rb +39 -0
  76. data/rbi/anthropic/errors.rbi +2 -2
  77. data/rbi/anthropic/helpers/input_schema/array_of.rbi +16 -0
  78. data/rbi/anthropic/helpers/input_schema/base_model.rbi +21 -0
  79. data/rbi/anthropic/helpers/input_schema/boolean.rbi +11 -0
  80. data/rbi/anthropic/helpers/input_schema/enum_of.rbi +30 -0
  81. data/rbi/anthropic/helpers/input_schema/json_schema_converter.rbi +89 -0
  82. data/rbi/anthropic/helpers/input_schema/union_of.rbi +23 -0
  83. data/rbi/anthropic/helpers/structured_output.rbi +16 -0
  84. data/rbi/anthropic/input_schema.rbi +12 -0
  85. data/rbi/anthropic/models/beta/beta_bash_code_execution_output_block.rbi +33 -0
  86. data/rbi/anthropic/models/beta/beta_bash_code_execution_output_block_param.rbi +34 -0
  87. data/rbi/anthropic/models/beta/beta_bash_code_execution_result_block.rbi +72 -0
  88. data/rbi/anthropic/models/beta/beta_bash_code_execution_result_block_param.rbi +77 -0
  89. data/rbi/anthropic/models/beta/beta_bash_code_execution_tool_result_block.rbi +86 -0
  90. data/rbi/anthropic/models/beta/beta_bash_code_execution_tool_result_block_param.rbi +110 -0
  91. data/rbi/anthropic/models/beta/beta_bash_code_execution_tool_result_error.rbi +101 -0
  92. data/rbi/anthropic/models/beta/beta_bash_code_execution_tool_result_error_param.rbi +101 -0
  93. data/rbi/anthropic/models/beta/beta_citation_config.rbi +30 -0
  94. data/rbi/anthropic/models/beta/beta_code_execution_tool_20250825.rbi +72 -0
  95. data/rbi/anthropic/models/beta/beta_content_block.rbi +3 -0
  96. data/rbi/anthropic/models/beta/beta_content_block_param.rbi +3 -0
  97. data/rbi/anthropic/models/beta/beta_document_block.rbi +95 -0
  98. data/rbi/anthropic/models/beta/beta_message.rbi +3 -0
  99. data/rbi/anthropic/models/beta/beta_raw_content_block_start_event.rbi +6 -0
  100. data/rbi/anthropic/models/beta/beta_request_document_block.rbi +5 -3
  101. data/rbi/anthropic/models/beta/beta_server_tool_usage.rbi +17 -2
  102. data/rbi/anthropic/models/beta/beta_server_tool_use_block.rbi +15 -0
  103. data/rbi/anthropic/models/beta/beta_server_tool_use_block_param.rbi +15 -0
  104. data/rbi/anthropic/models/beta/beta_text_editor_code_execution_create_result_block.rbi +41 -0
  105. data/rbi/anthropic/models/beta/beta_text_editor_code_execution_create_result_block_param.rbi +41 -0
  106. data/rbi/anthropic/models/beta/beta_text_editor_code_execution_str_replace_result_block.rbi +73 -0
  107. data/rbi/anthropic/models/beta/beta_text_editor_code_execution_str_replace_result_block_param.rbi +73 -0
  108. data/rbi/anthropic/models/beta/beta_text_editor_code_execution_tool_result_block.rbi +90 -0
  109. data/rbi/anthropic/models/beta/beta_text_editor_code_execution_tool_result_block_param.rbi +118 -0
  110. data/rbi/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error.rbi +110 -0
  111. data/rbi/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error_param.rbi +110 -0
  112. data/rbi/anthropic/models/beta/beta_text_editor_code_execution_view_result_block.rbi +118 -0
  113. data/rbi/anthropic/models/beta/beta_text_editor_code_execution_view_result_block_param.rbi +118 -0
  114. data/rbi/anthropic/models/beta/beta_tool_result_block_param.rbi +2 -1
  115. data/rbi/anthropic/models/beta/beta_tool_union.rbi +3 -1
  116. data/rbi/anthropic/models/beta/beta_web_fetch_block.rbi +67 -0
  117. data/rbi/anthropic/models/beta/beta_web_fetch_block_param.rbi +71 -0
  118. data/rbi/anthropic/models/beta/beta_web_fetch_tool_20250910.rbi +125 -0
  119. data/rbi/anthropic/models/beta/beta_web_fetch_tool_result_block.rbi +81 -0
  120. data/rbi/anthropic/models/beta/beta_web_fetch_tool_result_block_param.rbi +109 -0
  121. data/rbi/anthropic/models/beta/beta_web_fetch_tool_result_error_block.rbi +51 -0
  122. data/rbi/anthropic/models/beta/beta_web_fetch_tool_result_error_block_param.rbi +50 -0
  123. data/rbi/anthropic/models/beta/beta_web_fetch_tool_result_error_code.rbi +70 -0
  124. data/rbi/anthropic/models/beta/message_count_tokens_params.rbi +17 -53
  125. data/rbi/anthropic/models/beta/message_create_params.rbi +14 -52
  126. data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +14 -52
  127. data/rbi/anthropic/models/beta_error_response.rbi +10 -2
  128. data/rbi/anthropic/models/document_block_param.rbi +7 -3
  129. data/rbi/anthropic/models/error_response.rbi +10 -2
  130. data/rbi/anthropic/models/message_count_tokens_params.rbi +2 -48
  131. data/rbi/anthropic/models/message_create_params.rbi +2 -48
  132. data/rbi/anthropic/models/messages/batch_create_params.rbi +2 -48
  133. data/rbi/anthropic/models/tool_result_block_param.rbi +2 -1
  134. data/rbi/anthropic/resources/beta/messages.rbi +12 -75
  135. data/rbi/anthropic/resources/messages.rbi +3 -72
  136. data/sig/anthropic/models/beta/beta_bash_code_execution_output_block.rbs +23 -0
  137. data/sig/anthropic/models/beta/beta_bash_code_execution_output_block_param.rbs +23 -0
  138. data/sig/anthropic/models/beta/beta_bash_code_execution_result_block.rbs +44 -0
  139. data/sig/anthropic/models/beta/beta_bash_code_execution_result_block_param.rbs +44 -0
  140. data/sig/anthropic/models/beta/beta_bash_code_execution_tool_result_block.rbs +44 -0
  141. data/sig/anthropic/models/beta/beta_bash_code_execution_tool_result_block_param.rbs +49 -0
  142. data/sig/anthropic/models/beta/beta_bash_code_execution_tool_result_error.rbs +48 -0
  143. data/sig/anthropic/models/beta/beta_bash_code_execution_tool_result_error_param.rbs +48 -0
  144. data/sig/anthropic/models/beta/beta_citation_config.rbs +17 -0
  145. data/sig/anthropic/models/beta/beta_code_execution_tool_20250825.rbs +34 -0
  146. data/sig/anthropic/models/beta/beta_content_block.rbs +3 -0
  147. data/sig/anthropic/models/beta/beta_content_block_param.rbs +3 -0
  148. data/sig/anthropic/models/beta/beta_document_block.rbs +49 -0
  149. data/sig/anthropic/models/beta/beta_raw_content_block_start_event.rbs +3 -0
  150. data/sig/anthropic/models/beta/beta_request_document_block.rbs +4 -8
  151. data/sig/anthropic/models/beta/beta_server_tool_usage.rbs +12 -3
  152. data/sig/anthropic/models/beta/beta_server_tool_use_block.rbs +9 -1
  153. data/sig/anthropic/models/beta/beta_server_tool_use_block_param.rbs +9 -1
  154. data/sig/anthropic/models/beta/beta_text_editor_code_execution_create_result_block.rbs +29 -0
  155. data/sig/anthropic/models/beta/beta_text_editor_code_execution_create_result_block_param.rbs +29 -0
  156. data/sig/anthropic/models/beta/beta_text_editor_code_execution_str_replace_result_block.rbs +49 -0
  157. data/sig/anthropic/models/beta/beta_text_editor_code_execution_str_replace_result_block_param.rbs +49 -0
  158. data/sig/anthropic/models/beta/beta_text_editor_code_execution_tool_result_block.rbs +46 -0
  159. data/sig/anthropic/models/beta/beta_text_editor_code_execution_tool_result_block_param.rbs +51 -0
  160. data/sig/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error.rbs +53 -0
  161. data/sig/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error_param.rbs +53 -0
  162. data/sig/anthropic/models/beta/beta_text_editor_code_execution_view_result_block.rbs +61 -0
  163. data/sig/anthropic/models/beta/beta_text_editor_code_execution_view_result_block_param.rbs +61 -0
  164. data/sig/anthropic/models/beta/beta_tool_result_block_param.rbs +1 -0
  165. data/sig/anthropic/models/beta/beta_tool_union.rbs +2 -0
  166. data/sig/anthropic/models/beta/beta_web_fetch_block.rbs +39 -0
  167. data/sig/anthropic/models/beta/beta_web_fetch_block_param.rbs +39 -0
  168. data/sig/anthropic/models/beta/beta_web_fetch_tool_20250910.rbs +59 -0
  169. data/sig/anthropic/models/beta/beta_web_fetch_tool_result_block.rbs +44 -0
  170. data/sig/anthropic/models/beta/beta_web_fetch_tool_result_block_param.rbs +49 -0
  171. data/sig/anthropic/models/beta/beta_web_fetch_tool_result_error_block.rbs +29 -0
  172. data/sig/anthropic/models/beta/beta_web_fetch_tool_result_error_block_param.rbs +29 -0
  173. data/sig/anthropic/models/beta/beta_web_fetch_tool_result_error_code.rbs +32 -0
  174. data/sig/anthropic/models/beta/message_count_tokens_params.rbs +2 -0
  175. data/sig/anthropic/models/beta_error_response.rbs +13 -2
  176. data/sig/anthropic/models/document_block_param.rbs +4 -8
  177. data/sig/anthropic/models/error_response.rbs +13 -2
  178. data/sig/anthropic/models/tool_result_block_param.rbs +1 -0
  179. metadata +107 -2
@@ -56,7 +56,7 @@ 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::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
62
  # @!attribute model
@@ -140,7 +140,7 @@ module Anthropic
140
140
  #
141
141
  # @param container [Anthropic::Models::Beta::BetaContainer, nil] Information about the container used in the request (for the code execution tool
142
142
  #
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::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock>] Content generated by the model.
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::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.
144
144
  #
145
145
  # @param model [Symbol, String, Anthropic::Models::Model] The model that will complete your prompt.\n\nSee [models](https://docs.anthropic
146
146
  #
@@ -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::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::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::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 =
@@ -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::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::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,8 +47,15 @@ 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
 
54
+ variant :bash_code_execution_tool_result, -> { Anthropic::Beta::BetaBashCodeExecutionToolResultBlock }
55
+
56
+ variant :text_editor_code_execution_tool_result,
57
+ -> { Anthropic::Beta::BetaTextEditorCodeExecutionToolResultBlock }
58
+
52
59
  variant :mcp_tool_use, -> { Anthropic::Beta::BetaMCPToolUseBlock }
53
60
 
54
61
  variant :mcp_tool_result, -> { Anthropic::Beta::BetaMCPToolResultBlock }
@@ -57,7 +64,7 @@ module Anthropic
57
64
  variant :container_upload, -> { Anthropic::Beta::BetaContainerUploadBlock }
58
65
 
59
66
  # @!method self.variants
60
- # @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::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)]
61
68
  end
62
69
  end
63
70
  end
@@ -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
  #
@@ -4,13 +4,21 @@ module Anthropic
4
4
  module Models
5
5
  module Beta
6
6
  class BetaServerToolUsage < Anthropic::Internal::Type::BaseModel
7
+ # @!attribute web_fetch_requests
8
+ # The number of web fetch tool requests.
9
+ #
10
+ # @return [Integer]
11
+ required :web_fetch_requests, Integer
12
+
7
13
  # @!attribute web_search_requests
8
14
  # The number of web search tool requests.
9
15
  #
10
16
  # @return [Integer]
11
17
  required :web_search_requests, Integer
12
18
 
13
- # @!method initialize(web_search_requests:)
19
+ # @!method initialize(web_fetch_requests:, web_search_requests:)
20
+ # @param web_fetch_requests [Integer] The number of web fetch tool requests.
21
+ #
14
22
  # @param web_search_requests [Integer] The number of web search tool requests.
15
23
  end
16
24
  end
@@ -35,7 +35,10 @@ module Anthropic
35
35
  extend Anthropic::Internal::Type::Enum
36
36
 
37
37
  WEB_SEARCH = :web_search
38
+ WEB_FETCH = :web_fetch
38
39
  CODE_EXECUTION = :code_execution
40
+ BASH_CODE_EXECUTION = :bash_code_execution
41
+ TEXT_EDITOR_CODE_EXECUTION = :text_editor_code_execution
39
42
 
40
43
  # @!method self.values
41
44
  # @return [Array<Symbol>]
@@ -46,7 +46,10 @@ module Anthropic
46
46
  extend Anthropic::Internal::Type::Enum
47
47
 
48
48
  WEB_SEARCH = :web_search
49
+ WEB_FETCH = :web_fetch
49
50
  CODE_EXECUTION = :code_execution
51
+ BASH_CODE_EXECUTION = :bash_code_execution
52
+ TEXT_EDITOR_CODE_EXECUTION = :text_editor_code_execution
50
53
 
51
54
  # @!method self.values
52
55
  # @return [Array<Symbol>]
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ class BetaTextEditorCodeExecutionCreateResultBlock < Anthropic::Internal::Type::BaseModel
7
+ # @!attribute is_file_update
8
+ #
9
+ # @return [Boolean]
10
+ required :is_file_update, Anthropic::Internal::Type::Boolean
11
+
12
+ # @!attribute type
13
+ #
14
+ # @return [Symbol, :text_editor_code_execution_create_result]
15
+ required :type, const: :text_editor_code_execution_create_result
16
+
17
+ # @!method initialize(is_file_update:, type: :text_editor_code_execution_create_result)
18
+ # @param is_file_update [Boolean]
19
+ # @param type [Symbol, :text_editor_code_execution_create_result]
20
+ end
21
+ end
22
+
23
+ BetaTextEditorCodeExecutionCreateResultBlock = Beta::BetaTextEditorCodeExecutionCreateResultBlock
24
+ end
25
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ class BetaTextEditorCodeExecutionCreateResultBlockParam < Anthropic::Internal::Type::BaseModel
7
+ # @!attribute is_file_update
8
+ #
9
+ # @return [Boolean]
10
+ required :is_file_update, Anthropic::Internal::Type::Boolean
11
+
12
+ # @!attribute type
13
+ #
14
+ # @return [Symbol, :text_editor_code_execution_create_result]
15
+ required :type, const: :text_editor_code_execution_create_result
16
+
17
+ # @!method initialize(is_file_update:, type: :text_editor_code_execution_create_result)
18
+ # @param is_file_update [Boolean]
19
+ # @param type [Symbol, :text_editor_code_execution_create_result]
20
+ end
21
+ end
22
+
23
+ BetaTextEditorCodeExecutionCreateResultBlockParam =
24
+ Beta::BetaTextEditorCodeExecutionCreateResultBlockParam
25
+ end
26
+ end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ class BetaTextEditorCodeExecutionStrReplaceResultBlock < Anthropic::Internal::Type::BaseModel
7
+ # @!attribute lines
8
+ #
9
+ # @return [Array<String>, nil]
10
+ required :lines, Anthropic::Internal::Type::ArrayOf[String], nil?: true
11
+
12
+ # @!attribute new_lines
13
+ #
14
+ # @return [Integer, nil]
15
+ required :new_lines, Integer, nil?: true
16
+
17
+ # @!attribute new_start
18
+ #
19
+ # @return [Integer, nil]
20
+ required :new_start, Integer, nil?: true
21
+
22
+ # @!attribute old_lines
23
+ #
24
+ # @return [Integer, nil]
25
+ required :old_lines, Integer, nil?: true
26
+
27
+ # @!attribute old_start
28
+ #
29
+ # @return [Integer, nil]
30
+ required :old_start, Integer, nil?: true
31
+
32
+ # @!attribute type
33
+ #
34
+ # @return [Symbol, :text_editor_code_execution_str_replace_result]
35
+ required :type, const: :text_editor_code_execution_str_replace_result
36
+
37
+ # @!method initialize(lines:, new_lines:, new_start:, old_lines:, old_start:, type: :text_editor_code_execution_str_replace_result)
38
+ # @param lines [Array<String>, nil]
39
+ # @param new_lines [Integer, nil]
40
+ # @param new_start [Integer, nil]
41
+ # @param old_lines [Integer, nil]
42
+ # @param old_start [Integer, nil]
43
+ # @param type [Symbol, :text_editor_code_execution_str_replace_result]
44
+ end
45
+ end
46
+
47
+ BetaTextEditorCodeExecutionStrReplaceResultBlock = Beta::BetaTextEditorCodeExecutionStrReplaceResultBlock
48
+ end
49
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ class BetaTextEditorCodeExecutionStrReplaceResultBlockParam < Anthropic::Internal::Type::BaseModel
7
+ # @!attribute type
8
+ #
9
+ # @return [Symbol, :text_editor_code_execution_str_replace_result]
10
+ required :type, const: :text_editor_code_execution_str_replace_result
11
+
12
+ # @!attribute lines
13
+ #
14
+ # @return [Array<String>, nil]
15
+ optional :lines, Anthropic::Internal::Type::ArrayOf[String], nil?: true
16
+
17
+ # @!attribute new_lines
18
+ #
19
+ # @return [Integer, nil]
20
+ optional :new_lines, Integer, nil?: true
21
+
22
+ # @!attribute new_start
23
+ #
24
+ # @return [Integer, nil]
25
+ optional :new_start, Integer, nil?: true
26
+
27
+ # @!attribute old_lines
28
+ #
29
+ # @return [Integer, nil]
30
+ optional :old_lines, Integer, nil?: true
31
+
32
+ # @!attribute old_start
33
+ #
34
+ # @return [Integer, nil]
35
+ optional :old_start, Integer, nil?: true
36
+
37
+ # @!method initialize(lines: nil, new_lines: nil, new_start: nil, old_lines: nil, old_start: nil, type: :text_editor_code_execution_str_replace_result)
38
+ # @param lines [Array<String>, nil]
39
+ # @param new_lines [Integer, nil]
40
+ # @param new_start [Integer, nil]
41
+ # @param old_lines [Integer, nil]
42
+ # @param old_start [Integer, nil]
43
+ # @param type [Symbol, :text_editor_code_execution_str_replace_result]
44
+ end
45
+ end
46
+
47
+ BetaTextEditorCodeExecutionStrReplaceResultBlockParam =
48
+ Beta::BetaTextEditorCodeExecutionStrReplaceResultBlockParam
49
+ end
50
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ class BetaTextEditorCodeExecutionToolResultBlock < Anthropic::Internal::Type::BaseModel
7
+ # @!attribute content
8
+ #
9
+ # @return [Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultError, Anthropic::Models::Beta::BetaTextEditorCodeExecutionViewResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionCreateResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionStrReplaceResultBlock]
10
+ required :content, union: -> { Anthropic::Beta::BetaTextEditorCodeExecutionToolResultBlock::Content }
11
+
12
+ # @!attribute tool_use_id
13
+ #
14
+ # @return [String]
15
+ required :tool_use_id, String
16
+
17
+ # @!attribute type
18
+ #
19
+ # @return [Symbol, :text_editor_code_execution_tool_result]
20
+ required :type, const: :text_editor_code_execution_tool_result
21
+
22
+ # @!method initialize(content:, tool_use_id:, type: :text_editor_code_execution_tool_result)
23
+ # @param content [Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultError, Anthropic::Models::Beta::BetaTextEditorCodeExecutionViewResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionCreateResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionStrReplaceResultBlock]
24
+ # @param tool_use_id [String]
25
+ # @param type [Symbol, :text_editor_code_execution_tool_result]
26
+
27
+ # @see Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock#content
28
+ module Content
29
+ extend Anthropic::Internal::Type::Union
30
+
31
+ variant -> { Anthropic::Beta::BetaTextEditorCodeExecutionToolResultError }
32
+
33
+ variant -> { Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlock }
34
+
35
+ variant -> { Anthropic::Beta::BetaTextEditorCodeExecutionCreateResultBlock }
36
+
37
+ variant -> { Anthropic::Beta::BetaTextEditorCodeExecutionStrReplaceResultBlock }
38
+
39
+ # @!method self.variants
40
+ # @return [Array(Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultError, Anthropic::Models::Beta::BetaTextEditorCodeExecutionViewResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionCreateResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionStrReplaceResultBlock)]
41
+ end
42
+ end
43
+ end
44
+
45
+ BetaTextEditorCodeExecutionToolResultBlock = Beta::BetaTextEditorCodeExecutionToolResultBlock
46
+ end
47
+ end
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ class BetaTextEditorCodeExecutionToolResultBlockParam < Anthropic::Internal::Type::BaseModel
7
+ # @!attribute content
8
+ #
9
+ # @return [Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultErrorParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionViewResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionCreateResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionStrReplaceResultBlockParam]
10
+ required :content, union: -> { Anthropic::Beta::BetaTextEditorCodeExecutionToolResultBlockParam::Content }
11
+
12
+ # @!attribute tool_use_id
13
+ #
14
+ # @return [String]
15
+ required :tool_use_id, String
16
+
17
+ # @!attribute type
18
+ #
19
+ # @return [Symbol, :text_editor_code_execution_tool_result]
20
+ required :type, const: :text_editor_code_execution_tool_result
21
+
22
+ # @!attribute cache_control
23
+ # Create a cache control breakpoint at this content block.
24
+ #
25
+ # @return [Anthropic::Models::Beta::BetaCacheControlEphemeral, nil]
26
+ optional :cache_control, -> { Anthropic::Beta::BetaCacheControlEphemeral }, nil?: true
27
+
28
+ # @!method initialize(content:, tool_use_id:, cache_control: nil, type: :text_editor_code_execution_tool_result)
29
+ # @param content [Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultErrorParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionViewResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionCreateResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionStrReplaceResultBlockParam]
30
+ #
31
+ # @param tool_use_id [String]
32
+ #
33
+ # @param cache_control [Anthropic::Models::Beta::BetaCacheControlEphemeral, nil] Create a cache control breakpoint at this content block.
34
+ #
35
+ # @param type [Symbol, :text_editor_code_execution_tool_result]
36
+
37
+ # @see Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam#content
38
+ module Content
39
+ extend Anthropic::Internal::Type::Union
40
+
41
+ variant -> { Anthropic::Beta::BetaTextEditorCodeExecutionToolResultErrorParam }
42
+
43
+ variant -> { Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlockParam }
44
+
45
+ variant -> { Anthropic::Beta::BetaTextEditorCodeExecutionCreateResultBlockParam }
46
+
47
+ variant -> { Anthropic::Beta::BetaTextEditorCodeExecutionStrReplaceResultBlockParam }
48
+
49
+ # @!method self.variants
50
+ # @return [Array(Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultErrorParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionViewResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionCreateResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionStrReplaceResultBlockParam)]
51
+ end
52
+ end
53
+ end
54
+
55
+ BetaTextEditorCodeExecutionToolResultBlockParam = Beta::BetaTextEditorCodeExecutionToolResultBlockParam
56
+ end
57
+ end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ class BetaTextEditorCodeExecutionToolResultError < Anthropic::Internal::Type::BaseModel
7
+ # @!attribute error_code
8
+ #
9
+ # @return [Symbol, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultError::ErrorCode]
10
+ required :error_code, enum: -> { Anthropic::Beta::BetaTextEditorCodeExecutionToolResultError::ErrorCode }
11
+
12
+ # @!attribute error_message
13
+ #
14
+ # @return [String, nil]
15
+ required :error_message, String, nil?: true
16
+
17
+ # @!attribute type
18
+ #
19
+ # @return [Symbol, :text_editor_code_execution_tool_result_error]
20
+ required :type, const: :text_editor_code_execution_tool_result_error
21
+
22
+ # @!method initialize(error_code:, error_message:, type: :text_editor_code_execution_tool_result_error)
23
+ # @param error_code [Symbol, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultError::ErrorCode]
24
+ # @param error_message [String, nil]
25
+ # @param type [Symbol, :text_editor_code_execution_tool_result_error]
26
+
27
+ # @see Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultError#error_code
28
+ module ErrorCode
29
+ extend Anthropic::Internal::Type::Enum
30
+
31
+ INVALID_TOOL_INPUT = :invalid_tool_input
32
+ UNAVAILABLE = :unavailable
33
+ TOO_MANY_REQUESTS = :too_many_requests
34
+ EXECUTION_TIME_EXCEEDED = :execution_time_exceeded
35
+ FILE_NOT_FOUND = :file_not_found
36
+
37
+ # @!method self.values
38
+ # @return [Array<Symbol>]
39
+ end
40
+ end
41
+ end
42
+
43
+ BetaTextEditorCodeExecutionToolResultError = Beta::BetaTextEditorCodeExecutionToolResultError
44
+ end
45
+ end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ class BetaTextEditorCodeExecutionToolResultErrorParam < Anthropic::Internal::Type::BaseModel
7
+ # @!attribute error_code
8
+ #
9
+ # @return [Symbol, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultErrorParam::ErrorCode]
10
+ required :error_code,
11
+ enum: -> { Anthropic::Beta::BetaTextEditorCodeExecutionToolResultErrorParam::ErrorCode }
12
+
13
+ # @!attribute type
14
+ #
15
+ # @return [Symbol, :text_editor_code_execution_tool_result_error]
16
+ required :type, const: :text_editor_code_execution_tool_result_error
17
+
18
+ # @!attribute error_message
19
+ #
20
+ # @return [String, nil]
21
+ optional :error_message, String, nil?: true
22
+
23
+ # @!method initialize(error_code:, error_message: nil, type: :text_editor_code_execution_tool_result_error)
24
+ # @param error_code [Symbol, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultErrorParam::ErrorCode]
25
+ # @param error_message [String, nil]
26
+ # @param type [Symbol, :text_editor_code_execution_tool_result_error]
27
+
28
+ # @see Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultErrorParam#error_code
29
+ module ErrorCode
30
+ extend Anthropic::Internal::Type::Enum
31
+
32
+ INVALID_TOOL_INPUT = :invalid_tool_input
33
+ UNAVAILABLE = :unavailable
34
+ TOO_MANY_REQUESTS = :too_many_requests
35
+ EXECUTION_TIME_EXCEEDED = :execution_time_exceeded
36
+ FILE_NOT_FOUND = :file_not_found
37
+
38
+ # @!method self.values
39
+ # @return [Array<Symbol>]
40
+ end
41
+ end
42
+ end
43
+
44
+ BetaTextEditorCodeExecutionToolResultErrorParam = Beta::BetaTextEditorCodeExecutionToolResultErrorParam
45
+ end
46
+ end
@@ -0,0 +1,61 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ class BetaTextEditorCodeExecutionViewResultBlock < Anthropic::Internal::Type::BaseModel
7
+ # @!attribute content
8
+ #
9
+ # @return [String]
10
+ required :content, String
11
+
12
+ # @!attribute file_type
13
+ #
14
+ # @return [Symbol, Anthropic::Models::Beta::BetaTextEditorCodeExecutionViewResultBlock::FileType]
15
+ required :file_type, enum: -> { Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlock::FileType }
16
+
17
+ # @!attribute num_lines
18
+ #
19
+ # @return [Integer, nil]
20
+ required :num_lines, Integer, nil?: true
21
+
22
+ # @!attribute start_line
23
+ #
24
+ # @return [Integer, nil]
25
+ required :start_line, Integer, nil?: true
26
+
27
+ # @!attribute total_lines
28
+ #
29
+ # @return [Integer, nil]
30
+ required :total_lines, Integer, nil?: true
31
+
32
+ # @!attribute type
33
+ #
34
+ # @return [Symbol, :text_editor_code_execution_view_result]
35
+ required :type, const: :text_editor_code_execution_view_result
36
+
37
+ # @!method initialize(content:, file_type:, num_lines:, start_line:, total_lines:, type: :text_editor_code_execution_view_result)
38
+ # @param content [String]
39
+ # @param file_type [Symbol, Anthropic::Models::Beta::BetaTextEditorCodeExecutionViewResultBlock::FileType]
40
+ # @param num_lines [Integer, nil]
41
+ # @param start_line [Integer, nil]
42
+ # @param total_lines [Integer, nil]
43
+ # @param type [Symbol, :text_editor_code_execution_view_result]
44
+
45
+ # @see Anthropic::Models::Beta::BetaTextEditorCodeExecutionViewResultBlock#file_type
46
+ module FileType
47
+ extend Anthropic::Internal::Type::Enum
48
+
49
+ TEXT = :text
50
+ IMAGE = :image
51
+ PDF = :pdf
52
+
53
+ # @!method self.values
54
+ # @return [Array<Symbol>]
55
+ end
56
+ end
57
+ end
58
+
59
+ BetaTextEditorCodeExecutionViewResultBlock = Beta::BetaTextEditorCodeExecutionViewResultBlock
60
+ end
61
+ end
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ class BetaTextEditorCodeExecutionViewResultBlockParam < Anthropic::Internal::Type::BaseModel
7
+ # @!attribute content
8
+ #
9
+ # @return [String]
10
+ required :content, String
11
+
12
+ # @!attribute file_type
13
+ #
14
+ # @return [Symbol, Anthropic::Models::Beta::BetaTextEditorCodeExecutionViewResultBlockParam::FileType]
15
+ required :file_type,
16
+ enum: -> { Anthropic::Beta::BetaTextEditorCodeExecutionViewResultBlockParam::FileType }
17
+
18
+ # @!attribute type
19
+ #
20
+ # @return [Symbol, :text_editor_code_execution_view_result]
21
+ required :type, const: :text_editor_code_execution_view_result
22
+
23
+ # @!attribute num_lines
24
+ #
25
+ # @return [Integer, nil]
26
+ optional :num_lines, Integer, nil?: true
27
+
28
+ # @!attribute start_line
29
+ #
30
+ # @return [Integer, nil]
31
+ optional :start_line, Integer, nil?: true
32
+
33
+ # @!attribute total_lines
34
+ #
35
+ # @return [Integer, nil]
36
+ optional :total_lines, Integer, nil?: true
37
+
38
+ # @!method initialize(content:, file_type:, num_lines: nil, start_line: nil, total_lines: nil, type: :text_editor_code_execution_view_result)
39
+ # @param content [String]
40
+ # @param file_type [Symbol, Anthropic::Models::Beta::BetaTextEditorCodeExecutionViewResultBlockParam::FileType]
41
+ # @param num_lines [Integer, nil]
42
+ # @param start_line [Integer, nil]
43
+ # @param total_lines [Integer, nil]
44
+ # @param type [Symbol, :text_editor_code_execution_view_result]
45
+
46
+ # @see Anthropic::Models::Beta::BetaTextEditorCodeExecutionViewResultBlockParam#file_type
47
+ module FileType
48
+ extend Anthropic::Internal::Type::Enum
49
+
50
+ TEXT = :text
51
+ IMAGE = :image
52
+ PDF = :pdf
53
+
54
+ # @!method self.values
55
+ # @return [Array<Symbol>]
56
+ end
57
+ end
58
+ end
59
+
60
+ BetaTextEditorCodeExecutionViewResultBlockParam = Beta::BetaTextEditorCodeExecutionViewResultBlockParam
61
+ end
62
+ end