anthropic-sdk-beta 0.1.0.pre.beta.3

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 (689) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +343 -0
  3. data/lib/anthropic/bedrock/client.rb +261 -0
  4. data/lib/anthropic/client.rb +107 -0
  5. data/lib/anthropic/errors.rb +192 -0
  6. data/lib/anthropic/internal/jsonl_stream.rb +26 -0
  7. data/lib/anthropic/internal/page.rb +109 -0
  8. data/lib/anthropic/internal/stream.rb +58 -0
  9. data/lib/anthropic/internal/transport/base_client.rb +473 -0
  10. data/lib/anthropic/internal/transport/pooled_net_requester.rb +193 -0
  11. data/lib/anthropic/internal/type/array_of.rb +128 -0
  12. data/lib/anthropic/internal/type/base_model.rb +380 -0
  13. data/lib/anthropic/internal/type/base_page.rb +46 -0
  14. data/lib/anthropic/internal/type/base_stream.rb +73 -0
  15. data/lib/anthropic/internal/type/boolean.rb +58 -0
  16. data/lib/anthropic/internal/type/converter.rb +247 -0
  17. data/lib/anthropic/internal/type/enum.rb +113 -0
  18. data/lib/anthropic/internal/type/hash_of.rb +148 -0
  19. data/lib/anthropic/internal/type/io_like.rb +75 -0
  20. data/lib/anthropic/internal/type/request_parameters.rb +49 -0
  21. data/lib/anthropic/internal/type/union.rb +216 -0
  22. data/lib/anthropic/internal/type/unknown.rb +62 -0
  23. data/lib/anthropic/internal/util.rb +755 -0
  24. data/lib/anthropic/internal.rb +8 -0
  25. data/lib/anthropic/models/anthropic_beta.rb +44 -0
  26. data/lib/anthropic/models/api_error_object.rb +25 -0
  27. data/lib/anthropic/models/authentication_error.rb +25 -0
  28. data/lib/anthropic/models/base64_image_source.rb +47 -0
  29. data/lib/anthropic/models/base64_pdf_source.rb +31 -0
  30. data/lib/anthropic/models/beta/beta_base64_image_source.rb +51 -0
  31. data/lib/anthropic/models/beta/beta_base64_pdf_block.rb +76 -0
  32. data/lib/anthropic/models/beta/beta_base64_pdf_source.rb +35 -0
  33. data/lib/anthropic/models/beta/beta_cache_control_ephemeral.rb +23 -0
  34. data/lib/anthropic/models/beta/beta_citation_char_location.rb +63 -0
  35. data/lib/anthropic/models/beta/beta_citation_char_location_param.rb +63 -0
  36. data/lib/anthropic/models/beta/beta_citation_content_block_location.rb +63 -0
  37. data/lib/anthropic/models/beta/beta_citation_content_block_location_param.rb +63 -0
  38. data/lib/anthropic/models/beta/beta_citation_page_location.rb +63 -0
  39. data/lib/anthropic/models/beta/beta_citation_page_location_param.rb +63 -0
  40. data/lib/anthropic/models/beta/beta_citations_config_param.rb +27 -0
  41. data/lib/anthropic/models/beta/beta_citations_delta.rb +46 -0
  42. data/lib/anthropic/models/beta/beta_content_block.rb +27 -0
  43. data/lib/anthropic/models/beta/beta_content_block_param.rb +33 -0
  44. data/lib/anthropic/models/beta/beta_content_block_source.rb +45 -0
  45. data/lib/anthropic/models/beta/beta_content_block_source_content.rb +23 -0
  46. data/lib/anthropic/models/beta/beta_image_block_param.rb +50 -0
  47. data/lib/anthropic/models/beta/beta_input_json_delta.rb +29 -0
  48. data/lib/anthropic/models/beta/beta_message.rb +143 -0
  49. data/lib/anthropic/models/beta/beta_message_delta_usage.rb +24 -0
  50. data/lib/anthropic/models/beta/beta_message_param.rb +59 -0
  51. data/lib/anthropic/models/beta/beta_message_tokens_count.rb +26 -0
  52. data/lib/anthropic/models/beta/beta_metadata.rb +28 -0
  53. data/lib/anthropic/models/beta/beta_model_info.rb +49 -0
  54. data/lib/anthropic/models/beta/beta_plain_text_source.rb +35 -0
  55. data/lib/anthropic/models/beta/beta_raw_content_block_delta.rb +29 -0
  56. data/lib/anthropic/models/beta/beta_raw_content_block_delta_event.rb +35 -0
  57. data/lib/anthropic/models/beta/beta_raw_content_block_start_event.rb +55 -0
  58. data/lib/anthropic/models/beta/beta_raw_content_block_stop_event.rb +29 -0
  59. data/lib/anthropic/models/beta/beta_raw_message_delta_event.rb +71 -0
  60. data/lib/anthropic/models/beta/beta_raw_message_start_event.rb +29 -0
  61. data/lib/anthropic/models/beta/beta_raw_message_stop_event.rb +23 -0
  62. data/lib/anthropic/models/beta/beta_raw_message_stream_event.rb +31 -0
  63. data/lib/anthropic/models/beta/beta_redacted_thinking_block.rb +29 -0
  64. data/lib/anthropic/models/beta/beta_redacted_thinking_block_param.rb +29 -0
  65. data/lib/anthropic/models/beta/beta_signature_delta.rb +29 -0
  66. data/lib/anthropic/models/beta/beta_stop_reason.rb +24 -0
  67. data/lib/anthropic/models/beta/beta_text_block.rb +42 -0
  68. data/lib/anthropic/models/beta/beta_text_block_param.rb +43 -0
  69. data/lib/anthropic/models/beta/beta_text_citation.rb +25 -0
  70. data/lib/anthropic/models/beta/beta_text_citation_param.rb +25 -0
  71. data/lib/anthropic/models/beta/beta_text_delta.rb +29 -0
  72. data/lib/anthropic/models/beta/beta_thinking_block.rb +35 -0
  73. data/lib/anthropic/models/beta/beta_thinking_block_param.rb +35 -0
  74. data/lib/anthropic/models/beta/beta_thinking_config_disabled.rb +23 -0
  75. data/lib/anthropic/models/beta/beta_thinking_config_enabled.rb +38 -0
  76. data/lib/anthropic/models/beta/beta_thinking_config_param.rb +32 -0
  77. data/lib/anthropic/models/beta/beta_thinking_delta.rb +29 -0
  78. data/lib/anthropic/models/beta/beta_tool.rb +103 -0
  79. data/lib/anthropic/models/beta/beta_tool_bash_20241022.rb +38 -0
  80. data/lib/anthropic/models/beta/beta_tool_bash_20250124.rb +38 -0
  81. data/lib/anthropic/models/beta/beta_tool_choice.rb +33 -0
  82. data/lib/anthropic/models/beta/beta_tool_choice_any.rb +39 -0
  83. data/lib/anthropic/models/beta/beta_tool_choice_auto.rb +39 -0
  84. data/lib/anthropic/models/beta/beta_tool_choice_none.rb +25 -0
  85. data/lib/anthropic/models/beta/beta_tool_choice_tool.rb +46 -0
  86. data/lib/anthropic/models/beta/beta_tool_computer_use_20241022.rb +69 -0
  87. data/lib/anthropic/models/beta/beta_tool_computer_use_20250124.rb +69 -0
  88. data/lib/anthropic/models/beta/beta_tool_result_block_param.rb +85 -0
  89. data/lib/anthropic/models/beta/beta_tool_text_editor_20241022.rb +38 -0
  90. data/lib/anthropic/models/beta/beta_tool_text_editor_20250124.rb +38 -0
  91. data/lib/anthropic/models/beta/beta_tool_union.rb +31 -0
  92. data/lib/anthropic/models/beta/beta_tool_use_block.rb +41 -0
  93. data/lib/anthropic/models/beta/beta_tool_use_block_param.rb +47 -0
  94. data/lib/anthropic/models/beta/beta_url_image_source.rb +29 -0
  95. data/lib/anthropic/models/beta/beta_url_pdf_source.rb +29 -0
  96. data/lib/anthropic/models/beta/beta_usage.rb +45 -0
  97. data/lib/anthropic/models/beta/message_count_tokens_params.rb +315 -0
  98. data/lib/anthropic/models/beta/message_create_params.rb +395 -0
  99. data/lib/anthropic/models/beta/messages/batch_cancel_params.rb +34 -0
  100. data/lib/anthropic/models/beta/messages/batch_create_params.rb +463 -0
  101. data/lib/anthropic/models/beta/messages/batch_delete_params.rb +34 -0
  102. data/lib/anthropic/models/beta/messages/batch_list_params.rb +71 -0
  103. data/lib/anthropic/models/beta/messages/batch_results_params.rb +34 -0
  104. data/lib/anthropic/models/beta/messages/batch_retrieve_params.rb +34 -0
  105. data/lib/anthropic/models/beta/messages/beta_deleted_message_batch.rb +34 -0
  106. data/lib/anthropic/models/beta/messages/beta_message_batch.rb +140 -0
  107. data/lib/anthropic/models/beta/messages/beta_message_batch_canceled_result.rb +23 -0
  108. data/lib/anthropic/models/beta/messages/beta_message_batch_errored_result.rb +29 -0
  109. data/lib/anthropic/models/beta/messages/beta_message_batch_expired_result.rb +23 -0
  110. data/lib/anthropic/models/beta/messages/beta_message_batch_individual_response.rb +42 -0
  111. data/lib/anthropic/models/beta/messages/beta_message_batch_request_counts.rb +60 -0
  112. data/lib/anthropic/models/beta/messages/beta_message_batch_result.rb +32 -0
  113. data/lib/anthropic/models/beta/messages/beta_message_batch_succeeded_result.rb +29 -0
  114. data/lib/anthropic/models/beta/model_list_params.rb +58 -0
  115. data/lib/anthropic/models/beta/model_retrieve_params.rb +21 -0
  116. data/lib/anthropic/models/beta_api_error.rb +25 -0
  117. data/lib/anthropic/models/beta_authentication_error.rb +25 -0
  118. data/lib/anthropic/models/beta_billing_error.rb +25 -0
  119. data/lib/anthropic/models/beta_error.rb +33 -0
  120. data/lib/anthropic/models/beta_error_response.rb +25 -0
  121. data/lib/anthropic/models/beta_gateway_timeout_error.rb +25 -0
  122. data/lib/anthropic/models/beta_invalid_request_error.rb +25 -0
  123. data/lib/anthropic/models/beta_not_found_error.rb +25 -0
  124. data/lib/anthropic/models/beta_overloaded_error.rb +25 -0
  125. data/lib/anthropic/models/beta_permission_error.rb +25 -0
  126. data/lib/anthropic/models/beta_rate_limit_error.rb +25 -0
  127. data/lib/anthropic/models/billing_error.rb +25 -0
  128. data/lib/anthropic/models/cache_control_ephemeral.rb +19 -0
  129. data/lib/anthropic/models/citation_char_location.rb +59 -0
  130. data/lib/anthropic/models/citation_char_location_param.rb +59 -0
  131. data/lib/anthropic/models/citation_content_block_location.rb +59 -0
  132. data/lib/anthropic/models/citation_content_block_location_param.rb +59 -0
  133. data/lib/anthropic/models/citation_page_location.rb +59 -0
  134. data/lib/anthropic/models/citation_page_location_param.rb +59 -0
  135. data/lib/anthropic/models/citations_config_param.rb +23 -0
  136. data/lib/anthropic/models/citations_delta.rb +42 -0
  137. data/lib/anthropic/models/completion.rb +63 -0
  138. data/lib/anthropic/models/completion_create_params.rb +152 -0
  139. data/lib/anthropic/models/content_block.rb +23 -0
  140. data/lib/anthropic/models/content_block_param.rb +29 -0
  141. data/lib/anthropic/models/content_block_source.rb +41 -0
  142. data/lib/anthropic/models/content_block_source_content.rb +19 -0
  143. data/lib/anthropic/models/document_block_param.rb +72 -0
  144. data/lib/anthropic/models/error_object.rb +33 -0
  145. data/lib/anthropic/models/error_response.rb +25 -0
  146. data/lib/anthropic/models/gateway_timeout_error.rb +25 -0
  147. data/lib/anthropic/models/image_block_param.rb +46 -0
  148. data/lib/anthropic/models/input_json_delta.rb +25 -0
  149. data/lib/anthropic/models/invalid_request_error.rb +25 -0
  150. data/lib/anthropic/models/message.rb +138 -0
  151. data/lib/anthropic/models/message_count_tokens_params.rb +265 -0
  152. data/lib/anthropic/models/message_count_tokens_tool.rb +19 -0
  153. data/lib/anthropic/models/message_create_params.rb +380 -0
  154. data/lib/anthropic/models/message_delta_usage.rb +20 -0
  155. data/lib/anthropic/models/message_param.rb +55 -0
  156. data/lib/anthropic/models/message_tokens_count.rb +22 -0
  157. data/lib/anthropic/models/messages/batch_cancel_params.rb +21 -0
  158. data/lib/anthropic/models/messages/batch_create_params.rb +449 -0
  159. data/lib/anthropic/models/messages/batch_delete_params.rb +21 -0
  160. data/lib/anthropic/models/messages/batch_list_params.rb +58 -0
  161. data/lib/anthropic/models/messages/batch_results_params.rb +21 -0
  162. data/lib/anthropic/models/messages/batch_retrieve_params.rb +21 -0
  163. data/lib/anthropic/models/messages/deleted_message_batch.rb +32 -0
  164. data/lib/anthropic/models/messages/message_batch.rb +139 -0
  165. data/lib/anthropic/models/messages/message_batch_canceled_result.rb +23 -0
  166. data/lib/anthropic/models/messages/message_batch_errored_result.rb +29 -0
  167. data/lib/anthropic/models/messages/message_batch_expired_result.rb +23 -0
  168. data/lib/anthropic/models/messages/message_batch_individual_response.rb +42 -0
  169. data/lib/anthropic/models/messages/message_batch_request_counts.rb +60 -0
  170. data/lib/anthropic/models/messages/message_batch_result.rb +32 -0
  171. data/lib/anthropic/models/messages/message_batch_succeeded_result.rb +29 -0
  172. data/lib/anthropic/models/metadata.rb +24 -0
  173. data/lib/anthropic/models/model.rb +93 -0
  174. data/lib/anthropic/models/model_info.rb +45 -0
  175. data/lib/anthropic/models/model_list_params.rb +56 -0
  176. data/lib/anthropic/models/model_retrieve_params.rb +19 -0
  177. data/lib/anthropic/models/not_found_error.rb +25 -0
  178. data/lib/anthropic/models/overloaded_error.rb +25 -0
  179. data/lib/anthropic/models/permission_error.rb +25 -0
  180. data/lib/anthropic/models/plain_text_source.rb +31 -0
  181. data/lib/anthropic/models/rate_limit_error.rb +25 -0
  182. data/lib/anthropic/models/raw_content_block_delta.rb +25 -0
  183. data/lib/anthropic/models/raw_content_block_delta_event.rb +31 -0
  184. data/lib/anthropic/models/raw_content_block_start_event.rb +50 -0
  185. data/lib/anthropic/models/raw_content_block_stop_event.rb +25 -0
  186. data/lib/anthropic/models/raw_message_delta_event.rb +67 -0
  187. data/lib/anthropic/models/raw_message_start_event.rb +25 -0
  188. data/lib/anthropic/models/raw_message_stop_event.rb +19 -0
  189. data/lib/anthropic/models/raw_message_stream_event.rb +27 -0
  190. data/lib/anthropic/models/redacted_thinking_block.rb +25 -0
  191. data/lib/anthropic/models/redacted_thinking_block_param.rb +25 -0
  192. data/lib/anthropic/models/signature_delta.rb +25 -0
  193. data/lib/anthropic/models/stop_reason.rb +20 -0
  194. data/lib/anthropic/models/text_block.rb +38 -0
  195. data/lib/anthropic/models/text_block_param.rb +39 -0
  196. data/lib/anthropic/models/text_citation.rb +21 -0
  197. data/lib/anthropic/models/text_citation_param.rb +21 -0
  198. data/lib/anthropic/models/text_delta.rb +25 -0
  199. data/lib/anthropic/models/thinking_block.rb +31 -0
  200. data/lib/anthropic/models/thinking_block_param.rb +31 -0
  201. data/lib/anthropic/models/thinking_config_disabled.rb +19 -0
  202. data/lib/anthropic/models/thinking_config_enabled.rb +34 -0
  203. data/lib/anthropic/models/thinking_config_param.rb +28 -0
  204. data/lib/anthropic/models/thinking_delta.rb +25 -0
  205. data/lib/anthropic/models/tool.rb +80 -0
  206. data/lib/anthropic/models/tool_bash_20250124.rb +34 -0
  207. data/lib/anthropic/models/tool_choice.rb +29 -0
  208. data/lib/anthropic/models/tool_choice_any.rb +35 -0
  209. data/lib/anthropic/models/tool_choice_auto.rb +35 -0
  210. data/lib/anthropic/models/tool_choice_none.rb +21 -0
  211. data/lib/anthropic/models/tool_choice_tool.rb +42 -0
  212. data/lib/anthropic/models/tool_result_block_param.rb +81 -0
  213. data/lib/anthropic/models/tool_text_editor_20250124.rb +34 -0
  214. data/lib/anthropic/models/tool_union.rb +19 -0
  215. data/lib/anthropic/models/tool_use_block.rb +37 -0
  216. data/lib/anthropic/models/tool_use_block_param.rb +43 -0
  217. data/lib/anthropic/models/url_image_source.rb +25 -0
  218. data/lib/anthropic/models/url_pdf_source.rb +25 -0
  219. data/lib/anthropic/models/usage.rb +41 -0
  220. data/lib/anthropic/request_options.rb +75 -0
  221. data/lib/anthropic/resources/beta/messages/batches.rb +198 -0
  222. data/lib/anthropic/resources/beta/messages.rb +158 -0
  223. data/lib/anthropic/resources/beta/models.rb +65 -0
  224. data/lib/anthropic/resources/beta.rb +22 -0
  225. data/lib/anthropic/resources/completions.rb +100 -0
  226. data/lib/anthropic/resources/messages/batches.rb +179 -0
  227. data/lib/anthropic/resources/messages.rb +145 -0
  228. data/lib/anthropic/resources/models.rb +63 -0
  229. data/lib/anthropic/version.rb +5 -0
  230. data/lib/anthropic/vertex/client.rb +210 -0
  231. data/lib/anthropic.rb +265 -0
  232. data/manifest.yaml +15 -0
  233. data/rbi/lib/anthropic/bedrock/client.rbi +80 -0
  234. data/rbi/lib/anthropic/client.rbi +70 -0
  235. data/rbi/lib/anthropic/errors.rbi +143 -0
  236. data/rbi/lib/anthropic/internal/jsonl_stream.rbi +16 -0
  237. data/rbi/lib/anthropic/internal/page.rbi +26 -0
  238. data/rbi/lib/anthropic/internal/stream.rbi +16 -0
  239. data/rbi/lib/anthropic/internal/transport/base_client.rbi +204 -0
  240. data/rbi/lib/anthropic/internal/transport/pooled_net_requester.rbi +60 -0
  241. data/rbi/lib/anthropic/internal/type/array_of.rbi +82 -0
  242. data/rbi/lib/anthropic/internal/type/base_model.rbi +197 -0
  243. data/rbi/lib/anthropic/internal/type/base_page.rbi +36 -0
  244. data/rbi/lib/anthropic/internal/type/base_stream.rbi +51 -0
  245. data/rbi/lib/anthropic/internal/type/boolean.rbi +49 -0
  246. data/rbi/lib/anthropic/internal/type/converter.rbi +112 -0
  247. data/rbi/lib/anthropic/internal/type/enum.rbi +63 -0
  248. data/rbi/lib/anthropic/internal/type/hash_of.rbi +82 -0
  249. data/rbi/lib/anthropic/internal/type/io_like.rbi +47 -0
  250. data/rbi/lib/anthropic/internal/type/request_parameters.rbi +21 -0
  251. data/rbi/lib/anthropic/internal/type/union.rbi +68 -0
  252. data/rbi/lib/anthropic/internal/type/unknown.rbi +41 -0
  253. data/rbi/lib/anthropic/internal/util.rbi +282 -0
  254. data/rbi/lib/anthropic/internal.rbi +12 -0
  255. data/rbi/lib/anthropic/models/anthropic_beta.rbi +30 -0
  256. data/rbi/lib/anthropic/models/api_error_object.rbi +19 -0
  257. data/rbi/lib/anthropic/models/authentication_error.rbi +19 -0
  258. data/rbi/lib/anthropic/models/base64_image_source.rbi +46 -0
  259. data/rbi/lib/anthropic/models/base64_pdf_source.rbi +22 -0
  260. data/rbi/lib/anthropic/models/beta/beta_base64_image_source.rbi +56 -0
  261. data/rbi/lib/anthropic/models/beta/beta_base64_pdf_block.rbi +104 -0
  262. data/rbi/lib/anthropic/models/beta/beta_base64_pdf_source.rbi +26 -0
  263. data/rbi/lib/anthropic/models/beta/beta_cache_control_ephemeral.rbi +20 -0
  264. data/rbi/lib/anthropic/models/beta/beta_citation_char_location.rbi +65 -0
  265. data/rbi/lib/anthropic/models/beta/beta_citation_char_location_param.rbi +65 -0
  266. data/rbi/lib/anthropic/models/beta/beta_citation_content_block_location.rbi +63 -0
  267. data/rbi/lib/anthropic/models/beta/beta_citation_content_block_location_param.rbi +63 -0
  268. data/rbi/lib/anthropic/models/beta/beta_citation_page_location.rbi +65 -0
  269. data/rbi/lib/anthropic/models/beta/beta_citation_page_location_param.rbi +65 -0
  270. data/rbi/lib/anthropic/models/beta/beta_citations_config_param.rbi +23 -0
  271. data/rbi/lib/anthropic/models/beta/beta_citations_delta.rbi +66 -0
  272. data/rbi/lib/anthropic/models/beta/beta_content_block.rbi +21 -0
  273. data/rbi/lib/anthropic/models/beta/beta_content_block_param.rbi +21 -0
  274. data/rbi/lib/anthropic/models/beta/beta_content_block_source.rbi +74 -0
  275. data/rbi/lib/anthropic/models/beta/beta_content_block_source_content.rbi +19 -0
  276. data/rbi/lib/anthropic/models/beta/beta_image_block_param.rbi +68 -0
  277. data/rbi/lib/anthropic/models/beta/beta_input_json_delta.rbi +23 -0
  278. data/rbi/lib/anthropic/models/beta/beta_message.rbi +180 -0
  279. data/rbi/lib/anthropic/models/beta/beta_message_delta_usage.rbi +21 -0
  280. data/rbi/lib/anthropic/models/beta/beta_message_param.rbi +126 -0
  281. data/rbi/lib/anthropic/models/beta/beta_message_tokens_count.rbi +22 -0
  282. data/rbi/lib/anthropic/models/beta/beta_metadata.rbi +25 -0
  283. data/rbi/lib/anthropic/models/beta/beta_model_info.rbi +38 -0
  284. data/rbi/lib/anthropic/models/beta/beta_plain_text_source.rbi +26 -0
  285. data/rbi/lib/anthropic/models/beta/beta_raw_content_block_delta.rbi +21 -0
  286. data/rbi/lib/anthropic/models/beta/beta_raw_content_block_delta_event.rbi +65 -0
  287. data/rbi/lib/anthropic/models/beta/beta_raw_content_block_start_event.rbi +74 -0
  288. data/rbi/lib/anthropic/models/beta/beta_raw_content_block_stop_event.rbi +23 -0
  289. data/rbi/lib/anthropic/models/beta/beta_raw_message_delta_event.rbi +96 -0
  290. data/rbi/lib/anthropic/models/beta/beta_raw_message_start_event.rbi +29 -0
  291. data/rbi/lib/anthropic/models/beta/beta_raw_message_stop_event.rbi +20 -0
  292. data/rbi/lib/anthropic/models/beta/beta_raw_message_stream_event.rbi +21 -0
  293. data/rbi/lib/anthropic/models/beta/beta_redacted_thinking_block.rbi +23 -0
  294. data/rbi/lib/anthropic/models/beta/beta_redacted_thinking_block_param.rbi +23 -0
  295. data/rbi/lib/anthropic/models/beta/beta_signature_delta.rbi +23 -0
  296. data/rbi/lib/anthropic/models/beta/beta_stop_reason.rbi +24 -0
  297. data/rbi/lib/anthropic/models/beta/beta_text_block.rbi +76 -0
  298. data/rbi/lib/anthropic/models/beta/beta_text_block_param.rbi +84 -0
  299. data/rbi/lib/anthropic/models/beta/beta_text_citation.rbi +21 -0
  300. data/rbi/lib/anthropic/models/beta/beta_text_citation_param.rbi +21 -0
  301. data/rbi/lib/anthropic/models/beta/beta_text_delta.rbi +23 -0
  302. data/rbi/lib/anthropic/models/beta/beta_thinking_block.rbi +26 -0
  303. data/rbi/lib/anthropic/models/beta/beta_thinking_block_param.rbi +26 -0
  304. data/rbi/lib/anthropic/models/beta/beta_thinking_config_disabled.rbi +20 -0
  305. data/rbi/lib/anthropic/models/beta/beta_thinking_config_enabled.rbi +32 -0
  306. data/rbi/lib/anthropic/models/beta/beta_thinking_config_param.rbi +30 -0
  307. data/rbi/lib/anthropic/models/beta/beta_thinking_delta.rbi +23 -0
  308. data/rbi/lib/anthropic/models/beta/beta_tool.rbi +112 -0
  309. data/rbi/lib/anthropic/models/beta/beta_tool_bash_20241022.rbi +49 -0
  310. data/rbi/lib/anthropic/models/beta/beta_tool_bash_20250124.rbi +49 -0
  311. data/rbi/lib/anthropic/models/beta/beta_tool_choice.rbi +23 -0
  312. data/rbi/lib/anthropic/models/beta/beta_tool_choice_any.rbi +31 -0
  313. data/rbi/lib/anthropic/models/beta/beta_tool_choice_auto.rbi +31 -0
  314. data/rbi/lib/anthropic/models/beta/beta_tool_choice_none.rbi +21 -0
  315. data/rbi/lib/anthropic/models/beta/beta_tool_choice_tool.rbi +37 -0
  316. data/rbi/lib/anthropic/models/beta/beta_tool_computer_use_20241022.rbi +77 -0
  317. data/rbi/lib/anthropic/models/beta/beta_tool_computer_use_20250124.rbi +77 -0
  318. data/rbi/lib/anthropic/models/beta/beta_tool_result_block_param.rbi +129 -0
  319. data/rbi/lib/anthropic/models/beta/beta_tool_text_editor_20241022.rbi +49 -0
  320. data/rbi/lib/anthropic/models/beta/beta_tool_text_editor_20250124.rbi +49 -0
  321. data/rbi/lib/anthropic/models/beta/beta_tool_union.rbi +21 -0
  322. data/rbi/lib/anthropic/models/beta/beta_tool_use_block.rbi +29 -0
  323. data/rbi/lib/anthropic/models/beta/beta_tool_use_block_param.rbi +60 -0
  324. data/rbi/lib/anthropic/models/beta/beta_url_image_source.rbi +23 -0
  325. data/rbi/lib/anthropic/models/beta/beta_url_pdf_source.rbi +23 -0
  326. data/rbi/lib/anthropic/models/beta/beta_usage.rbi +52 -0
  327. data/rbi/lib/anthropic/models/beta/message_count_tokens_params.rbi +409 -0
  328. data/rbi/lib/anthropic/models/beta/message_create_params.rbi +489 -0
  329. data/rbi/lib/anthropic/models/beta/messages/batch_cancel_params.rbi +41 -0
  330. data/rbi/lib/anthropic/models/beta/messages/batch_create_params.rbi +572 -0
  331. data/rbi/lib/anthropic/models/beta/messages/batch_delete_params.rbi +41 -0
  332. data/rbi/lib/anthropic/models/beta/messages/batch_list_params.rbi +72 -0
  333. data/rbi/lib/anthropic/models/beta/messages/batch_results_params.rbi +41 -0
  334. data/rbi/lib/anthropic/models/beta/messages/batch_retrieve_params.rbi +41 -0
  335. data/rbi/lib/anthropic/models/beta/messages/beta_deleted_message_batch.rbi +27 -0
  336. data/rbi/lib/anthropic/models/beta/messages/beta_message_batch.rbi +148 -0
  337. data/rbi/lib/anthropic/models/beta/messages/beta_message_batch_canceled_result.rbi +20 -0
  338. data/rbi/lib/anthropic/models/beta/messages/beta_message_batch_errored_result.rbi +29 -0
  339. data/rbi/lib/anthropic/models/beta/messages/beta_message_batch_expired_result.rbi +20 -0
  340. data/rbi/lib/anthropic/models/beta/messages/beta_message_batch_individual_response.rbi +68 -0
  341. data/rbi/lib/anthropic/models/beta/messages/beta_message_batch_request_counts.rbi +63 -0
  342. data/rbi/lib/anthropic/models/beta/messages/beta_message_batch_result.rbi +26 -0
  343. data/rbi/lib/anthropic/models/beta/messages/beta_message_batch_succeeded_result.rbi +29 -0
  344. data/rbi/lib/anthropic/models/beta/model_list_params.rbi +59 -0
  345. data/rbi/lib/anthropic/models/beta/model_retrieve_params.rbi +21 -0
  346. data/rbi/lib/anthropic/models/beta_api_error.rbi +19 -0
  347. data/rbi/lib/anthropic/models/beta_authentication_error.rbi +19 -0
  348. data/rbi/lib/anthropic/models/beta_billing_error.rbi +19 -0
  349. data/rbi/lib/anthropic/models/beta_error.rbi +17 -0
  350. data/rbi/lib/anthropic/models/beta_error_response.rbi +68 -0
  351. data/rbi/lib/anthropic/models/beta_gateway_timeout_error.rbi +19 -0
  352. data/rbi/lib/anthropic/models/beta_invalid_request_error.rbi +19 -0
  353. data/rbi/lib/anthropic/models/beta_not_found_error.rbi +19 -0
  354. data/rbi/lib/anthropic/models/beta_overloaded_error.rbi +19 -0
  355. data/rbi/lib/anthropic/models/beta_permission_error.rbi +19 -0
  356. data/rbi/lib/anthropic/models/beta_rate_limit_error.rbi +19 -0
  357. data/rbi/lib/anthropic/models/billing_error.rbi +19 -0
  358. data/rbi/lib/anthropic/models/cache_control_ephemeral.rbi +16 -0
  359. data/rbi/lib/anthropic/models/citation_char_location.rbi +61 -0
  360. data/rbi/lib/anthropic/models/citation_char_location_param.rbi +61 -0
  361. data/rbi/lib/anthropic/models/citation_content_block_location.rbi +59 -0
  362. data/rbi/lib/anthropic/models/citation_content_block_location_param.rbi +59 -0
  363. data/rbi/lib/anthropic/models/citation_page_location.rbi +61 -0
  364. data/rbi/lib/anthropic/models/citation_page_location_param.rbi +61 -0
  365. data/rbi/lib/anthropic/models/citations_config_param.rbi +19 -0
  366. data/rbi/lib/anthropic/models/citations_delta.rbi +62 -0
  367. data/rbi/lib/anthropic/models/completion.rbi +65 -0
  368. data/rbi/lib/anthropic/models/completion_create_params.rbi +142 -0
  369. data/rbi/lib/anthropic/models/content_block.rbi +17 -0
  370. data/rbi/lib/anthropic/models/content_block_param.rbi +17 -0
  371. data/rbi/lib/anthropic/models/content_block_source.rbi +56 -0
  372. data/rbi/lib/anthropic/models/content_block_source_content.rbi +12 -0
  373. data/rbi/lib/anthropic/models/document_block_param.rbi +97 -0
  374. data/rbi/lib/anthropic/models/error_object.rbi +17 -0
  375. data/rbi/lib/anthropic/models/error_response.rbi +68 -0
  376. data/rbi/lib/anthropic/models/gateway_timeout_error.rbi +19 -0
  377. data/rbi/lib/anthropic/models/image_block_param.rbi +57 -0
  378. data/rbi/lib/anthropic/models/input_json_delta.rbi +19 -0
  379. data/rbi/lib/anthropic/models/invalid_request_error.rbi +19 -0
  380. data/rbi/lib/anthropic/models/message.rbi +176 -0
  381. data/rbi/lib/anthropic/models/message_count_tokens_params.rbi +363 -0
  382. data/rbi/lib/anthropic/models/message_count_tokens_tool.rbi +17 -0
  383. data/rbi/lib/anthropic/models/message_create_params.rbi +453 -0
  384. data/rbi/lib/anthropic/models/message_delta_usage.rbi +17 -0
  385. data/rbi/lib/anthropic/models/message_param.rbi +121 -0
  386. data/rbi/lib/anthropic/models/message_tokens_count.rbi +18 -0
  387. data/rbi/lib/anthropic/models/messages/batch_cancel_params.rbi +21 -0
  388. data/rbi/lib/anthropic/models/messages/batch_create_params.rbi +535 -0
  389. data/rbi/lib/anthropic/models/messages/batch_delete_params.rbi +21 -0
  390. data/rbi/lib/anthropic/models/messages/batch_list_params.rbi +59 -0
  391. data/rbi/lib/anthropic/models/messages/batch_results_params.rbi +21 -0
  392. data/rbi/lib/anthropic/models/messages/batch_retrieve_params.rbi +21 -0
  393. data/rbi/lib/anthropic/models/messages/deleted_message_batch.rbi +25 -0
  394. data/rbi/lib/anthropic/models/messages/message_batch.rbi +143 -0
  395. data/rbi/lib/anthropic/models/messages/message_batch_canceled_result.rbi +20 -0
  396. data/rbi/lib/anthropic/models/messages/message_batch_errored_result.rbi +29 -0
  397. data/rbi/lib/anthropic/models/messages/message_batch_expired_result.rbi +20 -0
  398. data/rbi/lib/anthropic/models/messages/message_batch_individual_response.rbi +68 -0
  399. data/rbi/lib/anthropic/models/messages/message_batch_request_counts.rbi +63 -0
  400. data/rbi/lib/anthropic/models/messages/message_batch_result.rbi +26 -0
  401. data/rbi/lib/anthropic/models/messages/message_batch_succeeded_result.rbi +29 -0
  402. data/rbi/lib/anthropic/models/metadata.rbi +21 -0
  403. data/rbi/lib/anthropic/models/model.rbi +54 -0
  404. data/rbi/lib/anthropic/models/model_info.rbi +34 -0
  405. data/rbi/lib/anthropic/models/model_list_params.rbi +57 -0
  406. data/rbi/lib/anthropic/models/model_retrieve_params.rbi +19 -0
  407. data/rbi/lib/anthropic/models/not_found_error.rbi +19 -0
  408. data/rbi/lib/anthropic/models/overloaded_error.rbi +19 -0
  409. data/rbi/lib/anthropic/models/permission_error.rbi +19 -0
  410. data/rbi/lib/anthropic/models/plain_text_source.rbi +22 -0
  411. data/rbi/lib/anthropic/models/rate_limit_error.rbi +19 -0
  412. data/rbi/lib/anthropic/models/raw_content_block_delta.rbi +17 -0
  413. data/rbi/lib/anthropic/models/raw_content_block_delta_event.rbi +61 -0
  414. data/rbi/lib/anthropic/models/raw_content_block_start_event.rbi +70 -0
  415. data/rbi/lib/anthropic/models/raw_content_block_stop_event.rbi +19 -0
  416. data/rbi/lib/anthropic/models/raw_message_delta_event.rbi +81 -0
  417. data/rbi/lib/anthropic/models/raw_message_start_event.rbi +25 -0
  418. data/rbi/lib/anthropic/models/raw_message_stop_event.rbi +16 -0
  419. data/rbi/lib/anthropic/models/raw_message_stream_event.rbi +17 -0
  420. data/rbi/lib/anthropic/models/redacted_thinking_block.rbi +19 -0
  421. data/rbi/lib/anthropic/models/redacted_thinking_block_param.rbi +19 -0
  422. data/rbi/lib/anthropic/models/signature_delta.rbi +19 -0
  423. data/rbi/lib/anthropic/models/stop_reason.rbi +20 -0
  424. data/rbi/lib/anthropic/models/text_block.rbi +72 -0
  425. data/rbi/lib/anthropic/models/text_block_param.rbi +80 -0
  426. data/rbi/lib/anthropic/models/text_citation.rbi +17 -0
  427. data/rbi/lib/anthropic/models/text_citation_param.rbi +17 -0
  428. data/rbi/lib/anthropic/models/text_delta.rbi +19 -0
  429. data/rbi/lib/anthropic/models/thinking_block.rbi +22 -0
  430. data/rbi/lib/anthropic/models/thinking_block_param.rbi +22 -0
  431. data/rbi/lib/anthropic/models/thinking_config_disabled.rbi +16 -0
  432. data/rbi/lib/anthropic/models/thinking_config_enabled.rbi +28 -0
  433. data/rbi/lib/anthropic/models/thinking_config_param.rbi +21 -0
  434. data/rbi/lib/anthropic/models/thinking_delta.rbi +19 -0
  435. data/rbi/lib/anthropic/models/tool.rbi +88 -0
  436. data/rbi/lib/anthropic/models/tool_bash_20250124.rbi +43 -0
  437. data/rbi/lib/anthropic/models/tool_choice.rbi +19 -0
  438. data/rbi/lib/anthropic/models/tool_choice_any.rbi +27 -0
  439. data/rbi/lib/anthropic/models/tool_choice_auto.rbi +27 -0
  440. data/rbi/lib/anthropic/models/tool_choice_none.rbi +17 -0
  441. data/rbi/lib/anthropic/models/tool_choice_tool.rbi +33 -0
  442. data/rbi/lib/anthropic/models/tool_result_block_param.rbi +102 -0
  443. data/rbi/lib/anthropic/models/tool_text_editor_20250124.rbi +43 -0
  444. data/rbi/lib/anthropic/models/tool_union.rbi +17 -0
  445. data/rbi/lib/anthropic/models/tool_use_block.rbi +25 -0
  446. data/rbi/lib/anthropic/models/tool_use_block_param.rbi +56 -0
  447. data/rbi/lib/anthropic/models/url_image_source.rbi +19 -0
  448. data/rbi/lib/anthropic/models/url_pdf_source.rbi +19 -0
  449. data/rbi/lib/anthropic/models/usage.rbi +47 -0
  450. data/rbi/lib/anthropic/request_options.rbi +46 -0
  451. data/rbi/lib/anthropic/resources/beta/messages/batches.rbi +164 -0
  452. data/rbi/lib/anthropic/resources/beta/messages.rbi +823 -0
  453. data/rbi/lib/anthropic/resources/beta/models.rbi +55 -0
  454. data/rbi/lib/anthropic/resources/beta.rbi +17 -0
  455. data/rbi/lib/anthropic/resources/completions.rbi +190 -0
  456. data/rbi/lib/anthropic/resources/messages/batches.rbi +142 -0
  457. data/rbi/lib/anthropic/resources/messages.rbi +800 -0
  458. data/rbi/lib/anthropic/resources/models.rbi +53 -0
  459. data/rbi/lib/anthropic/version.rbi +5 -0
  460. data/rbi/lib/anthropic/vertex/client.rbi +56 -0
  461. data/sig/anthropic/bedrock/client.rbs +41 -0
  462. data/sig/anthropic/client.rbs +39 -0
  463. data/sig/anthropic/errors.rbs +101 -0
  464. data/sig/anthropic/internal/jsonl_stream.rbs +9 -0
  465. data/sig/anthropic/internal/page.rbs +17 -0
  466. data/sig/anthropic/internal/stream.rbs +9 -0
  467. data/sig/anthropic/internal/transport/base_client.rbs +110 -0
  468. data/sig/anthropic/internal/transport/pooled_net_requester.rbs +41 -0
  469. data/sig/anthropic/internal/type/array_of.rbs +41 -0
  470. data/sig/anthropic/internal/type/base_model.rbs +82 -0
  471. data/sig/anthropic/internal/type/base_page.rbs +24 -0
  472. data/sig/anthropic/internal/type/base_stream.rbs +31 -0
  473. data/sig/anthropic/internal/type/boolean.rbs +23 -0
  474. data/sig/anthropic/internal/type/converter.rbs +50 -0
  475. data/sig/anthropic/internal/type/enum.rbs +27 -0
  476. data/sig/anthropic/internal/type/hash_of.rbs +41 -0
  477. data/sig/anthropic/internal/type/io_like.rbs +23 -0
  478. data/sig/anthropic/internal/type/request_parameters.rbs +15 -0
  479. data/sig/anthropic/internal/type/union.rbs +45 -0
  480. data/sig/anthropic/internal/type/unknown.rbs +23 -0
  481. data/sig/anthropic/internal/util.rbs +154 -0
  482. data/sig/anthropic/internal.rbs +5 -0
  483. data/sig/anthropic/models/anthropic_beta.rbs +36 -0
  484. data/sig/anthropic/models/api_error_object.rbs +15 -0
  485. data/sig/anthropic/models/authentication_error.rbs +15 -0
  486. data/sig/anthropic/models/base64_image_source.rbs +40 -0
  487. data/sig/anthropic/models/base64_pdf_source.rbs +22 -0
  488. data/sig/anthropic/models/beta/beta_base64_image_source.rbs +44 -0
  489. data/sig/anthropic/models/beta/beta_base64_pdf_block.rbs +58 -0
  490. data/sig/anthropic/models/beta/beta_base64_pdf_source.rbs +26 -0
  491. data/sig/anthropic/models/beta/beta_cache_control_ephemeral.rbs +17 -0
  492. data/sig/anthropic/models/beta/beta_citation_char_location.rbs +42 -0
  493. data/sig/anthropic/models/beta/beta_citation_char_location_param.rbs +42 -0
  494. data/sig/anthropic/models/beta/beta_citation_content_block_location.rbs +42 -0
  495. data/sig/anthropic/models/beta/beta_citation_content_block_location_param.rbs +42 -0
  496. data/sig/anthropic/models/beta/beta_citation_page_location.rbs +42 -0
  497. data/sig/anthropic/models/beta/beta_citation_page_location_param.rbs +42 -0
  498. data/sig/anthropic/models/beta/beta_citations_config_param.rbs +19 -0
  499. data/sig/anthropic/models/beta/beta_citations_delta.rbs +37 -0
  500. data/sig/anthropic/models/beta/beta_content_block.rbs +19 -0
  501. data/sig/anthropic/models/beta/beta_content_block_param.rbs +22 -0
  502. data/sig/anthropic/models/beta/beta_content_block_source.rbs +41 -0
  503. data/sig/anthropic/models/beta/beta_content_block_source_content.rbs +17 -0
  504. data/sig/anthropic/models/beta/beta_image_block_param.rbs +40 -0
  505. data/sig/anthropic/models/beta/beta_input_json_delta.rbs +20 -0
  506. data/sig/anthropic/models/beta/beta_message.rbs +50 -0
  507. data/sig/anthropic/models/beta/beta_message_delta_usage.rbs +17 -0
  508. data/sig/anthropic/models/beta/beta_message_param.rbs +51 -0
  509. data/sig/anthropic/models/beta/beta_message_tokens_count.rbs +17 -0
  510. data/sig/anthropic/models/beta/beta_metadata.rbs +17 -0
  511. data/sig/anthropic/models/beta/beta_model_info.rbs +29 -0
  512. data/sig/anthropic/models/beta/beta_plain_text_source.rbs +26 -0
  513. data/sig/anthropic/models/beta/beta_raw_content_block_delta.rbs +20 -0
  514. data/sig/anthropic/models/beta/beta_raw_content_block_delta_event.rbs +30 -0
  515. data/sig/anthropic/models/beta/beta_raw_content_block_start_event.rbs +42 -0
  516. data/sig/anthropic/models/beta/beta_raw_content_block_stop_event.rbs +20 -0
  517. data/sig/anthropic/models/beta/beta_raw_message_delta_event.rbs +49 -0
  518. data/sig/anthropic/models/beta/beta_raw_message_start_event.rbs +23 -0
  519. data/sig/anthropic/models/beta/beta_raw_message_stop_event.rbs +17 -0
  520. data/sig/anthropic/models/beta/beta_raw_message_stream_event.rbs +21 -0
  521. data/sig/anthropic/models/beta/beta_redacted_thinking_block.rbs +20 -0
  522. data/sig/anthropic/models/beta/beta_redacted_thinking_block_param.rbs +20 -0
  523. data/sig/anthropic/models/beta/beta_signature_delta.rbs +19 -0
  524. data/sig/anthropic/models/beta/beta_stop_reason.rbs +21 -0
  525. data/sig/anthropic/models/beta/beta_text_block.rbs +30 -0
  526. data/sig/anthropic/models/beta/beta_text_block_param.rbs +34 -0
  527. data/sig/anthropic/models/beta/beta_text_citation.rbs +18 -0
  528. data/sig/anthropic/models/beta/beta_text_citation_param.rbs +18 -0
  529. data/sig/anthropic/models/beta/beta_text_delta.rbs +19 -0
  530. data/sig/anthropic/models/beta/beta_thinking_block.rbs +26 -0
  531. data/sig/anthropic/models/beta/beta_thinking_block_param.rbs +26 -0
  532. data/sig/anthropic/models/beta/beta_thinking_config_disabled.rbs +17 -0
  533. data/sig/anthropic/models/beta/beta_thinking_config_enabled.rbs +20 -0
  534. data/sig/anthropic/models/beta/beta_thinking_config_param.rbs +17 -0
  535. data/sig/anthropic/models/beta/beta_thinking_delta.rbs +19 -0
  536. data/sig/anthropic/models/beta/beta_tool.rbs +62 -0
  537. data/sig/anthropic/models/beta/beta_tool_bash_20241022.rbs +30 -0
  538. data/sig/anthropic/models/beta/beta_tool_bash_20250124.rbs +30 -0
  539. data/sig/anthropic/models/beta/beta_tool_choice.rbs +19 -0
  540. data/sig/anthropic/models/beta/beta_tool_choice_any.rbs +22 -0
  541. data/sig/anthropic/models/beta/beta_tool_choice_auto.rbs +22 -0
  542. data/sig/anthropic/models/beta/beta_tool_choice_none.rbs +17 -0
  543. data/sig/anthropic/models/beta/beta_tool_choice_tool.rbs +28 -0
  544. data/sig/anthropic/models/beta/beta_tool_computer_use_20241022.rbs +42 -0
  545. data/sig/anthropic/models/beta/beta_tool_computer_use_20250124.rbs +42 -0
  546. data/sig/anthropic/models/beta/beta_tool_result_block_param.rbs +69 -0
  547. data/sig/anthropic/models/beta/beta_tool_text_editor_20241022.rbs +30 -0
  548. data/sig/anthropic/models/beta/beta_tool_text_editor_20250124.rbs +30 -0
  549. data/sig/anthropic/models/beta/beta_tool_union.rbs +22 -0
  550. data/sig/anthropic/models/beta/beta_tool_use_block.rbs +29 -0
  551. data/sig/anthropic/models/beta/beta_tool_use_block_param.rbs +38 -0
  552. data/sig/anthropic/models/beta/beta_url_image_source.rbs +19 -0
  553. data/sig/anthropic/models/beta/beta_url_pdf_source.rbs +19 -0
  554. data/sig/anthropic/models/beta/beta_usage.rbs +34 -0
  555. data/sig/anthropic/models/beta/message_count_tokens_params.rbs +98 -0
  556. data/sig/anthropic/models/beta/message_create_params.rbs +119 -0
  557. data/sig/anthropic/models/beta/messages/batch_cancel_params.rbs +29 -0
  558. data/sig/anthropic/models/beta/messages/batch_create_params.rbs +161 -0
  559. data/sig/anthropic/models/beta/messages/batch_delete_params.rbs +29 -0
  560. data/sig/anthropic/models/beta/messages/batch_list_params.rbs +49 -0
  561. data/sig/anthropic/models/beta/messages/batch_results_params.rbs +29 -0
  562. data/sig/anthropic/models/beta/messages/batch_retrieve_params.rbs +29 -0
  563. data/sig/anthropic/models/beta/messages/beta_deleted_message_batch.rbs +20 -0
  564. data/sig/anthropic/models/beta/messages/beta_message_batch.rbs +70 -0
  565. data/sig/anthropic/models/beta/messages/beta_message_batch_canceled_result.rbs +17 -0
  566. data/sig/anthropic/models/beta/messages/beta_message_batch_errored_result.rbs +23 -0
  567. data/sig/anthropic/models/beta/messages/beta_message_batch_expired_result.rbs +17 -0
  568. data/sig/anthropic/models/beta/messages/beta_message_batch_individual_response.rbs +26 -0
  569. data/sig/anthropic/models/beta/messages/beta_message_batch_request_counts.rbs +38 -0
  570. data/sig/anthropic/models/beta/messages/beta_message_batch_result.rbs +19 -0
  571. data/sig/anthropic/models/beta/messages/beta_message_batch_succeeded_result.rbs +23 -0
  572. data/sig/anthropic/models/beta/model_list_params.rbs +35 -0
  573. data/sig/anthropic/models/beta/model_retrieve_params.rbs +17 -0
  574. data/sig/anthropic/models/beta_api_error.rbs +15 -0
  575. data/sig/anthropic/models/beta_authentication_error.rbs +16 -0
  576. data/sig/anthropic/models/beta_billing_error.rbs +15 -0
  577. data/sig/anthropic/models/beta_error.rbs +20 -0
  578. data/sig/anthropic/models/beta_error_response.rbs +19 -0
  579. data/sig/anthropic/models/beta_gateway_timeout_error.rbs +15 -0
  580. data/sig/anthropic/models/beta_invalid_request_error.rbs +16 -0
  581. data/sig/anthropic/models/beta_not_found_error.rbs +15 -0
  582. data/sig/anthropic/models/beta_overloaded_error.rbs +15 -0
  583. data/sig/anthropic/models/beta_permission_error.rbs +15 -0
  584. data/sig/anthropic/models/beta_rate_limit_error.rbs +15 -0
  585. data/sig/anthropic/models/billing_error.rbs +15 -0
  586. data/sig/anthropic/models/cache_control_ephemeral.rbs +13 -0
  587. data/sig/anthropic/models/citation_char_location.rbs +38 -0
  588. data/sig/anthropic/models/citation_char_location_param.rbs +38 -0
  589. data/sig/anthropic/models/citation_content_block_location.rbs +38 -0
  590. data/sig/anthropic/models/citation_content_block_location_param.rbs +38 -0
  591. data/sig/anthropic/models/citation_page_location.rbs +38 -0
  592. data/sig/anthropic/models/citation_page_location_param.rbs +38 -0
  593. data/sig/anthropic/models/citations_config_param.rbs +15 -0
  594. data/sig/anthropic/models/citations_delta.rbs +33 -0
  595. data/sig/anthropic/models/completion.rbs +34 -0
  596. data/sig/anthropic/models/completion_create_params.rbs +63 -0
  597. data/sig/anthropic/models/content_block.rbs +15 -0
  598. data/sig/anthropic/models/content_block_param.rbs +18 -0
  599. data/sig/anthropic/models/content_block_source.rbs +36 -0
  600. data/sig/anthropic/models/content_block_source_content.rbs +12 -0
  601. data/sig/anthropic/models/document_block_param.rbs +54 -0
  602. data/sig/anthropic/models/error_object.rbs +20 -0
  603. data/sig/anthropic/models/error_response.rbs +19 -0
  604. data/sig/anthropic/models/gateway_timeout_error.rbs +15 -0
  605. data/sig/anthropic/models/image_block_param.rbs +35 -0
  606. data/sig/anthropic/models/input_json_delta.rbs +15 -0
  607. data/sig/anthropic/models/invalid_request_error.rbs +16 -0
  608. data/sig/anthropic/models/message.rbs +46 -0
  609. data/sig/anthropic/models/message_count_tokens_params.rbs +71 -0
  610. data/sig/anthropic/models/message_count_tokens_tool.rbs +14 -0
  611. data/sig/anthropic/models/message_create_params.rbs +107 -0
  612. data/sig/anthropic/models/message_delta_usage.rbs +13 -0
  613. data/sig/anthropic/models/message_param.rbs +46 -0
  614. data/sig/anthropic/models/message_tokens_count.rbs +13 -0
  615. data/sig/anthropic/models/messages/batch_cancel_params.rbs +17 -0
  616. data/sig/anthropic/models/messages/batch_create_params.rbs +150 -0
  617. data/sig/anthropic/models/messages/batch_delete_params.rbs +17 -0
  618. data/sig/anthropic/models/messages/batch_list_params.rbs +35 -0
  619. data/sig/anthropic/models/messages/batch_results_params.rbs +17 -0
  620. data/sig/anthropic/models/messages/batch_retrieve_params.rbs +17 -0
  621. data/sig/anthropic/models/messages/deleted_message_batch.rbs +17 -0
  622. data/sig/anthropic/models/messages/message_batch.rbs +70 -0
  623. data/sig/anthropic/models/messages/message_batch_canceled_result.rbs +17 -0
  624. data/sig/anthropic/models/messages/message_batch_errored_result.rbs +23 -0
  625. data/sig/anthropic/models/messages/message_batch_expired_result.rbs +17 -0
  626. data/sig/anthropic/models/messages/message_batch_individual_response.rbs +26 -0
  627. data/sig/anthropic/models/messages/message_batch_request_counts.rbs +38 -0
  628. data/sig/anthropic/models/messages/message_batch_result.rbs +19 -0
  629. data/sig/anthropic/models/messages/message_batch_succeeded_result.rbs +23 -0
  630. data/sig/anthropic/models/metadata.rbs +13 -0
  631. data/sig/anthropic/models/model.rbs +73 -0
  632. data/sig/anthropic/models/model_info.rbs +25 -0
  633. data/sig/anthropic/models/model_list_params.rbs +33 -0
  634. data/sig/anthropic/models/model_retrieve_params.rbs +15 -0
  635. data/sig/anthropic/models/not_found_error.rbs +15 -0
  636. data/sig/anthropic/models/overloaded_error.rbs +15 -0
  637. data/sig/anthropic/models/permission_error.rbs +15 -0
  638. data/sig/anthropic/models/plain_text_source.rbs +22 -0
  639. data/sig/anthropic/models/rate_limit_error.rbs +15 -0
  640. data/sig/anthropic/models/raw_content_block_delta.rbs +16 -0
  641. data/sig/anthropic/models/raw_content_block_delta_event.rbs +26 -0
  642. data/sig/anthropic/models/raw_content_block_start_event.rbs +38 -0
  643. data/sig/anthropic/models/raw_content_block_stop_event.rbs +16 -0
  644. data/sig/anthropic/models/raw_message_delta_event.rbs +42 -0
  645. data/sig/anthropic/models/raw_message_start_event.rbs +19 -0
  646. data/sig/anthropic/models/raw_message_stop_event.rbs +13 -0
  647. data/sig/anthropic/models/raw_message_stream_event.rbs +17 -0
  648. data/sig/anthropic/models/redacted_thinking_block.rbs +15 -0
  649. data/sig/anthropic/models/redacted_thinking_block_param.rbs +16 -0
  650. data/sig/anthropic/models/signature_delta.rbs +15 -0
  651. data/sig/anthropic/models/stop_reason.rbs +16 -0
  652. data/sig/anthropic/models/text_block.rbs +26 -0
  653. data/sig/anthropic/models/text_block_param.rbs +30 -0
  654. data/sig/anthropic/models/text_citation.rbs +14 -0
  655. data/sig/anthropic/models/text_citation_param.rbs +14 -0
  656. data/sig/anthropic/models/text_delta.rbs +15 -0
  657. data/sig/anthropic/models/thinking_block.rbs +22 -0
  658. data/sig/anthropic/models/thinking_block_param.rbs +22 -0
  659. data/sig/anthropic/models/thinking_config_disabled.rbs +13 -0
  660. data/sig/anthropic/models/thinking_config_enabled.rbs +15 -0
  661. data/sig/anthropic/models/thinking_config_param.rbs +13 -0
  662. data/sig/anthropic/models/thinking_delta.rbs +15 -0
  663. data/sig/anthropic/models/tool.rbs +44 -0
  664. data/sig/anthropic/models/tool_bash_20250124.rbs +26 -0
  665. data/sig/anthropic/models/tool_choice.rbs +15 -0
  666. data/sig/anthropic/models/tool_choice_any.rbs +17 -0
  667. data/sig/anthropic/models/tool_choice_auto.rbs +17 -0
  668. data/sig/anthropic/models/tool_choice_none.rbs +13 -0
  669. data/sig/anthropic/models/tool_choice_tool.rbs +24 -0
  670. data/sig/anthropic/models/tool_result_block_param.rbs +64 -0
  671. data/sig/anthropic/models/tool_text_editor_20250124.rbs +26 -0
  672. data/sig/anthropic/models/tool_union.rbs +14 -0
  673. data/sig/anthropic/models/tool_use_block.rbs +25 -0
  674. data/sig/anthropic/models/tool_use_block_param.rbs +34 -0
  675. data/sig/anthropic/models/url_image_source.rbs +15 -0
  676. data/sig/anthropic/models/url_pdf_source.rbs +15 -0
  677. data/sig/anthropic/models/usage.rbs +30 -0
  678. data/sig/anthropic/request_options.rbs +34 -0
  679. data/sig/anthropic/resources/beta/messages/batches.rbs +49 -0
  680. data/sig/anthropic/resources/beta/messages.rbs +56 -0
  681. data/sig/anthropic/resources/beta/models.rbs +21 -0
  682. data/sig/anthropic/resources/beta.rbs +11 -0
  683. data/sig/anthropic/resources/completions.rbs +31 -0
  684. data/sig/anthropic/resources/messages/batches.rbs +41 -0
  685. data/sig/anthropic/resources/messages.rbs +51 -0
  686. data/sig/anthropic/resources/models.rbs +19 -0
  687. data/sig/anthropic/version.rbs +3 -0
  688. data/sig/anthropic/vertex/client.rbs +34 -0
  689. metadata +746 -0
@@ -0,0 +1,823 @@
1
+ # typed: strong
2
+
3
+ module Anthropic
4
+ module Resources
5
+ class Beta
6
+ class Messages
7
+ sig { returns(Anthropic::Resources::Beta::Messages::Batches) }
8
+ attr_reader :batches
9
+
10
+ # See {Anthropic::Resources::Beta::Messages#stream_raw} for streaming counterpart.
11
+ #
12
+ # Send a structured list of input messages with text and/or image content, and the
13
+ # model will generate the next message in the conversation.
14
+ #
15
+ # The Messages API can be used for either single queries or stateless multi-turn
16
+ # conversations.
17
+ #
18
+ # Learn more about the Messages API in our [user guide](/en/docs/initial-setup)
19
+ sig do
20
+ params(
21
+ max_tokens: Integer,
22
+ messages: T::Array[T.any(Anthropic::Models::Beta::BetaMessageParam, Anthropic::Internal::AnyHash)],
23
+ model: T.any(Anthropic::Models::Model::OrSymbol, String),
24
+ metadata: T.any(Anthropic::Models::Beta::BetaMetadata, Anthropic::Internal::AnyHash),
25
+ stop_sequences: T::Array[String],
26
+ system_: T.any(String, T::Array[T.any(Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Internal::AnyHash)]),
27
+ temperature: Float,
28
+ thinking: T.any(
29
+ Anthropic::Models::Beta::BetaThinkingConfigEnabled,
30
+ Anthropic::Internal::AnyHash,
31
+ Anthropic::Models::Beta::BetaThinkingConfigDisabled
32
+ ),
33
+ tool_choice: T.any(
34
+ Anthropic::Models::Beta::BetaToolChoiceAuto,
35
+ Anthropic::Internal::AnyHash,
36
+ Anthropic::Models::Beta::BetaToolChoiceAny,
37
+ Anthropic::Models::Beta::BetaToolChoiceTool,
38
+ Anthropic::Models::Beta::BetaToolChoiceNone
39
+ ),
40
+ tools: T::Array[
41
+ T.any(
42
+ Anthropic::Models::Beta::BetaTool,
43
+ Anthropic::Internal::AnyHash,
44
+ Anthropic::Models::Beta::BetaToolComputerUse20241022,
45
+ Anthropic::Models::Beta::BetaToolBash20241022,
46
+ Anthropic::Models::Beta::BetaToolTextEditor20241022,
47
+ Anthropic::Models::Beta::BetaToolComputerUse20250124,
48
+ Anthropic::Models::Beta::BetaToolBash20250124,
49
+ Anthropic::Models::Beta::BetaToolTextEditor20250124
50
+ )
51
+ ],
52
+ top_k: Integer,
53
+ top_p: Float,
54
+ betas: T::Array[T.any(String, Anthropic::Models::AnthropicBeta::OrSymbol)],
55
+ stream: T.noreturn,
56
+ request_options: T.nilable(T.any(Anthropic::RequestOptions, Anthropic::Internal::AnyHash))
57
+ )
58
+ .returns(Anthropic::Models::Beta::BetaMessage)
59
+ end
60
+ def create(
61
+ # Body param: The maximum number of tokens to generate before stopping.
62
+ #
63
+ # Note that our models may stop _before_ reaching this maximum. This parameter
64
+ # only specifies the absolute maximum number of tokens to generate.
65
+ #
66
+ # Different models have different maximum values for this parameter. See
67
+ # [models](https://docs.anthropic.com/en/docs/models-overview) for details.
68
+ max_tokens:,
69
+ # Body param: Input messages.
70
+ #
71
+ # Our models are trained to operate on alternating `user` and `assistant`
72
+ # conversational turns. When creating a new `Message`, you specify the prior
73
+ # conversational turns with the `messages` parameter, and the model then generates
74
+ # the next `Message` in the conversation. Consecutive `user` or `assistant` turns
75
+ # in your request will be combined into a single turn.
76
+ #
77
+ # Each input message must be an object with a `role` and `content`. You can
78
+ # specify a single `user`-role message, or you can include multiple `user` and
79
+ # `assistant` messages.
80
+ #
81
+ # If the final message uses the `assistant` role, the response content will
82
+ # continue immediately from the content in that message. This can be used to
83
+ # constrain part of the model's response.
84
+ #
85
+ # Example with a single `user` message:
86
+ #
87
+ # ```json
88
+ # [{ "role": "user", "content": "Hello, Claude" }]
89
+ # ```
90
+ #
91
+ # Example with multiple conversational turns:
92
+ #
93
+ # ```json
94
+ # [
95
+ # { "role": "user", "content": "Hello there." },
96
+ # { "role": "assistant", "content": "Hi, I'm Claude. How can I help you?" },
97
+ # { "role": "user", "content": "Can you explain LLMs in plain English?" }
98
+ # ]
99
+ # ```
100
+ #
101
+ # Example with a partially-filled response from Claude:
102
+ #
103
+ # ```json
104
+ # [
105
+ # {
106
+ # "role": "user",
107
+ # "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"
108
+ # },
109
+ # { "role": "assistant", "content": "The best answer is (" }
110
+ # ]
111
+ # ```
112
+ #
113
+ # Each input message `content` may be either a single `string` or an array of
114
+ # content blocks, where each block has a specific `type`. Using a `string` for
115
+ # `content` is shorthand for an array of one content block of type `"text"`. The
116
+ # following input messages are equivalent:
117
+ #
118
+ # ```json
119
+ # { "role": "user", "content": "Hello, Claude" }
120
+ # ```
121
+ #
122
+ # ```json
123
+ # { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
124
+ # ```
125
+ #
126
+ # Starting with Claude 3 models, you can also send image content blocks:
127
+ #
128
+ # ```json
129
+ # {
130
+ # "role": "user",
131
+ # "content": [
132
+ # {
133
+ # "type": "image",
134
+ # "source": {
135
+ # "type": "base64",
136
+ # "media_type": "image/jpeg",
137
+ # "data": "/9j/4AAQSkZJRg..."
138
+ # }
139
+ # },
140
+ # { "type": "text", "text": "What is in this image?" }
141
+ # ]
142
+ # }
143
+ # ```
144
+ #
145
+ # We currently support the `base64` source type for images, and the `image/jpeg`,
146
+ # `image/png`, `image/gif`, and `image/webp` media types.
147
+ #
148
+ # See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
149
+ # more input examples.
150
+ #
151
+ # Note that if you want to include a
152
+ # [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
153
+ # the top-level `system` parameter — there is no `"system"` role for input
154
+ # messages in the Messages API.
155
+ messages:,
156
+ # Body param: The model that will complete your prompt.\n\nSee
157
+ # [models](https://docs.anthropic.com/en/docs/models-overview) for additional
158
+ # details and options.
159
+ model:,
160
+ # Body param: An object describing metadata about the request.
161
+ metadata: nil,
162
+ # Body param: Custom text sequences that will cause the model to stop generating.
163
+ #
164
+ # Our models will normally stop when they have naturally completed their turn,
165
+ # which will result in a response `stop_reason` of `"end_turn"`.
166
+ #
167
+ # If you want the model to stop generating when it encounters custom strings of
168
+ # text, you can use the `stop_sequences` parameter. If the model encounters one of
169
+ # the custom sequences, the response `stop_reason` value will be `"stop_sequence"`
170
+ # and the response `stop_sequence` value will contain the matched stop sequence.
171
+ stop_sequences: nil,
172
+ # Body param: System prompt.
173
+ #
174
+ # A system prompt is a way of providing context and instructions to Claude, such
175
+ # as specifying a particular goal or role. See our
176
+ # [guide to system prompts](https://docs.anthropic.com/en/docs/system-prompts).
177
+ system_: nil,
178
+ # Body param: Amount of randomness injected into the response.
179
+ #
180
+ # Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0`
181
+ # for analytical / multiple choice, and closer to `1.0` for creative and
182
+ # generative tasks.
183
+ #
184
+ # Note that even with `temperature` of `0.0`, the results will not be fully
185
+ # deterministic.
186
+ temperature: nil,
187
+ # Body param: Configuration for enabling Claude's extended thinking.
188
+ #
189
+ # When enabled, responses include `thinking` content blocks showing Claude's
190
+ # thinking process before the final answer. Requires a minimum budget of 1,024
191
+ # tokens and counts towards your `max_tokens` limit.
192
+ #
193
+ # See
194
+ # [extended thinking](https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking)
195
+ # for details.
196
+ thinking: nil,
197
+ # Body param: How the model should use the provided tools. The model can use a
198
+ # specific tool, any available tool, decide by itself, or not use tools at all.
199
+ tool_choice: nil,
200
+ # Body param: Definitions of tools that the model may use.
201
+ #
202
+ # If you include `tools` in your API request, the model may return `tool_use`
203
+ # content blocks that represent the model's use of those tools. You can then run
204
+ # those tools using the tool input generated by the model and then optionally
205
+ # return results back to the model using `tool_result` content blocks.
206
+ #
207
+ # Each tool definition includes:
208
+ #
209
+ # - `name`: Name of the tool.
210
+ # - `description`: Optional, but strongly-recommended description of the tool.
211
+ # - `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the
212
+ # tool `input` shape that the model will produce in `tool_use` output content
213
+ # blocks.
214
+ #
215
+ # For example, if you defined `tools` as:
216
+ #
217
+ # ```json
218
+ # [
219
+ # {
220
+ # "name": "get_stock_price",
221
+ # "description": "Get the current stock price for a given ticker symbol.",
222
+ # "input_schema": {
223
+ # "type": "object",
224
+ # "properties": {
225
+ # "ticker": {
226
+ # "type": "string",
227
+ # "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
228
+ # }
229
+ # },
230
+ # "required": ["ticker"]
231
+ # }
232
+ # }
233
+ # ]
234
+ # ```
235
+ #
236
+ # And then asked the model "What's the S&P 500 at today?", the model might produce
237
+ # `tool_use` content blocks in the response like this:
238
+ #
239
+ # ```json
240
+ # [
241
+ # {
242
+ # "type": "tool_use",
243
+ # "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
244
+ # "name": "get_stock_price",
245
+ # "input": { "ticker": "^GSPC" }
246
+ # }
247
+ # ]
248
+ # ```
249
+ #
250
+ # You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an
251
+ # input, and return the following back to the model in a subsequent `user`
252
+ # message:
253
+ #
254
+ # ```json
255
+ # [
256
+ # {
257
+ # "type": "tool_result",
258
+ # "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
259
+ # "content": "259.75 USD"
260
+ # }
261
+ # ]
262
+ # ```
263
+ #
264
+ # Tools can be used for workflows that include running client-side tools and
265
+ # functions, or more generally whenever you want the model to produce a particular
266
+ # JSON structure of output.
267
+ #
268
+ # See our [guide](https://docs.anthropic.com/en/docs/tool-use) for more details.
269
+ tools: nil,
270
+ # Body param: Only sample from the top K options for each subsequent token.
271
+ #
272
+ # Used to remove "long tail" low probability responses.
273
+ # [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
274
+ #
275
+ # Recommended for advanced use cases only. You usually only need to use
276
+ # `temperature`.
277
+ top_k: nil,
278
+ # Body param: Use nucleus sampling.
279
+ #
280
+ # In nucleus sampling, we compute the cumulative distribution over all the options
281
+ # for each subsequent token in decreasing probability order and cut it off once it
282
+ # reaches a particular probability specified by `top_p`. You should either alter
283
+ # `temperature` or `top_p`, but not both.
284
+ #
285
+ # Recommended for advanced use cases only. You usually only need to use
286
+ # `temperature`.
287
+ top_p: nil,
288
+ # Header param: Optional header to specify the beta version(s) you want to use.
289
+ betas: nil,
290
+ # There is no need to provide `stream:`. Instead, use `#stream_raw` or `#create`
291
+ # for streaming and non-streaming use cases, respectively.
292
+ stream: false,
293
+ request_options: {}
294
+ ); end
295
+ # See {Anthropic::Resources::Beta::Messages#create} for non-streaming counterpart.
296
+ #
297
+ # Send a structured list of input messages with text and/or image content, and the
298
+ # model will generate the next message in the conversation.
299
+ #
300
+ # The Messages API can be used for either single queries or stateless multi-turn
301
+ # conversations.
302
+ #
303
+ # Learn more about the Messages API in our [user guide](/en/docs/initial-setup)
304
+ sig do
305
+ params(
306
+ max_tokens: Integer,
307
+ messages: T::Array[T.any(Anthropic::Models::Beta::BetaMessageParam, Anthropic::Internal::AnyHash)],
308
+ model: T.any(Anthropic::Models::Model::OrSymbol, String),
309
+ metadata: T.any(Anthropic::Models::Beta::BetaMetadata, Anthropic::Internal::AnyHash),
310
+ stop_sequences: T::Array[String],
311
+ system_: T.any(String, T::Array[T.any(Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Internal::AnyHash)]),
312
+ temperature: Float,
313
+ thinking: T.any(
314
+ Anthropic::Models::Beta::BetaThinkingConfigEnabled,
315
+ Anthropic::Internal::AnyHash,
316
+ Anthropic::Models::Beta::BetaThinkingConfigDisabled
317
+ ),
318
+ tool_choice: T.any(
319
+ Anthropic::Models::Beta::BetaToolChoiceAuto,
320
+ Anthropic::Internal::AnyHash,
321
+ Anthropic::Models::Beta::BetaToolChoiceAny,
322
+ Anthropic::Models::Beta::BetaToolChoiceTool,
323
+ Anthropic::Models::Beta::BetaToolChoiceNone
324
+ ),
325
+ tools: T::Array[
326
+ T.any(
327
+ Anthropic::Models::Beta::BetaTool,
328
+ Anthropic::Internal::AnyHash,
329
+ Anthropic::Models::Beta::BetaToolComputerUse20241022,
330
+ Anthropic::Models::Beta::BetaToolBash20241022,
331
+ Anthropic::Models::Beta::BetaToolTextEditor20241022,
332
+ Anthropic::Models::Beta::BetaToolComputerUse20250124,
333
+ Anthropic::Models::Beta::BetaToolBash20250124,
334
+ Anthropic::Models::Beta::BetaToolTextEditor20250124
335
+ )
336
+ ],
337
+ top_k: Integer,
338
+ top_p: Float,
339
+ betas: T::Array[T.any(String, Anthropic::Models::AnthropicBeta::OrSymbol)],
340
+ stream: T.noreturn,
341
+ request_options: T.nilable(T.any(Anthropic::RequestOptions, Anthropic::Internal::AnyHash))
342
+ )
343
+ .returns(
344
+ Anthropic::Internal::Stream[
345
+ T.any(
346
+ Anthropic::Models::Beta::BetaRawMessageStartEvent,
347
+ Anthropic::Models::Beta::BetaRawMessageDeltaEvent,
348
+ Anthropic::Models::Beta::BetaRawMessageStopEvent,
349
+ Anthropic::Models::Beta::BetaRawContentBlockStartEvent,
350
+ Anthropic::Models::Beta::BetaRawContentBlockDeltaEvent,
351
+ Anthropic::Models::Beta::BetaRawContentBlockStopEvent
352
+ )
353
+ ]
354
+ )
355
+ end
356
+ def stream_raw(
357
+ # Body param: The maximum number of tokens to generate before stopping.
358
+ #
359
+ # Note that our models may stop _before_ reaching this maximum. This parameter
360
+ # only specifies the absolute maximum number of tokens to generate.
361
+ #
362
+ # Different models have different maximum values for this parameter. See
363
+ # [models](https://docs.anthropic.com/en/docs/models-overview) for details.
364
+ max_tokens:,
365
+ # Body param: Input messages.
366
+ #
367
+ # Our models are trained to operate on alternating `user` and `assistant`
368
+ # conversational turns. When creating a new `Message`, you specify the prior
369
+ # conversational turns with the `messages` parameter, and the model then generates
370
+ # the next `Message` in the conversation. Consecutive `user` or `assistant` turns
371
+ # in your request will be combined into a single turn.
372
+ #
373
+ # Each input message must be an object with a `role` and `content`. You can
374
+ # specify a single `user`-role message, or you can include multiple `user` and
375
+ # `assistant` messages.
376
+ #
377
+ # If the final message uses the `assistant` role, the response content will
378
+ # continue immediately from the content in that message. This can be used to
379
+ # constrain part of the model's response.
380
+ #
381
+ # Example with a single `user` message:
382
+ #
383
+ # ```json
384
+ # [{ "role": "user", "content": "Hello, Claude" }]
385
+ # ```
386
+ #
387
+ # Example with multiple conversational turns:
388
+ #
389
+ # ```json
390
+ # [
391
+ # { "role": "user", "content": "Hello there." },
392
+ # { "role": "assistant", "content": "Hi, I'm Claude. How can I help you?" },
393
+ # { "role": "user", "content": "Can you explain LLMs in plain English?" }
394
+ # ]
395
+ # ```
396
+ #
397
+ # Example with a partially-filled response from Claude:
398
+ #
399
+ # ```json
400
+ # [
401
+ # {
402
+ # "role": "user",
403
+ # "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"
404
+ # },
405
+ # { "role": "assistant", "content": "The best answer is (" }
406
+ # ]
407
+ # ```
408
+ #
409
+ # Each input message `content` may be either a single `string` or an array of
410
+ # content blocks, where each block has a specific `type`. Using a `string` for
411
+ # `content` is shorthand for an array of one content block of type `"text"`. The
412
+ # following input messages are equivalent:
413
+ #
414
+ # ```json
415
+ # { "role": "user", "content": "Hello, Claude" }
416
+ # ```
417
+ #
418
+ # ```json
419
+ # { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
420
+ # ```
421
+ #
422
+ # Starting with Claude 3 models, you can also send image content blocks:
423
+ #
424
+ # ```json
425
+ # {
426
+ # "role": "user",
427
+ # "content": [
428
+ # {
429
+ # "type": "image",
430
+ # "source": {
431
+ # "type": "base64",
432
+ # "media_type": "image/jpeg",
433
+ # "data": "/9j/4AAQSkZJRg..."
434
+ # }
435
+ # },
436
+ # { "type": "text", "text": "What is in this image?" }
437
+ # ]
438
+ # }
439
+ # ```
440
+ #
441
+ # We currently support the `base64` source type for images, and the `image/jpeg`,
442
+ # `image/png`, `image/gif`, and `image/webp` media types.
443
+ #
444
+ # See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
445
+ # more input examples.
446
+ #
447
+ # Note that if you want to include a
448
+ # [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
449
+ # the top-level `system` parameter — there is no `"system"` role for input
450
+ # messages in the Messages API.
451
+ messages:,
452
+ # Body param: The model that will complete your prompt.\n\nSee
453
+ # [models](https://docs.anthropic.com/en/docs/models-overview) for additional
454
+ # details and options.
455
+ model:,
456
+ # Body param: An object describing metadata about the request.
457
+ metadata: nil,
458
+ # Body param: Custom text sequences that will cause the model to stop generating.
459
+ #
460
+ # Our models will normally stop when they have naturally completed their turn,
461
+ # which will result in a response `stop_reason` of `"end_turn"`.
462
+ #
463
+ # If you want the model to stop generating when it encounters custom strings of
464
+ # text, you can use the `stop_sequences` parameter. If the model encounters one of
465
+ # the custom sequences, the response `stop_reason` value will be `"stop_sequence"`
466
+ # and the response `stop_sequence` value will contain the matched stop sequence.
467
+ stop_sequences: nil,
468
+ # Body param: System prompt.
469
+ #
470
+ # A system prompt is a way of providing context and instructions to Claude, such
471
+ # as specifying a particular goal or role. See our
472
+ # [guide to system prompts](https://docs.anthropic.com/en/docs/system-prompts).
473
+ system_: nil,
474
+ # Body param: Amount of randomness injected into the response.
475
+ #
476
+ # Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0`
477
+ # for analytical / multiple choice, and closer to `1.0` for creative and
478
+ # generative tasks.
479
+ #
480
+ # Note that even with `temperature` of `0.0`, the results will not be fully
481
+ # deterministic.
482
+ temperature: nil,
483
+ # Body param: Configuration for enabling Claude's extended thinking.
484
+ #
485
+ # When enabled, responses include `thinking` content blocks showing Claude's
486
+ # thinking process before the final answer. Requires a minimum budget of 1,024
487
+ # tokens and counts towards your `max_tokens` limit.
488
+ #
489
+ # See
490
+ # [extended thinking](https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking)
491
+ # for details.
492
+ thinking: nil,
493
+ # Body param: How the model should use the provided tools. The model can use a
494
+ # specific tool, any available tool, decide by itself, or not use tools at all.
495
+ tool_choice: nil,
496
+ # Body param: Definitions of tools that the model may use.
497
+ #
498
+ # If you include `tools` in your API request, the model may return `tool_use`
499
+ # content blocks that represent the model's use of those tools. You can then run
500
+ # those tools using the tool input generated by the model and then optionally
501
+ # return results back to the model using `tool_result` content blocks.
502
+ #
503
+ # Each tool definition includes:
504
+ #
505
+ # - `name`: Name of the tool.
506
+ # - `description`: Optional, but strongly-recommended description of the tool.
507
+ # - `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the
508
+ # tool `input` shape that the model will produce in `tool_use` output content
509
+ # blocks.
510
+ #
511
+ # For example, if you defined `tools` as:
512
+ #
513
+ # ```json
514
+ # [
515
+ # {
516
+ # "name": "get_stock_price",
517
+ # "description": "Get the current stock price for a given ticker symbol.",
518
+ # "input_schema": {
519
+ # "type": "object",
520
+ # "properties": {
521
+ # "ticker": {
522
+ # "type": "string",
523
+ # "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
524
+ # }
525
+ # },
526
+ # "required": ["ticker"]
527
+ # }
528
+ # }
529
+ # ]
530
+ # ```
531
+ #
532
+ # And then asked the model "What's the S&P 500 at today?", the model might produce
533
+ # `tool_use` content blocks in the response like this:
534
+ #
535
+ # ```json
536
+ # [
537
+ # {
538
+ # "type": "tool_use",
539
+ # "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
540
+ # "name": "get_stock_price",
541
+ # "input": { "ticker": "^GSPC" }
542
+ # }
543
+ # ]
544
+ # ```
545
+ #
546
+ # You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an
547
+ # input, and return the following back to the model in a subsequent `user`
548
+ # message:
549
+ #
550
+ # ```json
551
+ # [
552
+ # {
553
+ # "type": "tool_result",
554
+ # "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
555
+ # "content": "259.75 USD"
556
+ # }
557
+ # ]
558
+ # ```
559
+ #
560
+ # Tools can be used for workflows that include running client-side tools and
561
+ # functions, or more generally whenever you want the model to produce a particular
562
+ # JSON structure of output.
563
+ #
564
+ # See our [guide](https://docs.anthropic.com/en/docs/tool-use) for more details.
565
+ tools: nil,
566
+ # Body param: Only sample from the top K options for each subsequent token.
567
+ #
568
+ # Used to remove "long tail" low probability responses.
569
+ # [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
570
+ #
571
+ # Recommended for advanced use cases only. You usually only need to use
572
+ # `temperature`.
573
+ top_k: nil,
574
+ # Body param: Use nucleus sampling.
575
+ #
576
+ # In nucleus sampling, we compute the cumulative distribution over all the options
577
+ # for each subsequent token in decreasing probability order and cut it off once it
578
+ # reaches a particular probability specified by `top_p`. You should either alter
579
+ # `temperature` or `top_p`, but not both.
580
+ #
581
+ # Recommended for advanced use cases only. You usually only need to use
582
+ # `temperature`.
583
+ top_p: nil,
584
+ # Header param: Optional header to specify the beta version(s) you want to use.
585
+ betas: nil,
586
+ # There is no need to provide `stream:`. Instead, use `#stream_raw` or `#create`
587
+ # for streaming and non-streaming use cases, respectively.
588
+ stream: true,
589
+ request_options: {}
590
+ ); end
591
+ # Count the number of tokens in a Message.
592
+ #
593
+ # The Token Count API can be used to count the number of tokens in a Message,
594
+ # including tools, images, and documents, without creating it.
595
+ #
596
+ # Learn more about token counting in our
597
+ # [user guide](/en/docs/build-with-claude/token-counting)
598
+ sig do
599
+ params(
600
+ messages: T::Array[T.any(Anthropic::Models::Beta::BetaMessageParam, Anthropic::Internal::AnyHash)],
601
+ model: T.any(Anthropic::Models::Model::OrSymbol, String),
602
+ system_: T.any(String, T::Array[T.any(Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Internal::AnyHash)]),
603
+ thinking: T.any(
604
+ Anthropic::Models::Beta::BetaThinkingConfigEnabled,
605
+ Anthropic::Internal::AnyHash,
606
+ Anthropic::Models::Beta::BetaThinkingConfigDisabled
607
+ ),
608
+ tool_choice: T.any(
609
+ Anthropic::Models::Beta::BetaToolChoiceAuto,
610
+ Anthropic::Internal::AnyHash,
611
+ Anthropic::Models::Beta::BetaToolChoiceAny,
612
+ Anthropic::Models::Beta::BetaToolChoiceTool,
613
+ Anthropic::Models::Beta::BetaToolChoiceNone
614
+ ),
615
+ tools: T::Array[
616
+ T.any(
617
+ Anthropic::Models::Beta::BetaTool,
618
+ Anthropic::Internal::AnyHash,
619
+ Anthropic::Models::Beta::BetaToolComputerUse20241022,
620
+ Anthropic::Models::Beta::BetaToolBash20241022,
621
+ Anthropic::Models::Beta::BetaToolTextEditor20241022,
622
+ Anthropic::Models::Beta::BetaToolComputerUse20250124,
623
+ Anthropic::Models::Beta::BetaToolBash20250124,
624
+ Anthropic::Models::Beta::BetaToolTextEditor20250124
625
+ )
626
+ ],
627
+ betas: T::Array[T.any(String, Anthropic::Models::AnthropicBeta::OrSymbol)],
628
+ request_options: T.nilable(T.any(Anthropic::RequestOptions, Anthropic::Internal::AnyHash))
629
+ )
630
+ .returns(Anthropic::Models::Beta::BetaMessageTokensCount)
631
+ end
632
+ def count_tokens(
633
+ # Body param: Input messages.
634
+ #
635
+ # Our models are trained to operate on alternating `user` and `assistant`
636
+ # conversational turns. When creating a new `Message`, you specify the prior
637
+ # conversational turns with the `messages` parameter, and the model then generates
638
+ # the next `Message` in the conversation. Consecutive `user` or `assistant` turns
639
+ # in your request will be combined into a single turn.
640
+ #
641
+ # Each input message must be an object with a `role` and `content`. You can
642
+ # specify a single `user`-role message, or you can include multiple `user` and
643
+ # `assistant` messages.
644
+ #
645
+ # If the final message uses the `assistant` role, the response content will
646
+ # continue immediately from the content in that message. This can be used to
647
+ # constrain part of the model's response.
648
+ #
649
+ # Example with a single `user` message:
650
+ #
651
+ # ```json
652
+ # [{ "role": "user", "content": "Hello, Claude" }]
653
+ # ```
654
+ #
655
+ # Example with multiple conversational turns:
656
+ #
657
+ # ```json
658
+ # [
659
+ # { "role": "user", "content": "Hello there." },
660
+ # { "role": "assistant", "content": "Hi, I'm Claude. How can I help you?" },
661
+ # { "role": "user", "content": "Can you explain LLMs in plain English?" }
662
+ # ]
663
+ # ```
664
+ #
665
+ # Example with a partially-filled response from Claude:
666
+ #
667
+ # ```json
668
+ # [
669
+ # {
670
+ # "role": "user",
671
+ # "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"
672
+ # },
673
+ # { "role": "assistant", "content": "The best answer is (" }
674
+ # ]
675
+ # ```
676
+ #
677
+ # Each input message `content` may be either a single `string` or an array of
678
+ # content blocks, where each block has a specific `type`. Using a `string` for
679
+ # `content` is shorthand for an array of one content block of type `"text"`. The
680
+ # following input messages are equivalent:
681
+ #
682
+ # ```json
683
+ # { "role": "user", "content": "Hello, Claude" }
684
+ # ```
685
+ #
686
+ # ```json
687
+ # { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
688
+ # ```
689
+ #
690
+ # Starting with Claude 3 models, you can also send image content blocks:
691
+ #
692
+ # ```json
693
+ # {
694
+ # "role": "user",
695
+ # "content": [
696
+ # {
697
+ # "type": "image",
698
+ # "source": {
699
+ # "type": "base64",
700
+ # "media_type": "image/jpeg",
701
+ # "data": "/9j/4AAQSkZJRg..."
702
+ # }
703
+ # },
704
+ # { "type": "text", "text": "What is in this image?" }
705
+ # ]
706
+ # }
707
+ # ```
708
+ #
709
+ # We currently support the `base64` source type for images, and the `image/jpeg`,
710
+ # `image/png`, `image/gif`, and `image/webp` media types.
711
+ #
712
+ # See [examples](https://docs.anthropic.com/en/api/messages-examples#vision) for
713
+ # more input examples.
714
+ #
715
+ # Note that if you want to include a
716
+ # [system prompt](https://docs.anthropic.com/en/docs/system-prompts), you can use
717
+ # the top-level `system` parameter — there is no `"system"` role for input
718
+ # messages in the Messages API.
719
+ messages:,
720
+ # Body param: The model that will complete your prompt.\n\nSee
721
+ # [models](https://docs.anthropic.com/en/docs/models-overview) for additional
722
+ # details and options.
723
+ model:,
724
+ # Body param: System prompt.
725
+ #
726
+ # A system prompt is a way of providing context and instructions to Claude, such
727
+ # as specifying a particular goal or role. See our
728
+ # [guide to system prompts](https://docs.anthropic.com/en/docs/system-prompts).
729
+ system_: nil,
730
+ # Body param: Configuration for enabling Claude's extended thinking.
731
+ #
732
+ # When enabled, responses include `thinking` content blocks showing Claude's
733
+ # thinking process before the final answer. Requires a minimum budget of 1,024
734
+ # tokens and counts towards your `max_tokens` limit.
735
+ #
736
+ # See
737
+ # [extended thinking](https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking)
738
+ # for details.
739
+ thinking: nil,
740
+ # Body param: How the model should use the provided tools. The model can use a
741
+ # specific tool, any available tool, decide by itself, or not use tools at all.
742
+ tool_choice: nil,
743
+ # Body param: Definitions of tools that the model may use.
744
+ #
745
+ # If you include `tools` in your API request, the model may return `tool_use`
746
+ # content blocks that represent the model's use of those tools. You can then run
747
+ # those tools using the tool input generated by the model and then optionally
748
+ # return results back to the model using `tool_result` content blocks.
749
+ #
750
+ # Each tool definition includes:
751
+ #
752
+ # - `name`: Name of the tool.
753
+ # - `description`: Optional, but strongly-recommended description of the tool.
754
+ # - `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the
755
+ # tool `input` shape that the model will produce in `tool_use` output content
756
+ # blocks.
757
+ #
758
+ # For example, if you defined `tools` as:
759
+ #
760
+ # ```json
761
+ # [
762
+ # {
763
+ # "name": "get_stock_price",
764
+ # "description": "Get the current stock price for a given ticker symbol.",
765
+ # "input_schema": {
766
+ # "type": "object",
767
+ # "properties": {
768
+ # "ticker": {
769
+ # "type": "string",
770
+ # "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
771
+ # }
772
+ # },
773
+ # "required": ["ticker"]
774
+ # }
775
+ # }
776
+ # ]
777
+ # ```
778
+ #
779
+ # And then asked the model "What's the S&P 500 at today?", the model might produce
780
+ # `tool_use` content blocks in the response like this:
781
+ #
782
+ # ```json
783
+ # [
784
+ # {
785
+ # "type": "tool_use",
786
+ # "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
787
+ # "name": "get_stock_price",
788
+ # "input": { "ticker": "^GSPC" }
789
+ # }
790
+ # ]
791
+ # ```
792
+ #
793
+ # You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an
794
+ # input, and return the following back to the model in a subsequent `user`
795
+ # message:
796
+ #
797
+ # ```json
798
+ # [
799
+ # {
800
+ # "type": "tool_result",
801
+ # "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
802
+ # "content": "259.75 USD"
803
+ # }
804
+ # ]
805
+ # ```
806
+ #
807
+ # Tools can be used for workflows that include running client-side tools and
808
+ # functions, or more generally whenever you want the model to produce a particular
809
+ # JSON structure of output.
810
+ #
811
+ # See our [guide](https://docs.anthropic.com/en/docs/tool-use) for more details.
812
+ tools: nil,
813
+ # Header param: Optional header to specify the beta version(s) you want to use.
814
+ betas: nil,
815
+ request_options: {}
816
+ ); end
817
+ # @api private
818
+ sig { params(client: Anthropic::Client).returns(T.attached_class) }
819
+ def self.new(client:); end
820
+ end
821
+ end
822
+ end
823
+ end