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,95 @@
1
+ # typed: strong
2
+ # frozen_string_literal: true
3
+ # typed: true
4
+
5
+ module Anthropic
6
+ module Helpers
7
+ module Streaming
8
+ class TextEvent < Anthropic::Internal::Type::BaseModel
9
+ sig { returns(Symbol) }
10
+ attr_accessor :type
11
+
12
+ sig { returns(String) }
13
+ attr_accessor :text
14
+
15
+ sig { returns(String) }
16
+ attr_accessor :snapshot
17
+ end
18
+
19
+ class CitationEvent < Anthropic::Internal::Type::BaseModel
20
+ sig { returns(Symbol) }
21
+ attr_accessor :type
22
+
23
+ sig { returns(Anthropic::CitationsDelta::Citation::Variants) }
24
+ attr_accessor :citation
25
+
26
+ sig { returns(T::Array[Anthropic::CitationsDelta::Citation::Variants]) }
27
+ attr_accessor :snapshot
28
+ end
29
+
30
+ class ThinkingEvent < Anthropic::Internal::Type::BaseModel
31
+ sig { returns(Symbol) }
32
+ attr_accessor :type
33
+
34
+ sig { returns(String) }
35
+ attr_accessor :thinking
36
+
37
+ sig { returns(String) }
38
+ attr_accessor :snapshot
39
+ end
40
+
41
+ class SignatureEvent < Anthropic::Internal::Type::BaseModel
42
+ sig { returns(Symbol) }
43
+ attr_accessor :type
44
+
45
+ sig { returns(String) }
46
+ attr_accessor :signature
47
+ end
48
+
49
+ class InputJsonEvent < Anthropic::Internal::Type::BaseModel
50
+ sig { returns(Symbol) }
51
+ attr_accessor :type
52
+
53
+ sig { returns(String) }
54
+ attr_accessor :partial_json
55
+
56
+ sig { returns(T.untyped) }
57
+ attr_accessor :snapshot
58
+ end
59
+
60
+ class MessageStopEvent < Anthropic::Models::RawMessageStopEvent
61
+ sig { returns(Anthropic::Models::Message) }
62
+ attr_accessor :message
63
+
64
+ sig do
65
+ params(message: Anthropic::Models::Message, type: Symbol).returns(
66
+ T.attached_class
67
+ )
68
+ end
69
+ def self.new(message:, type: :message_stop)
70
+ end
71
+ end
72
+
73
+ class ContentBlockStopEvent < Anthropic::Models::RawContentBlockStopEvent
74
+ sig { returns(Integer) }
75
+ attr_accessor :index
76
+
77
+ sig { returns(Symbol) }
78
+ attr_accessor :type
79
+
80
+ sig { returns(Anthropic::Models::ContentBlock) }
81
+ attr_accessor :content_block
82
+
83
+ sig do
84
+ params(
85
+ index: Integer,
86
+ content_block: Anthropic::Models::ContentBlock,
87
+ type: Symbol
88
+ ).returns(T.attached_class)
89
+ end
90
+ def self.new(index:, content_block:, type: :content_block_stop)
91
+ end
92
+ end
93
+ end
94
+ end
95
+ end
@@ -0,0 +1,73 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Helpers
5
+ module Streaming
6
+ RawMessageEvent =
7
+ T.type_alias do
8
+ T.any(
9
+ Anthropic::Models::RawMessageStartEvent,
10
+ Anthropic::Models::RawMessageDeltaEvent,
11
+ Anthropic::Models::RawMessageStopEvent,
12
+ Anthropic::Models::RawContentBlockStartEvent,
13
+ Anthropic::Models::RawContentBlockDeltaEvent,
14
+ Anthropic::Models::RawContentBlockStopEvent
15
+ )
16
+ end
17
+
18
+ StreamEvent =
19
+ T.type_alias do
20
+ T.any(
21
+ Anthropic::Streaming::RawMessageEvent,
22
+ Anthropic::Streaming::TextEvent,
23
+ Anthropic::Streaming::CitationEvent,
24
+ Anthropic::Streaming::ThinkingEvent,
25
+ Anthropic::Streaming::SignatureEvent,
26
+ Anthropic::Streaming::InputJsonEvent,
27
+ Anthropic::Streaming::MessageStopEvent,
28
+ Anthropic::Streaming::ContentBlockStopEvent
29
+ )
30
+ end
31
+
32
+ class MessageStream
33
+ include Anthropic::Internal::Type::BaseStream
34
+
35
+ Message =
36
+ type_member(:in) { { fixed: Anthropic::Streaming::RawMessageEvent } }
37
+ Elem =
38
+ type_member(:out) { { fixed: Anthropic::Streaming::StreamEvent } }
39
+
40
+ sig do
41
+ params(raw_stream: Anthropic::Internal::Stream[RawMessageEvent]).void
42
+ end
43
+ def initialize(raw_stream:)
44
+ end
45
+
46
+ sig { void }
47
+ def until_done
48
+ end
49
+
50
+ sig { returns(T::Enumerator[String]) }
51
+ def text
52
+ end
53
+
54
+ sig { returns(Anthropic::Models::Message) }
55
+ def accumulated_message
56
+ end
57
+
58
+ sig { returns(String) }
59
+ def accumulated_text
60
+ end
61
+
62
+ sig do
63
+ params(
64
+ event: Anthropic::Streaming::RawMessageEvent,
65
+ current_snapshot: T.nilable(Anthropic::Models::Message)
66
+ ).returns(Anthropic::Models::Message)
67
+ end
68
+ private def accumulate_event(event:, current_snapshot:)
69
+ end
70
+ end
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,16 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Helpers
5
+ # Helpers for the structured output API.
6
+ #
7
+ # see https://platform.Anthropic.com/docs/guides/structured-outputs
8
+ # see https://json-schema.org
9
+ #
10
+ # Based on the DSL in {Anthropic::Internal::Type}, but currently only support the limited subset of JSON schema types used in structured output APIs.
11
+ #
12
+ # Supported types: {NilClass} {String} {Symbol} {Integer} {Float} {Anthropic::Boolean}, {Anthropic::EnumOf}, {Anthropic::UnionOf}, {Anthropic::ArrayOf}, {Anthropic::BaseModel}
13
+ module InputSchema
14
+ end
15
+ end
16
+ end
@@ -21,16 +21,26 @@ module Anthropic
21
21
  # @api private
22
22
  sig do
23
23
  override
24
- .params(req: Anthropic::Internal::Transport::BaseClient::RequestComponents, opts: Anthropic::Internal::AnyHash)
24
+ .params(
25
+ req:
26
+ Anthropic::Internal::Transport::BaseClient::RequestComponents,
27
+ opts: Anthropic::Internal::AnyHash
28
+ )
25
29
  .returns(Anthropic::Internal::Transport::BaseClient::RequestInput)
26
30
  end
27
- private def build_request(req, opts); end
31
+ private def build_request(req, opts)
32
+ end
28
33
 
29
34
  sig do
30
- params(request_components: Anthropic::Internal::Transport::BaseClient::RequestComponents)
31
- .returns(Anthropic::Internal::Transport::BaseClient::RequestComponents)
35
+ params(
36
+ request_components:
37
+ Anthropic::Internal::Transport::BaseClient::RequestComponents
38
+ ).returns(
39
+ Anthropic::Internal::Transport::BaseClient::RequestComponents
40
+ )
41
+ end
42
+ private def fit_req_to_vertex_specs!(request_components)
32
43
  end
33
- private def fit_req_to_vertex_specs!(request_components) end
34
44
 
35
45
  sig do
36
46
  params(
@@ -51,7 +61,8 @@ module Anthropic
51
61
  timeout: Anthropic::Client::DEFAULT_TIMEOUT_IN_SECONDS,
52
62
  initial_retry_delay: Anthropic::Client::DEFAULT_INITIAL_RETRY_DELAY,
53
63
  max_retry_delay: Anthropic::Client::DEFAULT_MAX_RETRY_DELAY
54
- ) end
64
+ )
65
+ end
55
66
  end
56
67
  end
57
68
  end
@@ -0,0 +1,12 @@
1
+ # typed: strong
2
+ # frozen_string_literal: true
3
+
4
+ module Anthropic
5
+ # Convenience aliases for input schema classes
6
+ InputSchema = Anthropic::Helpers::InputSchema
7
+ ArrayOf = Anthropic::Helpers::InputSchema::ArrayOf
8
+ BaseModel = Anthropic::Helpers::InputSchema::BaseModel
9
+ Boolean = Anthropic::Helpers::InputSchema::Boolean
10
+ EnumOf = Anthropic::Helpers::InputSchema::EnumOf
11
+ UnionOf = Anthropic::Helpers::InputSchema::UnionOf
12
+ end
@@ -222,7 +222,7 @@ module Anthropic
222
222
  send_retry_header: T::Boolean
223
223
  ).returns([Integer, Net::HTTPResponse, T::Enumerable[String]])
224
224
  end
225
- private def send_request(
225
+ def send_request(
226
226
  request,
227
227
  redirect_count:,
228
228
  retry_count:,
@@ -52,10 +52,17 @@ module Anthropic
52
52
  url: URI::Generic,
53
53
  status: Integer,
54
54
  response: Net::HTTPResponse,
55
+ unwrap:
56
+ T.any(
57
+ Symbol,
58
+ Integer,
59
+ T::Array[T.any(Symbol, Integer)],
60
+ T.proc.params(arg0: T.anything).returns(T.anything)
61
+ ),
55
62
  stream: T::Enumerable[Message]
56
63
  ).void
57
64
  end
58
- def initialize(model:, url:, status:, response:, stream:)
65
+ def initialize(model:, url:, status:, response:, unwrap:, stream:)
59
66
  end
60
67
 
61
68
  # @api private
@@ -22,6 +22,8 @@ module Anthropic
22
22
 
23
23
  class << self
24
24
  # @api private
25
+ #
26
+ # Coerce value to Boolean if possible, otherwise return the original value.
25
27
  sig do
26
28
  override
27
29
  .params(
@@ -15,12 +15,14 @@ module Anthropic
15
15
  CoerceState =
16
16
  T.type_alias do
17
17
  {
18
- strictness: T.any(T::Boolean, Symbol),
18
+ translate_names: T::Boolean,
19
+ strictness: T::Boolean,
19
20
  exactness: {
20
21
  yes: Integer,
21
22
  no: Integer,
22
23
  maybe: Integer
23
24
  },
25
+ error: T::Class[StandardError],
24
26
  branched: Integer
25
27
  }
26
28
  end
@@ -88,6 +90,69 @@ module Anthropic
88
90
  def self.type_info(spec)
89
91
  end
90
92
 
93
+ # @api private
94
+ sig do
95
+ params(
96
+ type_info:
97
+ T.any(
98
+ {
99
+ const:
100
+ T.nilable(
101
+ T.any(NilClass, T::Boolean, Integer, Float, Symbol)
102
+ ),
103
+ enum:
104
+ T.nilable(
105
+ T.proc.returns(
106
+ Anthropic::Internal::Type::Converter::Input
107
+ )
108
+ ),
109
+ union:
110
+ T.nilable(
111
+ T.proc.returns(
112
+ Anthropic::Internal::Type::Converter::Input
113
+ )
114
+ )
115
+ },
116
+ T.proc.returns(Anthropic::Internal::Type::Converter::Input),
117
+ Anthropic::Internal::Type::Converter::Input
118
+ ),
119
+ spec:
120
+ T.any(
121
+ {
122
+ const:
123
+ T.nilable(
124
+ T.any(NilClass, T::Boolean, Integer, Float, Symbol)
125
+ ),
126
+ enum:
127
+ T.nilable(
128
+ T.proc.returns(
129
+ Anthropic::Internal::Type::Converter::Input
130
+ )
131
+ ),
132
+ union:
133
+ T.nilable(
134
+ T.proc.returns(
135
+ Anthropic::Internal::Type::Converter::Input
136
+ )
137
+ )
138
+ },
139
+ T.proc.returns(Anthropic::Internal::Type::Converter::Input),
140
+ Anthropic::Internal::Type::Converter::Input
141
+ )
142
+ ).returns(Anthropic::Internal::AnyHash)
143
+ end
144
+ def self.meta_info(type_info, spec)
145
+ end
146
+
147
+ # @api private
148
+ sig do
149
+ params(translate_names: T::Boolean).returns(
150
+ Anthropic::Internal::Type::Converter::CoerceState
151
+ )
152
+ end
153
+ def self.new_coerce_state(translate_names: true)
154
+ end
155
+
91
156
  # @api private
92
157
  #
93
158
  # Based on `target`, transform `value` into `target`, to the extent possible:
@@ -109,14 +174,11 @@ module Anthropic
109
174
  def self.coerce(
110
175
  target,
111
176
  value,
112
- # The `strictness` is one of `true`, `false`, or `:strong`. This informs the
113
- # coercion strategy when we have to decide between multiple possible conversion
114
- # targets:
177
+ # The `strictness` is one of `true`, `false`. This informs the coercion strategy
178
+ # when we have to decide between multiple possible conversion targets:
115
179
  #
116
180
  # - `true`: the conversion must be exact, with minimum coercion.
117
181
  # - `false`: the conversion can be approximate, with some coercion.
118
- # - `:strong`: the conversion must be exact, with no coercion, and raise an error
119
- # if not possible.
120
182
  #
121
183
  # The `exactness` is `Hash` with keys being one of `yes`, `no`, or `maybe`. For
122
184
  # any given conversion attempt, the exactness will be updated based on how closely
@@ -128,15 +190,7 @@ module Anthropic
128
190
  # - `no`: the value cannot be converted to the target type.
129
191
  #
130
192
  # See implementation below for more details.
131
- state: {
132
- strictness: true,
133
- exactness: {
134
- yes: 0,
135
- no: 0,
136
- maybe: 0
137
- },
138
- branched: 0
139
- }
193
+ state: Anthropic::Internal::Type::Converter.new_coerce_state
140
194
  )
141
195
  end
142
196
 
@@ -16,7 +16,8 @@ module Anthropic
16
16
  T::Array[
17
17
  [
18
18
  T.nilable(Symbol),
19
- T.proc.returns(Anthropic::Internal::Type::Converter::Input)
19
+ T.proc.returns(Anthropic::Internal::Type::Converter::Input),
20
+ Anthropic::Internal::AnyHash
20
21
  ]
21
22
  ]
22
23
  )
@@ -25,7 +26,13 @@ module Anthropic
25
26
  end
26
27
 
27
28
  # @api private
28
- sig { returns(T::Array[[T.nilable(Symbol), T.anything]]) }
29
+ sig do
30
+ returns(
31
+ T::Array[
32
+ [T.nilable(Symbol), T.anything, Anthropic::Internal::AnyHash]
33
+ ]
34
+ )
35
+ end
29
36
  protected def derefed_variants
30
37
  end
31
38
 
@@ -78,6 +85,11 @@ module Anthropic
78
85
  end
79
86
 
80
87
  # @api private
88
+ #
89
+ # Tries to efficiently coerce the given value to one of the known variants.
90
+ #
91
+ # If the value cannot match any of the known variants, the coercion is considered
92
+ # non-viable and returns the original value.
81
93
  sig do
82
94
  override
83
95
  .params(
@@ -22,6 +22,8 @@ module Anthropic
22
22
 
23
23
  class << self
24
24
  # @api private
25
+ #
26
+ # No coercion needed for Unknown type.
25
27
  sig do
26
28
  override
27
29
  .params(
@@ -332,6 +332,8 @@ module Anthropic
332
332
  end
333
333
 
334
334
  # @api private
335
+ #
336
+ # https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#special-considerations-for-multipart-content
335
337
  sig do
336
338
  params(body: T.anything).returns([String, T::Enumerable[String]])
337
339
  end
@@ -73,6 +73,8 @@ module Anthropic
73
73
  :"extended-cache-ttl-2025-04-11",
74
74
  Anthropic::AnthropicBeta::TaggedSymbol
75
75
  )
76
+ CONTEXT_1M_2025_08_07 =
77
+ T.let(:"context-1m-2025-08-07", Anthropic::AnthropicBeta::TaggedSymbol)
76
78
  end
77
79
  end
78
80
  end
@@ -5,134 +5,7 @@ module Anthropic
5
5
  BetaBase64PDFBlock = Beta::BetaBase64PDFBlock
6
6
 
7
7
  module Beta
8
- class BetaBase64PDFBlock < Anthropic::Internal::Type::BaseModel
9
- OrHash =
10
- T.type_alias do
11
- T.any(
12
- Anthropic::Beta::BetaBase64PDFBlock,
13
- Anthropic::Internal::AnyHash
14
- )
15
- end
16
-
17
- sig do
18
- returns(
19
- T.any(
20
- Anthropic::Beta::BetaBase64PDFSource,
21
- Anthropic::Beta::BetaPlainTextSource,
22
- Anthropic::Beta::BetaContentBlockSource,
23
- Anthropic::Beta::BetaURLPDFSource,
24
- Anthropic::Beta::BetaFileDocumentSource
25
- )
26
- )
27
- end
28
- attr_accessor :source
29
-
30
- sig { returns(Symbol) }
31
- attr_accessor :type
32
-
33
- # Create a cache control breakpoint at this content block.
34
- sig { returns(T.nilable(Anthropic::Beta::BetaCacheControlEphemeral)) }
35
- attr_reader :cache_control
36
-
37
- sig do
38
- params(
39
- cache_control:
40
- T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash)
41
- ).void
42
- end
43
- attr_writer :cache_control
44
-
45
- sig { returns(T.nilable(Anthropic::Beta::BetaCitationsConfigParam)) }
46
- attr_reader :citations
47
-
48
- sig do
49
- params(
50
- citations: Anthropic::Beta::BetaCitationsConfigParam::OrHash
51
- ).void
52
- end
53
- attr_writer :citations
54
-
55
- sig { returns(T.nilable(String)) }
56
- attr_accessor :context
57
-
58
- sig { returns(T.nilable(String)) }
59
- attr_accessor :title
60
-
61
- sig do
62
- params(
63
- source:
64
- T.any(
65
- Anthropic::Beta::BetaBase64PDFSource::OrHash,
66
- Anthropic::Beta::BetaPlainTextSource::OrHash,
67
- Anthropic::Beta::BetaContentBlockSource::OrHash,
68
- Anthropic::Beta::BetaURLPDFSource::OrHash,
69
- Anthropic::Beta::BetaFileDocumentSource::OrHash
70
- ),
71
- cache_control:
72
- T.nilable(Anthropic::Beta::BetaCacheControlEphemeral::OrHash),
73
- citations: Anthropic::Beta::BetaCitationsConfigParam::OrHash,
74
- context: T.nilable(String),
75
- title: T.nilable(String),
76
- type: Symbol
77
- ).returns(T.attached_class)
78
- end
79
- def self.new(
80
- source:,
81
- # Create a cache control breakpoint at this content block.
82
- cache_control: nil,
83
- citations: nil,
84
- context: nil,
85
- title: nil,
86
- type: :document
87
- )
88
- end
89
-
90
- sig do
91
- override.returns(
92
- {
93
- source:
94
- T.any(
95
- Anthropic::Beta::BetaBase64PDFSource,
96
- Anthropic::Beta::BetaPlainTextSource,
97
- Anthropic::Beta::BetaContentBlockSource,
98
- Anthropic::Beta::BetaURLPDFSource,
99
- Anthropic::Beta::BetaFileDocumentSource
100
- ),
101
- type: Symbol,
102
- cache_control:
103
- T.nilable(Anthropic::Beta::BetaCacheControlEphemeral),
104
- citations: Anthropic::Beta::BetaCitationsConfigParam,
105
- context: T.nilable(String),
106
- title: T.nilable(String)
107
- }
108
- )
109
- end
110
- def to_hash
111
- end
112
-
113
- module Source
114
- extend Anthropic::Internal::Type::Union
115
-
116
- Variants =
117
- T.type_alias do
118
- T.any(
119
- Anthropic::Beta::BetaBase64PDFSource,
120
- Anthropic::Beta::BetaPlainTextSource,
121
- Anthropic::Beta::BetaContentBlockSource,
122
- Anthropic::Beta::BetaURLPDFSource,
123
- Anthropic::Beta::BetaFileDocumentSource
124
- )
125
- end
126
-
127
- sig do
128
- override.returns(
129
- T::Array[Anthropic::Beta::BetaBase64PDFBlock::Source::Variants]
130
- )
131
- end
132
- def self.variants
133
- end
134
- end
135
- end
8
+ BetaBase64PDFBlock = Anthropic::Models::Beta::BetaRequestDocumentBlock
136
9
  end
137
10
  end
138
11
  end
@@ -0,0 +1,33 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ BetaBashCodeExecutionOutputBlock = Beta::BetaBashCodeExecutionOutputBlock
6
+
7
+ module Beta
8
+ class BetaBashCodeExecutionOutputBlock < Anthropic::Internal::Type::BaseModel
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(
12
+ Anthropic::Beta::BetaBashCodeExecutionOutputBlock,
13
+ Anthropic::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ sig { returns(String) }
18
+ attr_accessor :file_id
19
+
20
+ sig { returns(Symbol) }
21
+ attr_accessor :type
22
+
23
+ sig { params(file_id: String, type: Symbol).returns(T.attached_class) }
24
+ def self.new(file_id:, type: :bash_code_execution_output)
25
+ end
26
+
27
+ sig { override.returns({ file_id: String, type: Symbol }) }
28
+ def to_hash
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,34 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Models
5
+ BetaBashCodeExecutionOutputBlockParam =
6
+ Beta::BetaBashCodeExecutionOutputBlockParam
7
+
8
+ module Beta
9
+ class BetaBashCodeExecutionOutputBlockParam < Anthropic::Internal::Type::BaseModel
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Anthropic::Beta::BetaBashCodeExecutionOutputBlockParam,
14
+ Anthropic::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :file_id
20
+
21
+ sig { returns(Symbol) }
22
+ attr_accessor :type
23
+
24
+ sig { params(file_id: String, type: Symbol).returns(T.attached_class) }
25
+ def self.new(file_id:, type: :bash_code_execution_output)
26
+ end
27
+
28
+ sig { override.returns({ file_id: String, type: Symbol }) }
29
+ def to_hash
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end