anthropic 1.1.1 → 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 (331) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +170 -0
  3. data/README.md +32 -16
  4. data/lib/anthropic/client.rb +5 -2
  5. data/lib/anthropic/errors.rb +22 -0
  6. data/lib/anthropic/helpers/bedrock/client.rb +34 -4
  7. data/lib/anthropic/helpers/input_schema/array_of.rb +41 -0
  8. data/lib/anthropic/helpers/input_schema/base_model.rb +86 -0
  9. data/lib/anthropic/helpers/input_schema/boolean.rb +29 -0
  10. data/lib/anthropic/helpers/input_schema/enum_of.rb +63 -0
  11. data/lib/anthropic/helpers/input_schema/json_schema_converter.rb +199 -0
  12. data/lib/anthropic/helpers/input_schema/parsed_json.rb +39 -0
  13. data/lib/anthropic/helpers/input_schema/property_mapping.rb +47 -0
  14. data/lib/anthropic/helpers/input_schema/union_of.rb +56 -0
  15. data/lib/anthropic/helpers/input_schema.rb +16 -0
  16. data/lib/anthropic/helpers/streaming/events.rb +141 -0
  17. data/lib/anthropic/helpers/streaming/message_stream.rb +278 -0
  18. data/lib/anthropic/helpers/streaming.rb +37 -0
  19. data/lib/anthropic/helpers/vertex/client.rb +4 -1
  20. data/lib/anthropic/input_schema.rb +10 -0
  21. data/lib/anthropic/internal/stream.rb +6 -3
  22. data/lib/anthropic/internal/transport/base_client.rb +30 -5
  23. data/lib/anthropic/internal/transport/pooled_net_requester.rb +1 -9
  24. data/lib/anthropic/internal/type/array_of.rb +7 -1
  25. data/lib/anthropic/internal/type/base_model.rb +81 -32
  26. data/lib/anthropic/internal/type/base_stream.rb +3 -1
  27. data/lib/anthropic/internal/type/boolean.rb +7 -1
  28. data/lib/anthropic/internal/type/converter.rb +69 -34
  29. data/lib/anthropic/internal/type/enum.rb +16 -5
  30. data/lib/anthropic/internal/type/file_input.rb +6 -1
  31. data/lib/anthropic/internal/type/hash_of.rb +7 -1
  32. data/lib/anthropic/internal/type/union.rb +26 -16
  33. data/lib/anthropic/internal/type/unknown.rb +7 -1
  34. data/lib/anthropic/internal/util.rb +10 -11
  35. data/lib/anthropic/models/anthropic_beta.rb +3 -0
  36. data/lib/anthropic/models/beta/beta_base64_pdf_block.rb +1 -65
  37. data/lib/anthropic/models/beta/beta_bash_code_execution_output_block.rb +25 -0
  38. data/lib/anthropic/models/beta/beta_bash_code_execution_output_block_param.rb +25 -0
  39. data/lib/anthropic/models/beta/beta_bash_code_execution_result_block.rb +44 -0
  40. data/lib/anthropic/models/beta/beta_bash_code_execution_result_block_param.rb +44 -0
  41. data/lib/anthropic/models/beta/beta_bash_code_execution_tool_result_block.rb +43 -0
  42. data/lib/anthropic/models/beta/beta_bash_code_execution_tool_result_block_param.rb +53 -0
  43. data/lib/anthropic/models/beta/beta_bash_code_execution_tool_result_error.rb +39 -0
  44. data/lib/anthropic/models/beta/beta_bash_code_execution_tool_result_error_param.rb +39 -0
  45. data/lib/anthropic/models/beta/beta_citation_char_location.rb +7 -1
  46. data/lib/anthropic/models/beta/beta_citation_config.rb +19 -0
  47. data/lib/anthropic/models/beta/beta_citation_content_block_location.rb +7 -1
  48. data/lib/anthropic/models/beta/beta_citation_page_location.rb +7 -1
  49. data/lib/anthropic/models/beta/beta_citation_search_result_location.rb +55 -0
  50. data/lib/anthropic/models/beta/beta_citation_search_result_location_param.rb +55 -0
  51. data/lib/anthropic/models/beta/beta_citations_delta.rb +5 -3
  52. data/lib/anthropic/models/beta/beta_code_execution_tool_20250825.rb +40 -0
  53. data/lib/anthropic/models/beta/beta_content_block.rb +12 -5
  54. data/lib/anthropic/models/beta/beta_content_block_param.rb +28 -17
  55. data/lib/anthropic/models/beta/beta_document_block.rb +56 -0
  56. data/lib/anthropic/models/beta/beta_message.rb +6 -2
  57. data/lib/anthropic/models/beta/beta_message_param.rb +3 -3
  58. data/lib/anthropic/models/beta/beta_raw_content_block_start_event.rb +14 -7
  59. data/lib/anthropic/models/beta/beta_request_document_block.rb +75 -0
  60. data/lib/anthropic/models/beta/beta_search_result_block_param.rb +55 -0
  61. data/lib/anthropic/models/beta/beta_server_tool_usage.rb +9 -1
  62. data/lib/anthropic/models/beta/beta_server_tool_use_block.rb +3 -0
  63. data/lib/anthropic/models/beta/beta_server_tool_use_block_param.rb +3 -0
  64. data/lib/anthropic/models/beta/beta_text_block.rb +2 -2
  65. data/lib/anthropic/models/beta/beta_text_block_param.rb +2 -2
  66. data/lib/anthropic/models/beta/beta_text_citation.rb +3 -1
  67. data/lib/anthropic/models/beta/beta_text_citation_param.rb +3 -1
  68. data/lib/anthropic/models/beta/beta_text_editor_code_execution_create_result_block.rb +25 -0
  69. data/lib/anthropic/models/beta/beta_text_editor_code_execution_create_result_block_param.rb +26 -0
  70. data/lib/anthropic/models/beta/beta_text_editor_code_execution_str_replace_result_block.rb +49 -0
  71. data/lib/anthropic/models/beta/beta_text_editor_code_execution_str_replace_result_block_param.rb +50 -0
  72. data/lib/anthropic/models/beta/beta_text_editor_code_execution_tool_result_block.rb +47 -0
  73. data/lib/anthropic/models/beta/beta_text_editor_code_execution_tool_result_block_param.rb +57 -0
  74. data/lib/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error.rb +45 -0
  75. data/lib/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error_param.rb +46 -0
  76. data/lib/anthropic/models/beta/beta_text_editor_code_execution_view_result_block.rb +61 -0
  77. data/lib/anthropic/models/beta/beta_text_editor_code_execution_view_result_block_param.rb +62 -0
  78. data/lib/anthropic/models/beta/beta_tool.rb +7 -1
  79. data/lib/anthropic/models/beta/beta_tool_result_block_param.rb +8 -4
  80. data/lib/anthropic/models/beta/beta_tool_text_editor_20250728.rb +49 -0
  81. data/lib/anthropic/models/beta/beta_tool_union.rb +12 -6
  82. data/lib/anthropic/models/beta/beta_web_fetch_block.rb +42 -0
  83. data/lib/anthropic/models/beta/beta_web_fetch_block_param.rb +42 -0
  84. data/lib/anthropic/models/beta/beta_web_fetch_tool_20250910.rb +82 -0
  85. data/lib/anthropic/models/beta/beta_web_fetch_tool_result_block.rb +43 -0
  86. data/lib/anthropic/models/beta/beta_web_fetch_tool_result_block_param.rb +53 -0
  87. data/lib/anthropic/models/beta/beta_web_fetch_tool_result_error_block.rb +25 -0
  88. data/lib/anthropic/models/beta/beta_web_fetch_tool_result_error_block_param.rb +25 -0
  89. data/lib/anthropic/models/beta/beta_web_fetch_tool_result_error_code.rb +25 -0
  90. data/lib/anthropic/models/beta/message_count_tokens_params.rb +23 -36
  91. data/lib/anthropic/models/beta/message_create_params.rb +10 -27
  92. data/lib/anthropic/models/beta/messages/batch_create_params.rb +13 -37
  93. data/lib/anthropic/models/beta/messages/beta_message_batch.rb +1 -4
  94. data/lib/anthropic/models/beta_error_response.rb +7 -1
  95. data/lib/anthropic/models/cache_control_ephemeral.rb +39 -1
  96. data/lib/anthropic/models/cache_creation.rb +24 -0
  97. data/lib/anthropic/models/citation_char_location.rb +7 -1
  98. data/lib/anthropic/models/citation_content_block_location.rb +7 -1
  99. data/lib/anthropic/models/citation_page_location.rb +7 -1
  100. data/lib/anthropic/models/citation_search_result_location_param.rb +51 -0
  101. data/lib/anthropic/models/citations_delta.rb +5 -3
  102. data/lib/anthropic/models/citations_search_result_location.rb +51 -0
  103. data/lib/anthropic/models/content_block.rb +5 -5
  104. data/lib/anthropic/models/content_block_param.rb +14 -11
  105. data/lib/anthropic/models/document_block_param.rb +2 -2
  106. data/lib/anthropic/models/error_response.rb +7 -1
  107. data/lib/anthropic/models/message.rb +6 -2
  108. data/lib/anthropic/models/message_count_tokens_params.rb +10 -27
  109. data/lib/anthropic/models/message_count_tokens_tool.rb +5 -1
  110. data/lib/anthropic/models/message_create_params.rb +10 -27
  111. data/lib/anthropic/models/message_param.rb +3 -3
  112. data/lib/anthropic/models/messages/batch_create_params.rb +11 -31
  113. data/lib/anthropic/models/model.rb +16 -21
  114. data/lib/anthropic/models/raw_content_block_start_event.rb +7 -7
  115. data/lib/anthropic/models/search_result_block_param.rb +51 -0
  116. data/lib/anthropic/models/text_block.rb +2 -2
  117. data/lib/anthropic/models/text_block_param.rb +2 -2
  118. data/lib/anthropic/models/text_citation.rb +3 -1
  119. data/lib/anthropic/models/text_citation_param.rb +3 -1
  120. data/lib/anthropic/models/tool.rb +7 -1
  121. data/lib/anthropic/models/tool_result_block_param.rb +8 -4
  122. data/lib/anthropic/models/tool_text_editor_20250429.rb +36 -0
  123. data/lib/anthropic/models/tool_text_editor_20250728.rb +45 -0
  124. data/lib/anthropic/models/tool_union.rb +5 -1
  125. data/lib/anthropic/models/tool_use_block.rb +14 -0
  126. data/lib/anthropic/models/usage.rb +9 -1
  127. data/lib/anthropic/models.rb +16 -4
  128. data/lib/anthropic/resources/beta/messages.rb +73 -6
  129. data/lib/anthropic/resources/messages.rb +152 -7
  130. data/lib/anthropic/streaming.rb +5 -0
  131. data/lib/anthropic/version.rb +1 -1
  132. data/lib/anthropic.rb +54 -0
  133. data/rbi/anthropic/errors.rbi +18 -2
  134. data/rbi/anthropic/helpers/bedrock/client.rbi +17 -6
  135. data/rbi/anthropic/helpers/input_schema/array_of.rbi +16 -0
  136. data/rbi/anthropic/helpers/input_schema/base_model.rbi +21 -0
  137. data/rbi/anthropic/helpers/input_schema/boolean.rbi +11 -0
  138. data/rbi/anthropic/helpers/input_schema/enum_of.rbi +30 -0
  139. data/rbi/anthropic/helpers/input_schema/json_schema_converter.rbi +89 -0
  140. data/rbi/anthropic/helpers/input_schema/union_of.rbi +23 -0
  141. data/rbi/anthropic/helpers/streaming/events.rbi +95 -0
  142. data/rbi/anthropic/helpers/streaming/message_stream.rbi +73 -0
  143. data/rbi/anthropic/helpers/structured_output.rbi +16 -0
  144. data/rbi/anthropic/helpers/vertex/client.rbi +17 -6
  145. data/rbi/anthropic/input_schema.rbi +12 -0
  146. data/rbi/anthropic/internal/transport/base_client.rbi +1 -1
  147. data/rbi/anthropic/internal/type/base_stream.rbi +8 -1
  148. data/rbi/anthropic/internal/type/boolean.rbi +2 -0
  149. data/rbi/anthropic/internal/type/converter.rbi +69 -15
  150. data/rbi/anthropic/internal/type/union.rbi +14 -2
  151. data/rbi/anthropic/internal/type/unknown.rbi +2 -0
  152. data/rbi/anthropic/internal/util.rbi +2 -0
  153. data/rbi/anthropic/models/anthropic_beta.rbi +2 -0
  154. data/rbi/anthropic/models/beta/beta_base64_pdf_block.rbi +1 -128
  155. data/rbi/anthropic/models/beta/beta_bash_code_execution_output_block.rbi +33 -0
  156. data/rbi/anthropic/models/beta/beta_bash_code_execution_output_block_param.rbi +34 -0
  157. data/rbi/anthropic/models/beta/beta_bash_code_execution_result_block.rbi +72 -0
  158. data/rbi/anthropic/models/beta/beta_bash_code_execution_result_block_param.rbi +77 -0
  159. data/rbi/anthropic/models/beta/beta_bash_code_execution_tool_result_block.rbi +86 -0
  160. data/rbi/anthropic/models/beta/beta_bash_code_execution_tool_result_block_param.rbi +110 -0
  161. data/rbi/anthropic/models/beta/beta_bash_code_execution_tool_result_error.rbi +101 -0
  162. data/rbi/anthropic/models/beta/beta_bash_code_execution_tool_result_error_param.rbi +101 -0
  163. data/rbi/anthropic/models/beta/beta_citation_char_location.rbi +6 -0
  164. data/rbi/anthropic/models/beta/beta_citation_config.rbi +30 -0
  165. data/rbi/anthropic/models/beta/beta_citation_content_block_location.rbi +6 -0
  166. data/rbi/anthropic/models/beta/beta_citation_page_location.rbi +6 -0
  167. data/rbi/anthropic/models/beta/beta_citation_search_result_location.rbi +78 -0
  168. data/rbi/anthropic/models/beta/beta_citation_search_result_location_param.rbi +79 -0
  169. data/rbi/anthropic/models/beta/beta_citations_delta.rbi +4 -2
  170. data/rbi/anthropic/models/beta/beta_code_execution_tool_20250825.rbi +72 -0
  171. data/rbi/anthropic/models/beta/beta_content_block.rbi +6 -3
  172. data/rbi/anthropic/models/beta/beta_content_block_param.rbi +11 -7
  173. data/rbi/anthropic/models/beta/beta_document_block.rbi +95 -0
  174. data/rbi/anthropic/models/beta/beta_message.rbi +14 -3
  175. data/rbi/anthropic/models/beta/beta_raw_content_block_start_event.rbi +12 -6
  176. data/rbi/anthropic/models/beta/beta_request_document_block.rbi +142 -0
  177. data/rbi/anthropic/models/beta/beta_search_result_block_param.rbi +91 -0
  178. data/rbi/anthropic/models/beta/beta_server_tool_usage.rbi +17 -2
  179. data/rbi/anthropic/models/beta/beta_server_tool_use_block.rbi +15 -0
  180. data/rbi/anthropic/models/beta/beta_server_tool_use_block_param.rbi +15 -0
  181. data/rbi/anthropic/models/beta/beta_text_block.rbi +2 -1
  182. data/rbi/anthropic/models/beta/beta_text_block_param.rbi +6 -3
  183. data/rbi/anthropic/models/beta/beta_text_citation.rbi +2 -1
  184. data/rbi/anthropic/models/beta/beta_text_citation_param.rbi +2 -1
  185. data/rbi/anthropic/models/beta/beta_text_editor_code_execution_create_result_block.rbi +41 -0
  186. data/rbi/anthropic/models/beta/beta_text_editor_code_execution_create_result_block_param.rbi +41 -0
  187. data/rbi/anthropic/models/beta/beta_text_editor_code_execution_str_replace_result_block.rbi +73 -0
  188. data/rbi/anthropic/models/beta/beta_text_editor_code_execution_str_replace_result_block_param.rbi +73 -0
  189. data/rbi/anthropic/models/beta/beta_text_editor_code_execution_tool_result_block.rbi +90 -0
  190. data/rbi/anthropic/models/beta/beta_text_editor_code_execution_tool_result_block_param.rbi +118 -0
  191. data/rbi/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error.rbi +110 -0
  192. data/rbi/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error_param.rbi +110 -0
  193. data/rbi/anthropic/models/beta/beta_text_editor_code_execution_view_result_block.rbi +118 -0
  194. data/rbi/anthropic/models/beta/beta_text_editor_code_execution_view_result_block_param.rbi +118 -0
  195. data/rbi/anthropic/models/beta/beta_tool.rbi +14 -5
  196. data/rbi/anthropic/models/beta/beta_tool_result_block_param.rbi +3 -1
  197. data/rbi/anthropic/models/beta/beta_tool_text_editor_20250728.rbi +82 -0
  198. data/rbi/anthropic/models/beta/beta_tool_union.rbi +7 -4
  199. data/rbi/anthropic/models/beta/beta_web_fetch_block.rbi +67 -0
  200. data/rbi/anthropic/models/beta/beta_web_fetch_block_param.rbi +71 -0
  201. data/rbi/anthropic/models/beta/beta_web_fetch_tool_20250910.rbi +125 -0
  202. data/rbi/anthropic/models/beta/beta_web_fetch_tool_result_block.rbi +81 -0
  203. data/rbi/anthropic/models/beta/beta_web_fetch_tool_result_block_param.rbi +109 -0
  204. data/rbi/anthropic/models/beta/beta_web_fetch_tool_result_error_block.rbi +51 -0
  205. data/rbi/anthropic/models/beta/beta_web_fetch_tool_result_error_block_param.rbi +50 -0
  206. data/rbi/anthropic/models/beta/beta_web_fetch_tool_result_error_code.rbi +70 -0
  207. data/rbi/anthropic/models/beta/message_count_tokens_params.rbi +51 -70
  208. data/rbi/anthropic/models/beta/message_create_params.rbi +44 -66
  209. data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +44 -66
  210. data/rbi/anthropic/models/beta_error_response.rbi +10 -2
  211. data/rbi/anthropic/models/cache_control_ephemeral.rbi +68 -3
  212. data/rbi/anthropic/models/cache_creation.rbi +45 -0
  213. data/rbi/anthropic/models/citation_char_location.rbi +6 -0
  214. data/rbi/anthropic/models/citation_content_block_location.rbi +6 -0
  215. data/rbi/anthropic/models/citation_page_location.rbi +6 -0
  216. data/rbi/anthropic/models/citation_search_result_location_param.rbi +74 -0
  217. data/rbi/anthropic/models/citations_delta.rbi +4 -2
  218. data/rbi/anthropic/models/citations_search_result_location.rbi +74 -0
  219. data/rbi/anthropic/models/content_block.rbi +3 -3
  220. data/rbi/anthropic/models/content_block_param.rbi +6 -5
  221. data/rbi/anthropic/models/document_block_param.rbi +7 -3
  222. data/rbi/anthropic/models/error_response.rbi +10 -2
  223. data/rbi/anthropic/models/message.rbi +11 -3
  224. data/rbi/anthropic/models/message_count_tokens_params.rbi +24 -50
  225. data/rbi/anthropic/models/message_count_tokens_tool.rbi +2 -0
  226. data/rbi/anthropic/models/message_create_params.rbi +24 -50
  227. data/rbi/anthropic/models/messages/batch_create_params.rbi +24 -50
  228. data/rbi/anthropic/models/model.rbi +4 -8
  229. data/rbi/anthropic/models/raw_content_block_start_event.rbi +6 -6
  230. data/rbi/anthropic/models/search_result_block_param.rbi +77 -0
  231. data/rbi/anthropic/models/text_block.rbi +2 -1
  232. data/rbi/anthropic/models/text_block_param.rbi +6 -3
  233. data/rbi/anthropic/models/text_citation.rbi +2 -1
  234. data/rbi/anthropic/models/text_citation_param.rbi +2 -1
  235. data/rbi/anthropic/models/tool.rbi +16 -5
  236. data/rbi/anthropic/models/tool_result_block_param.rbi +6 -1
  237. data/rbi/anthropic/models/tool_text_editor_20250429.rbi +62 -0
  238. data/rbi/anthropic/models/tool_text_editor_20250728.rbi +72 -0
  239. data/rbi/anthropic/models/tool_union.rbi +2 -0
  240. data/rbi/anthropic/models/usage.rbi +13 -0
  241. data/rbi/anthropic/models.rbi +14 -0
  242. data/rbi/anthropic/resources/beta/messages.rbi +45 -87
  243. data/rbi/anthropic/resources/messages.rbi +315 -69
  244. data/rbi/anthropic/streaming.rbi +5 -0
  245. data/sig/anthropic/errors.rbs +9 -0
  246. data/sig/anthropic/helpers/streaming/events.rbs +117 -0
  247. data/sig/anthropic/helpers/streaming/message_stream.rbs +57 -0
  248. data/sig/anthropic/internal/transport/base_client.rbs +1 -1
  249. data/sig/anthropic/internal/type/base_stream.rbs +4 -0
  250. data/sig/anthropic/internal/type/converter.rbs +24 -1
  251. data/sig/anthropic/internal/type/union.rbs +2 -2
  252. data/sig/anthropic/models/anthropic_beta.rbs +2 -0
  253. data/sig/anthropic/models/beta/beta_base64_pdf_block.rbs +1 -58
  254. data/sig/anthropic/models/beta/beta_bash_code_execution_output_block.rbs +23 -0
  255. data/sig/anthropic/models/beta/beta_bash_code_execution_output_block_param.rbs +23 -0
  256. data/sig/anthropic/models/beta/beta_bash_code_execution_result_block.rbs +44 -0
  257. data/sig/anthropic/models/beta/beta_bash_code_execution_result_block_param.rbs +44 -0
  258. data/sig/anthropic/models/beta/beta_bash_code_execution_tool_result_block.rbs +44 -0
  259. data/sig/anthropic/models/beta/beta_bash_code_execution_tool_result_block_param.rbs +49 -0
  260. data/sig/anthropic/models/beta/beta_bash_code_execution_tool_result_error.rbs +48 -0
  261. data/sig/anthropic/models/beta/beta_bash_code_execution_tool_result_error_param.rbs +48 -0
  262. data/sig/anthropic/models/beta/beta_citation_char_location.rbs +5 -0
  263. data/sig/anthropic/models/beta/beta_citation_config.rbs +17 -0
  264. data/sig/anthropic/models/beta/beta_citation_content_block_location.rbs +5 -0
  265. data/sig/anthropic/models/beta/beta_citation_page_location.rbs +5 -0
  266. data/sig/anthropic/models/beta/beta_citation_search_result_location.rbs +54 -0
  267. data/sig/anthropic/models/beta/beta_citation_search_result_location_param.rbs +54 -0
  268. data/sig/anthropic/models/beta/beta_citations_delta.rbs +1 -0
  269. data/sig/anthropic/models/beta/beta_code_execution_tool_20250825.rbs +34 -0
  270. data/sig/anthropic/models/beta/beta_content_block.rbs +5 -2
  271. data/sig/anthropic/models/beta/beta_content_block_param.rbs +12 -8
  272. data/sig/anthropic/models/beta/beta_document_block.rbs +49 -0
  273. data/sig/anthropic/models/beta/beta_raw_content_block_start_event.rbs +5 -2
  274. data/sig/anthropic/models/beta/beta_request_document_block.rbs +62 -0
  275. data/sig/anthropic/models/beta/beta_search_result_block_param.rbs +53 -0
  276. data/sig/anthropic/models/beta/beta_server_tool_usage.rbs +12 -3
  277. data/sig/anthropic/models/beta/beta_server_tool_use_block.rbs +9 -1
  278. data/sig/anthropic/models/beta/beta_server_tool_use_block_param.rbs +9 -1
  279. data/sig/anthropic/models/beta/beta_text_citation.rbs +1 -0
  280. data/sig/anthropic/models/beta/beta_text_citation_param.rbs +1 -0
  281. data/sig/anthropic/models/beta/beta_text_editor_code_execution_create_result_block.rbs +29 -0
  282. data/sig/anthropic/models/beta/beta_text_editor_code_execution_create_result_block_param.rbs +29 -0
  283. data/sig/anthropic/models/beta/beta_text_editor_code_execution_str_replace_result_block.rbs +49 -0
  284. data/sig/anthropic/models/beta/beta_text_editor_code_execution_str_replace_result_block_param.rbs +49 -0
  285. data/sig/anthropic/models/beta/beta_text_editor_code_execution_tool_result_block.rbs +46 -0
  286. data/sig/anthropic/models/beta/beta_text_editor_code_execution_tool_result_block_param.rbs +51 -0
  287. data/sig/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error.rbs +53 -0
  288. data/sig/anthropic/models/beta/beta_text_editor_code_execution_tool_result_error_param.rbs +53 -0
  289. data/sig/anthropic/models/beta/beta_text_editor_code_execution_view_result_block.rbs +61 -0
  290. data/sig/anthropic/models/beta/beta_text_editor_code_execution_view_result_block_param.rbs +61 -0
  291. data/sig/anthropic/models/beta/beta_tool.rbs +14 -3
  292. data/sig/anthropic/models/beta/beta_tool_result_block_param.rbs +2 -0
  293. data/sig/anthropic/models/beta/beta_tool_text_editor_20250728.rbs +39 -0
  294. data/sig/anthropic/models/beta/beta_tool_union.rbs +7 -4
  295. data/sig/anthropic/models/beta/beta_web_fetch_block.rbs +39 -0
  296. data/sig/anthropic/models/beta/beta_web_fetch_block_param.rbs +39 -0
  297. data/sig/anthropic/models/beta/beta_web_fetch_tool_20250910.rbs +59 -0
  298. data/sig/anthropic/models/beta/beta_web_fetch_tool_result_block.rbs +44 -0
  299. data/sig/anthropic/models/beta/beta_web_fetch_tool_result_block_param.rbs +49 -0
  300. data/sig/anthropic/models/beta/beta_web_fetch_tool_result_error_block.rbs +29 -0
  301. data/sig/anthropic/models/beta/beta_web_fetch_tool_result_error_block_param.rbs +29 -0
  302. data/sig/anthropic/models/beta/beta_web_fetch_tool_result_error_code.rbs +32 -0
  303. data/sig/anthropic/models/beta/message_count_tokens_params.rbs +7 -4
  304. data/sig/anthropic/models/beta_error_response.rbs +13 -2
  305. data/sig/anthropic/models/cache_control_ephemeral.rbs +27 -3
  306. data/sig/anthropic/models/cache_creation.rbs +25 -0
  307. data/sig/anthropic/models/citation_char_location.rbs +5 -0
  308. data/sig/anthropic/models/citation_content_block_location.rbs +5 -0
  309. data/sig/anthropic/models/citation_page_location.rbs +5 -0
  310. data/sig/anthropic/models/citation_search_result_location_param.rbs +50 -0
  311. data/sig/anthropic/models/citations_delta.rbs +1 -0
  312. data/sig/anthropic/models/citations_search_result_location.rbs +50 -0
  313. data/sig/anthropic/models/content_block.rbs +2 -2
  314. data/sig/anthropic/models/content_block_param.rbs +6 -5
  315. data/sig/anthropic/models/document_block_param.rbs +4 -8
  316. data/sig/anthropic/models/error_response.rbs +13 -2
  317. data/sig/anthropic/models/message_count_tokens_tool.rbs +2 -0
  318. data/sig/anthropic/models/model.rbs +4 -10
  319. data/sig/anthropic/models/raw_content_block_start_event.rbs +2 -2
  320. data/sig/anthropic/models/search_result_block_param.rbs +49 -0
  321. data/sig/anthropic/models/text_citation.rbs +1 -0
  322. data/sig/anthropic/models/text_citation_param.rbs +1 -0
  323. data/sig/anthropic/models/tool.rbs +14 -3
  324. data/sig/anthropic/models/tool_result_block_param.rbs +5 -1
  325. data/sig/anthropic/models/tool_text_editor_20250429.rbs +30 -0
  326. data/sig/anthropic/models/tool_text_editor_20250728.rbs +35 -0
  327. data/sig/anthropic/models/tool_union.rbs +2 -0
  328. data/sig/anthropic/models/usage.rbs +5 -0
  329. data/sig/anthropic/models.rbs +12 -0
  330. data/sig/anthropic/streaming.rbs +3 -0
  331. metadata +152 -3
@@ -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
@@ -69,13 +69,19 @@ module Anthropic
69
69
  # @return [Object, nil]
70
70
  optional :properties, Anthropic::Internal::Type::Unknown, nil?: true
71
71
 
72
- # @!method initialize(properties: nil, type: :object)
72
+ # @!attribute required
73
+ #
74
+ # @return [Array<String>, nil]
75
+ optional :required, Anthropic::Internal::Type::ArrayOf[String], nil?: true
76
+
77
+ # @!method initialize(properties: nil, required: nil, type: :object)
73
78
  # [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
74
79
  #
75
80
  # This defines the shape of the `input` that your tool accepts and that the model
76
81
  # will produce.
77
82
  #
78
83
  # @param properties [Object, nil]
84
+ # @param required [Array<String>, nil]
79
85
  # @param type [Symbol, :object]
80
86
  end
81
87
 
@@ -22,7 +22,7 @@ module Anthropic
22
22
 
23
23
  # @!attribute content
24
24
  #
25
- # @return [String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam>, nil]
25
+ # @return [String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock>, nil]
26
26
  optional :content, union: -> { Anthropic::Beta::BetaToolResultBlockParam::Content }
27
27
 
28
28
  # @!attribute is_error
@@ -35,7 +35,7 @@ module Anthropic
35
35
  #
36
36
  # @param cache_control [Anthropic::Models::Beta::BetaCacheControlEphemeral, nil] Create a cache control breakpoint at this content block.
37
37
  #
38
- # @param content [String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam>]
38
+ # @param content [String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock>]
39
39
  #
40
40
  # @param is_error [Boolean]
41
41
  #
@@ -58,12 +58,16 @@ module Anthropic
58
58
 
59
59
  variant :image, -> { Anthropic::Beta::BetaImageBlockParam }
60
60
 
61
+ variant :search_result, -> { Anthropic::Beta::BetaSearchResultBlockParam }
62
+
63
+ variant :document, -> { Anthropic::Beta::BetaRequestDocumentBlock }
64
+
61
65
  # @!method self.variants
62
- # @return [Array(Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam)]
66
+ # @return [Array(Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock)]
63
67
  end
64
68
 
65
69
  # @!method self.variants
66
- # @return [Array(String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam>)]
70
+ # @return [Array(String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock>)]
67
71
 
68
72
  # @type [Anthropic::Internal::Type::Converter]
69
73
  ContentArray =
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ class BetaToolTextEditor20250728 < 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, :str_replace_based_edit_tool]
13
+ required :name, const: :str_replace_based_edit_tool
14
+
15
+ # @!attribute type
16
+ #
17
+ # @return [Symbol, :text_editor_20250728]
18
+ required :type, const: :text_editor_20250728
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
+ # @!attribute max_characters
27
+ # Maximum number of characters to display when viewing a file. If not specified,
28
+ # defaults to displaying the full file.
29
+ #
30
+ # @return [Integer, nil]
31
+ optional :max_characters, Integer, nil?: true
32
+
33
+ # @!method initialize(cache_control: nil, max_characters: nil, name: :str_replace_based_edit_tool, type: :text_editor_20250728)
34
+ # Some parameter documentations has been truncated, see
35
+ # {Anthropic::Models::Beta::BetaToolTextEditor20250728} for more details.
36
+ #
37
+ # @param cache_control [Anthropic::Models::Beta::BetaCacheControlEphemeral, nil] Create a cache control breakpoint at this content block.
38
+ #
39
+ # @param max_characters [Integer, nil] Maximum number of characters to display when viewing a file. If not specified, d
40
+ #
41
+ # @param name [Symbol, :str_replace_based_edit_tool] Name of the tool.
42
+ #
43
+ # @param type [Symbol, :text_editor_20250728]
44
+ end
45
+ end
46
+
47
+ BetaToolTextEditor20250728 = Beta::BetaToolTextEditor20250728
48
+ end
49
+ end
@@ -8,26 +8,32 @@ module Anthropic
8
8
 
9
9
  variant -> { Anthropic::Beta::BetaTool }
10
10
 
11
- variant -> { Anthropic::Beta::BetaToolComputerUse20241022 }
12
-
13
11
  variant -> { Anthropic::Beta::BetaToolBash20241022 }
14
12
 
15
- variant -> { Anthropic::Beta::BetaToolTextEditor20241022 }
13
+ variant -> { Anthropic::Beta::BetaToolBash20250124 }
14
+
15
+ variant -> { Anthropic::Beta::BetaCodeExecutionTool20250522 }
16
+
17
+ variant -> { Anthropic::Beta::BetaCodeExecutionTool20250825 }
18
+
19
+ variant -> { Anthropic::Beta::BetaToolComputerUse20241022 }
16
20
 
17
21
  variant -> { Anthropic::Beta::BetaToolComputerUse20250124 }
18
22
 
19
- variant -> { Anthropic::Beta::BetaToolBash20250124 }
23
+ variant -> { Anthropic::Beta::BetaToolTextEditor20241022 }
20
24
 
21
25
  variant -> { Anthropic::Beta::BetaToolTextEditor20250124 }
22
26
 
23
27
  variant -> { Anthropic::Beta::BetaToolTextEditor20250429 }
24
28
 
29
+ variant -> { Anthropic::Beta::BetaToolTextEditor20250728 }
30
+
25
31
  variant -> { Anthropic::Beta::BetaWebSearchTool20250305 }
26
32
 
27
- variant -> { Anthropic::Beta::BetaCodeExecutionTool20250522 }
33
+ variant -> { Anthropic::Beta::BetaWebFetchTool20250910 }
28
34
 
29
35
  # @!method self.variants
30
- # @return [Array(Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolComputerUse20241022, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolTextEditor20241022, Anthropic::Models::Beta::BetaToolComputerUse20250124, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaToolTextEditor20250124, Anthropic::Models::Beta::BetaToolTextEditor20250429, Anthropic::Models::Beta::BetaWebSearchTool20250305, Anthropic::Models::Beta::BetaCodeExecutionTool20250522)]
36
+ # @return [Array(Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, Anthropic::Models::Beta::BetaCodeExecutionTool20250825, Anthropic::Models::Beta::BetaToolComputerUse20241022, Anthropic::Models::Beta::BetaToolComputerUse20250124, Anthropic::Models::Beta::BetaToolTextEditor20241022, Anthropic::Models::Beta::BetaToolTextEditor20250124, Anthropic::Models::Beta::BetaToolTextEditor20250429, Anthropic::Models::Beta::BetaToolTextEditor20250728, Anthropic::Models::Beta::BetaWebSearchTool20250305, Anthropic::Models::Beta::BetaWebFetchTool20250910)]
31
37
  end
32
38
  end
33
39
 
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ class BetaWebFetchBlock < Anthropic::Internal::Type::BaseModel
7
+ # @!attribute content
8
+ #
9
+ # @return [Anthropic::Models::Beta::BetaDocumentBlock]
10
+ required :content, -> { Anthropic::Beta::BetaDocumentBlock }
11
+
12
+ # @!attribute retrieved_at
13
+ # ISO 8601 timestamp when the content was retrieved
14
+ #
15
+ # @return [String, nil]
16
+ required :retrieved_at, String, nil?: true
17
+
18
+ # @!attribute type
19
+ #
20
+ # @return [Symbol, :web_fetch_result]
21
+ required :type, const: :web_fetch_result
22
+
23
+ # @!attribute url
24
+ # Fetched content URL
25
+ #
26
+ # @return [String]
27
+ required :url, String
28
+
29
+ # @!method initialize(content:, retrieved_at:, url:, type: :web_fetch_result)
30
+ # @param content [Anthropic::Models::Beta::BetaDocumentBlock]
31
+ #
32
+ # @param retrieved_at [String, nil] ISO 8601 timestamp when the content was retrieved
33
+ #
34
+ # @param url [String] Fetched content URL
35
+ #
36
+ # @param type [Symbol, :web_fetch_result]
37
+ end
38
+ end
39
+
40
+ BetaWebFetchBlock = Beta::BetaWebFetchBlock
41
+ end
42
+ end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ class BetaWebFetchBlockParam < Anthropic::Internal::Type::BaseModel
7
+ # @!attribute content
8
+ #
9
+ # @return [Anthropic::Models::Beta::BetaRequestDocumentBlock]
10
+ required :content, -> { Anthropic::Beta::BetaRequestDocumentBlock }
11
+
12
+ # @!attribute type
13
+ #
14
+ # @return [Symbol, :web_fetch_result]
15
+ required :type, const: :web_fetch_result
16
+
17
+ # @!attribute url
18
+ # Fetched content URL
19
+ #
20
+ # @return [String]
21
+ required :url, String
22
+
23
+ # @!attribute retrieved_at
24
+ # ISO 8601 timestamp when the content was retrieved
25
+ #
26
+ # @return [String, nil]
27
+ optional :retrieved_at, String, nil?: true
28
+
29
+ # @!method initialize(content:, url:, retrieved_at: nil, type: :web_fetch_result)
30
+ # @param content [Anthropic::Models::Beta::BetaRequestDocumentBlock]
31
+ #
32
+ # @param url [String] Fetched content URL
33
+ #
34
+ # @param retrieved_at [String, nil] ISO 8601 timestamp when the content was retrieved
35
+ #
36
+ # @param type [Symbol, :web_fetch_result]
37
+ end
38
+ end
39
+
40
+ BetaWebFetchBlockParam = Beta::BetaWebFetchBlockParam
41
+ end
42
+ end