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
@@ -11,13 +11,78 @@ module Anthropic
11
11
  sig { returns(Symbol) }
12
12
  attr_accessor :type
13
13
 
14
- sig { params(type: Symbol).returns(T.attached_class) }
15
- def self.new(type: :ephemeral)
14
+ # The time-to-live for the cache control breakpoint.
15
+ #
16
+ # This may be one the following values:
17
+ #
18
+ # - `5m`: 5 minutes
19
+ # - `1h`: 1 hour
20
+ #
21
+ # Defaults to `5m`.
22
+ sig do
23
+ returns(T.nilable(Anthropic::CacheControlEphemeral::TTL::OrSymbol))
16
24
  end
25
+ attr_reader :ttl
17
26
 
18
- sig { override.returns({ type: Symbol }) }
27
+ sig { params(ttl: Anthropic::CacheControlEphemeral::TTL::OrSymbol).void }
28
+ attr_writer :ttl
29
+
30
+ sig do
31
+ params(
32
+ ttl: Anthropic::CacheControlEphemeral::TTL::OrSymbol,
33
+ type: Symbol
34
+ ).returns(T.attached_class)
35
+ end
36
+ def self.new(
37
+ # The time-to-live for the cache control breakpoint.
38
+ #
39
+ # This may be one the following values:
40
+ #
41
+ # - `5m`: 5 minutes
42
+ # - `1h`: 1 hour
43
+ #
44
+ # Defaults to `5m`.
45
+ ttl: nil,
46
+ type: :ephemeral
47
+ )
48
+ end
49
+
50
+ sig do
51
+ override.returns(
52
+ { type: Symbol, ttl: Anthropic::CacheControlEphemeral::TTL::OrSymbol }
53
+ )
54
+ end
19
55
  def to_hash
20
56
  end
57
+
58
+ # The time-to-live for the cache control breakpoint.
59
+ #
60
+ # This may be one the following values:
61
+ #
62
+ # - `5m`: 5 minutes
63
+ # - `1h`: 1 hour
64
+ #
65
+ # Defaults to `5m`.
66
+ module TTL
67
+ extend Anthropic::Internal::Type::Enum
68
+
69
+ TaggedSymbol =
70
+ T.type_alias { T.all(Symbol, Anthropic::CacheControlEphemeral::TTL) }
71
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
72
+
73
+ TTL_5M =
74
+ T.let(:"5m", Anthropic::CacheControlEphemeral::TTL::TaggedSymbol)
75
+ TTL_1H =
76
+ T.let(:"1h", Anthropic::CacheControlEphemeral::TTL::TaggedSymbol)
77
+
78
+ sig do
79
+ override.returns(
80
+ T::Array[Anthropic::CacheControlEphemeral::TTL::TaggedSymbol]
81
+ )
82
+ end
83
+ def self.values
84
+ end
85
+ end
21
86
  end
22
87
  end
23
88
  end
@@ -0,0 +1,45 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ class CacheCreation < Anthropic::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Anthropic::CacheCreation, Anthropic::Internal::AnyHash)
9
+ end
10
+
11
+ # The number of input tokens used to create the 1 hour cache entry.
12
+ sig { returns(Integer) }
13
+ attr_accessor :ephemeral_1h_input_tokens
14
+
15
+ # The number of input tokens used to create the 5 minute cache entry.
16
+ sig { returns(Integer) }
17
+ attr_accessor :ephemeral_5m_input_tokens
18
+
19
+ sig do
20
+ params(
21
+ ephemeral_1h_input_tokens: Integer,
22
+ ephemeral_5m_input_tokens: Integer
23
+ ).returns(T.attached_class)
24
+ end
25
+ def self.new(
26
+ # The number of input tokens used to create the 1 hour cache entry.
27
+ ephemeral_1h_input_tokens:,
28
+ # The number of input tokens used to create the 5 minute cache entry.
29
+ ephemeral_5m_input_tokens:
30
+ )
31
+ end
32
+
33
+ sig do
34
+ override.returns(
35
+ {
36
+ ephemeral_1h_input_tokens: Integer,
37
+ ephemeral_5m_input_tokens: Integer
38
+ }
39
+ )
40
+ end
41
+ def to_hash
42
+ end
43
+ end
44
+ end
45
+ end
@@ -20,6 +20,9 @@ module Anthropic
20
20
  sig { returns(Integer) }
21
21
  attr_accessor :end_char_index
22
22
 
23
+ sig { returns(T.nilable(String)) }
24
+ attr_accessor :file_id
25
+
23
26
  sig { returns(Integer) }
24
27
  attr_accessor :start_char_index
25
28
 
@@ -32,6 +35,7 @@ module Anthropic
32
35
  document_index: Integer,
33
36
  document_title: T.nilable(String),
34
37
  end_char_index: Integer,
38
+ file_id: T.nilable(String),
35
39
  start_char_index: Integer,
36
40
  type: Symbol
37
41
  ).returns(T.attached_class)
@@ -41,6 +45,7 @@ module Anthropic
41
45
  document_index:,
42
46
  document_title:,
43
47
  end_char_index:,
48
+ file_id:,
44
49
  start_char_index:,
45
50
  type: :char_location
46
51
  )
@@ -53,6 +58,7 @@ module Anthropic
53
58
  document_index: Integer,
54
59
  document_title: T.nilable(String),
55
60
  end_char_index: Integer,
61
+ file_id: T.nilable(String),
56
62
  start_char_index: Integer,
57
63
  type: Symbol
58
64
  }
@@ -23,6 +23,9 @@ module Anthropic
23
23
  sig { returns(Integer) }
24
24
  attr_accessor :end_block_index
25
25
 
26
+ sig { returns(T.nilable(String)) }
27
+ attr_accessor :file_id
28
+
26
29
  sig { returns(Integer) }
27
30
  attr_accessor :start_block_index
28
31
 
@@ -35,6 +38,7 @@ module Anthropic
35
38
  document_index: Integer,
36
39
  document_title: T.nilable(String),
37
40
  end_block_index: Integer,
41
+ file_id: T.nilable(String),
38
42
  start_block_index: Integer,
39
43
  type: Symbol
40
44
  ).returns(T.attached_class)
@@ -44,6 +48,7 @@ module Anthropic
44
48
  document_index:,
45
49
  document_title:,
46
50
  end_block_index:,
51
+ file_id:,
47
52
  start_block_index:,
48
53
  type: :content_block_location
49
54
  )
@@ -56,6 +61,7 @@ module Anthropic
56
61
  document_index: Integer,
57
62
  document_title: T.nilable(String),
58
63
  end_block_index: Integer,
64
+ file_id: T.nilable(String),
59
65
  start_block_index: Integer,
60
66
  type: Symbol
61
67
  }
@@ -20,6 +20,9 @@ module Anthropic
20
20
  sig { returns(Integer) }
21
21
  attr_accessor :end_page_number
22
22
 
23
+ sig { returns(T.nilable(String)) }
24
+ attr_accessor :file_id
25
+
23
26
  sig { returns(Integer) }
24
27
  attr_accessor :start_page_number
25
28
 
@@ -32,6 +35,7 @@ module Anthropic
32
35
  document_index: Integer,
33
36
  document_title: T.nilable(String),
34
37
  end_page_number: Integer,
38
+ file_id: T.nilable(String),
35
39
  start_page_number: Integer,
36
40
  type: Symbol
37
41
  ).returns(T.attached_class)
@@ -41,6 +45,7 @@ module Anthropic
41
45
  document_index:,
42
46
  document_title:,
43
47
  end_page_number:,
48
+ file_id:,
44
49
  start_page_number:,
45
50
  type: :page_location
46
51
  )
@@ -53,6 +58,7 @@ module Anthropic
53
58
  document_index: Integer,
54
59
  document_title: T.nilable(String),
55
60
  end_page_number: Integer,
61
+ file_id: T.nilable(String),
56
62
  start_page_number: Integer,
57
63
  type: Symbol
58
64
  }
@@ -0,0 +1,74 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ class CitationSearchResultLocationParam < Anthropic::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Anthropic::CitationSearchResultLocationParam,
10
+ Anthropic::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ sig { returns(String) }
15
+ attr_accessor :cited_text
16
+
17
+ sig { returns(Integer) }
18
+ attr_accessor :end_block_index
19
+
20
+ sig { returns(Integer) }
21
+ attr_accessor :search_result_index
22
+
23
+ sig { returns(String) }
24
+ attr_accessor :source
25
+
26
+ sig { returns(Integer) }
27
+ attr_accessor :start_block_index
28
+
29
+ sig { returns(T.nilable(String)) }
30
+ attr_accessor :title
31
+
32
+ sig { returns(Symbol) }
33
+ attr_accessor :type
34
+
35
+ sig do
36
+ params(
37
+ cited_text: String,
38
+ end_block_index: Integer,
39
+ search_result_index: Integer,
40
+ source: String,
41
+ start_block_index: Integer,
42
+ title: T.nilable(String),
43
+ type: Symbol
44
+ ).returns(T.attached_class)
45
+ end
46
+ def self.new(
47
+ cited_text:,
48
+ end_block_index:,
49
+ search_result_index:,
50
+ source:,
51
+ start_block_index:,
52
+ title:,
53
+ type: :search_result_location
54
+ )
55
+ end
56
+
57
+ sig do
58
+ override.returns(
59
+ {
60
+ cited_text: String,
61
+ end_block_index: Integer,
62
+ search_result_index: Integer,
63
+ source: String,
64
+ start_block_index: Integer,
65
+ title: T.nilable(String),
66
+ type: Symbol
67
+ }
68
+ )
69
+ end
70
+ def to_hash
71
+ end
72
+ end
73
+ end
74
+ end
@@ -21,7 +21,8 @@ module Anthropic
21
21
  Anthropic::CitationCharLocation::OrHash,
22
22
  Anthropic::CitationPageLocation::OrHash,
23
23
  Anthropic::CitationContentBlockLocation::OrHash,
24
- Anthropic::CitationsWebSearchResultLocation::OrHash
24
+ Anthropic::CitationsWebSearchResultLocation::OrHash,
25
+ Anthropic::CitationsSearchResultLocation::OrHash
25
26
  ),
26
27
  type: Symbol
27
28
  ).returns(T.attached_class)
@@ -49,7 +50,8 @@ module Anthropic
49
50
  Anthropic::CitationCharLocation,
50
51
  Anthropic::CitationPageLocation,
51
52
  Anthropic::CitationContentBlockLocation,
52
- Anthropic::CitationsWebSearchResultLocation
53
+ Anthropic::CitationsWebSearchResultLocation,
54
+ Anthropic::CitationsSearchResultLocation
53
55
  )
54
56
  end
55
57
 
@@ -0,0 +1,74 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ class CitationsSearchResultLocation < Anthropic::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Anthropic::CitationsSearchResultLocation,
10
+ Anthropic::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ sig { returns(String) }
15
+ attr_accessor :cited_text
16
+
17
+ sig { returns(Integer) }
18
+ attr_accessor :end_block_index
19
+
20
+ sig { returns(Integer) }
21
+ attr_accessor :search_result_index
22
+
23
+ sig { returns(String) }
24
+ attr_accessor :source
25
+
26
+ sig { returns(Integer) }
27
+ attr_accessor :start_block_index
28
+
29
+ sig { returns(T.nilable(String)) }
30
+ attr_accessor :title
31
+
32
+ sig { returns(Symbol) }
33
+ attr_accessor :type
34
+
35
+ sig do
36
+ params(
37
+ cited_text: String,
38
+ end_block_index: Integer,
39
+ search_result_index: Integer,
40
+ source: String,
41
+ start_block_index: Integer,
42
+ title: T.nilable(String),
43
+ type: Symbol
44
+ ).returns(T.attached_class)
45
+ end
46
+ def self.new(
47
+ cited_text:,
48
+ end_block_index:,
49
+ search_result_index:,
50
+ source:,
51
+ start_block_index:,
52
+ title:,
53
+ type: :search_result_location
54
+ )
55
+ end
56
+
57
+ sig do
58
+ override.returns(
59
+ {
60
+ cited_text: String,
61
+ end_block_index: Integer,
62
+ search_result_index: Integer,
63
+ source: String,
64
+ start_block_index: Integer,
65
+ title: T.nilable(String),
66
+ type: Symbol
67
+ }
68
+ )
69
+ end
70
+ def to_hash
71
+ end
72
+ end
73
+ end
74
+ end
@@ -9,11 +9,11 @@ module Anthropic
9
9
  T.type_alias do
10
10
  T.any(
11
11
  Anthropic::TextBlock,
12
+ Anthropic::ThinkingBlock,
13
+ Anthropic::RedactedThinkingBlock,
12
14
  Anthropic::ToolUseBlock,
13
15
  Anthropic::ServerToolUseBlock,
14
- Anthropic::WebSearchToolResultBlock,
15
- Anthropic::ThinkingBlock,
16
- Anthropic::RedactedThinkingBlock
16
+ Anthropic::WebSearchToolResultBlock
17
17
  )
18
18
  end
19
19
 
@@ -9,15 +9,16 @@ module Anthropic
9
9
  Variants =
10
10
  T.type_alias do
11
11
  T.any(
12
- Anthropic::ServerToolUseBlockParam,
13
- Anthropic::WebSearchToolResultBlockParam,
14
12
  Anthropic::TextBlockParam,
15
13
  Anthropic::ImageBlockParam,
16
- Anthropic::ToolUseBlockParam,
17
- Anthropic::ToolResultBlockParam,
18
14
  Anthropic::DocumentBlockParam,
15
+ Anthropic::SearchResultBlockParam,
19
16
  Anthropic::ThinkingBlockParam,
20
- Anthropic::RedactedThinkingBlockParam
17
+ Anthropic::RedactedThinkingBlockParam,
18
+ Anthropic::ToolUseBlockParam,
19
+ Anthropic::ToolResultBlockParam,
20
+ Anthropic::ServerToolUseBlockParam,
21
+ Anthropic::WebSearchToolResultBlockParam
21
22
  )
22
23
  end
23
24
 
@@ -37,7 +37,11 @@ module Anthropic
37
37
  sig { returns(T.nilable(Anthropic::CitationsConfigParam)) }
38
38
  attr_reader :citations
39
39
 
40
- sig { params(citations: Anthropic::CitationsConfigParam::OrHash).void }
40
+ sig do
41
+ params(
42
+ citations: T.nilable(Anthropic::CitationsConfigParam::OrHash)
43
+ ).void
44
+ end
41
45
  attr_writer :citations
42
46
 
43
47
  sig { returns(T.nilable(String)) }
@@ -56,7 +60,7 @@ module Anthropic
56
60
  Anthropic::URLPDFSource::OrHash
57
61
  ),
58
62
  cache_control: T.nilable(Anthropic::CacheControlEphemeral::OrHash),
59
- citations: Anthropic::CitationsConfigParam::OrHash,
63
+ citations: T.nilable(Anthropic::CitationsConfigParam::OrHash),
60
64
  context: T.nilable(String),
61
65
  title: T.nilable(String),
62
66
  type: Symbol
@@ -85,7 +89,7 @@ module Anthropic
85
89
  ),
86
90
  type: Symbol,
87
91
  cache_control: T.nilable(Anthropic::CacheControlEphemeral),
88
- citations: Anthropic::CitationsConfigParam,
92
+ citations: T.nilable(Anthropic::CitationsConfigParam),
89
93
  context: T.nilable(String),
90
94
  title: T.nilable(String)
91
95
  }
@@ -11,6 +11,9 @@ module Anthropic
11
11
  sig { returns(Anthropic::ErrorObject::Variants) }
12
12
  attr_accessor :error
13
13
 
14
+ sig { returns(T.nilable(String)) }
15
+ attr_accessor :request_id
16
+
14
17
  sig { returns(Symbol) }
15
18
  attr_accessor :type
16
19
 
@@ -28,15 +31,20 @@ module Anthropic
28
31
  Anthropic::APIErrorObject::OrHash,
29
32
  Anthropic::OverloadedError::OrHash
30
33
  ),
34
+ request_id: T.nilable(String),
31
35
  type: Symbol
32
36
  ).returns(T.attached_class)
33
37
  end
34
- def self.new(error:, type: :error)
38
+ def self.new(error:, request_id:, type: :error)
35
39
  end
36
40
 
37
41
  sig do
38
42
  override.returns(
39
- { error: Anthropic::ErrorObject::Variants, type: Symbol }
43
+ {
44
+ error: Anthropic::ErrorObject::Variants,
45
+ request_id: T.nilable(String),
46
+ type: Symbol
47
+ }
40
48
  )
41
49
  end
42
50
  def to_hash
@@ -67,6 +67,10 @@ module Anthropic
67
67
  # - `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
68
68
  # - `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
69
69
  # - `"tool_use"`: the model invoked one or more tools
70
+ # - `"pause_turn"`: we paused a long-running turn. You may provide the response
71
+ # back as-is in a subsequent request to let the model continue.
72
+ # - `"refusal"`: when streaming classifiers intervene to handle potential policy
73
+ # violations
70
74
  #
71
75
  # In non-streaming mode this value is always non-null. In streaming mode, it is
72
76
  # null in the `message_start` event and non-null otherwise.
@@ -114,11 +118,11 @@ module Anthropic
114
118
  T::Array[
115
119
  T.any(
116
120
  Anthropic::TextBlock::OrHash,
121
+ Anthropic::ThinkingBlock::OrHash,
122
+ Anthropic::RedactedThinkingBlock::OrHash,
117
123
  Anthropic::ToolUseBlock::OrHash,
118
124
  Anthropic::ServerToolUseBlock::OrHash,
119
- Anthropic::WebSearchToolResultBlock::OrHash,
120
- Anthropic::ThinkingBlock::OrHash,
121
- Anthropic::RedactedThinkingBlock::OrHash
125
+ Anthropic::WebSearchToolResultBlock::OrHash
122
126
  )
123
127
  ],
124
128
  model: T.any(Anthropic::Model::OrSymbol, String),
@@ -179,6 +183,10 @@ module Anthropic
179
183
  # - `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
180
184
  # - `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
181
185
  # - `"tool_use"`: the model invoked one or more tools
186
+ # - `"pause_turn"`: we paused a long-running turn. You may provide the response
187
+ # back as-is in a subsequent request to let the model continue.
188
+ # - `"refusal"`: when streaming classifiers intervene to handle potential policy
189
+ # violations
182
190
  #
183
191
  # In non-streaming mode this value is always non-null. In streaming mode, it is
184
192
  # null in the `message_start` event and non-null otherwise.
@@ -71,37 +71,14 @@ module Anthropic
71
71
  # { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
72
72
  # ```
73
73
  #
74
- # Starting with Claude 3 models, you can also send image content blocks:
75
- #
76
- # ```json
77
- # {
78
- # "role": "user",
79
- # "content": [
80
- # {
81
- # "type": "image",
82
- # "source": {
83
- # "type": "base64",
84
- # "media_type": "image/jpeg",
85
- # "data": "/9j/4AAQSkZJRg..."
86
- # }
87
- # },
88
- # { "type": "text", "text": "What is in this image?" }
89
- # ]
90
- # }
91
- # ```
92
- #
93
- # We currently support the `base64` source type for images, and the `image/jpeg`,
94
- # `image/png`, `image/gif`, and `image/webp` media types.
95
- #
96
- # See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
97
- # more input examples.
74
+ # See [input examples](https://docs.anthropic.com/en/api/messages-examples).
98
75
  #
99
76
  # Note that if you want to include a
100
77
  # [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
101
78
  # the top-level `system` parameter — there is no `"system"` role for input
102
79
  # messages in the Messages API.
103
80
  #
104
- # There is a limit of 100000 messages in a single request.
81
+ # There is a limit of 100,000 messages in a single request.
105
82
  sig { returns(T::Array[Anthropic::MessageParam]) }
106
83
  attr_accessor :messages
107
84
 
@@ -198,6 +175,12 @@ module Anthropic
198
175
  # those tools using the tool input generated by the model and then optionally
199
176
  # return results back to the model using `tool_result` content blocks.
200
177
  #
178
+ # There are two types of tools: **client tools** and **server tools**. The
179
+ # behavior described below applies to client tools. For
180
+ # [server tools](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
181
+ # see their individual documentation as each has its own behavior (e.g., the
182
+ # [web search tool](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
183
+ #
201
184
  # Each tool definition includes:
202
185
  #
203
186
  # - `name`: Name of the tool.
@@ -268,6 +251,8 @@ module Anthropic
268
251
  Anthropic::Tool,
269
252
  Anthropic::ToolBash20250124,
270
253
  Anthropic::ToolTextEditor20250124,
254
+ Anthropic::ToolTextEditor20250429,
255
+ Anthropic::ToolTextEditor20250728,
271
256
  Anthropic::WebSearchTool20250305
272
257
  )
273
258
  ]
@@ -284,6 +269,8 @@ module Anthropic
284
269
  Anthropic::Tool::OrHash,
285
270
  Anthropic::ToolBash20250124::OrHash,
286
271
  Anthropic::ToolTextEditor20250124::OrHash,
272
+ Anthropic::ToolTextEditor20250429::OrHash,
273
+ Anthropic::ToolTextEditor20250728::OrHash,
287
274
  Anthropic::WebSearchTool20250305::OrHash
288
275
  )
289
276
  ]
@@ -314,6 +301,8 @@ module Anthropic
314
301
  Anthropic::Tool::OrHash,
315
302
  Anthropic::ToolBash20250124::OrHash,
316
303
  Anthropic::ToolTextEditor20250124::OrHash,
304
+ Anthropic::ToolTextEditor20250429::OrHash,
305
+ Anthropic::ToolTextEditor20250728::OrHash,
317
306
  Anthropic::WebSearchTool20250305::OrHash
318
307
  )
319
308
  ],
@@ -378,37 +367,14 @@ module Anthropic
378
367
  # { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
379
368
  # ```
380
369
  #
381
- # Starting with Claude 3 models, you can also send image content blocks:
382
- #
383
- # ```json
384
- # {
385
- # "role": "user",
386
- # "content": [
387
- # {
388
- # "type": "image",
389
- # "source": {
390
- # "type": "base64",
391
- # "media_type": "image/jpeg",
392
- # "data": "/9j/4AAQSkZJRg..."
393
- # }
394
- # },
395
- # { "type": "text", "text": "What is in this image?" }
396
- # ]
397
- # }
398
- # ```
399
- #
400
- # We currently support the `base64` source type for images, and the `image/jpeg`,
401
- # `image/png`, `image/gif`, and `image/webp` media types.
402
- #
403
- # See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
404
- # more input examples.
370
+ # See [input examples](https://docs.anthropic.com/en/api/messages-examples).
405
371
  #
406
372
  # Note that if you want to include a
407
373
  # [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
408
374
  # the top-level `system` parameter — there is no `"system"` role for input
409
375
  # messages in the Messages API.
410
376
  #
411
- # There is a limit of 100000 messages in a single request.
377
+ # There is a limit of 100,000 messages in a single request.
412
378
  messages:,
413
379
  # The model that will complete your prompt.\n\nSee
414
380
  # [models](https://docs.anthropic.com/en/docs/models-overview) for additional
@@ -440,6 +406,12 @@ module Anthropic
440
406
  # those tools using the tool input generated by the model and then optionally
441
407
  # return results back to the model using `tool_result` content blocks.
442
408
  #
409
+ # There are two types of tools: **client tools** and **server tools**. The
410
+ # behavior described below applies to client tools. For
411
+ # [server tools](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
412
+ # see their individual documentation as each has its own behavior (e.g., the
413
+ # [web search tool](https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
414
+ #
443
415
  # Each tool definition includes:
444
416
  #
445
417
  # - `name`: Name of the tool.
@@ -531,6 +503,8 @@ module Anthropic
531
503
  Anthropic::Tool,
532
504
  Anthropic::ToolBash20250124,
533
505
  Anthropic::ToolTextEditor20250124,
506
+ Anthropic::ToolTextEditor20250429,
507
+ Anthropic::ToolTextEditor20250728,
534
508
  Anthropic::WebSearchTool20250305
535
509
  )
536
510
  ],
@@ -11,6 +11,8 @@ module Anthropic
11
11
  Anthropic::Tool,
12
12
  Anthropic::ToolBash20250124,
13
13
  Anthropic::ToolTextEditor20250124,
14
+ Anthropic::ToolTextEditor20250429,
15
+ Anthropic::ToolTextEditor20250728,
14
16
  Anthropic::WebSearchTool20250305
15
17
  )
16
18
  end