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
@@ -8,8 +8,10 @@ module Anthropic
8
8
 
9
9
  type coerce_state =
10
10
  {
11
- strictness: bool | :strong,
11
+ translate_names: bool,
12
+ strictness: bool,
12
13
  exactness: { yes: Integer, no: Integer, maybe: Integer },
14
+ error: Class,
13
15
  branched: Integer
14
16
  }
15
17
 
@@ -37,6 +39,27 @@ module Anthropic
37
39
  | Anthropic::Internal::Type::Converter::input spec
38
40
  ) -> (^-> top)
39
41
 
42
+ def self.meta_info: (
43
+ {
44
+ const: (nil | bool | Integer | Float | Symbol)?,
45
+ enum: ^-> Anthropic::Internal::Type::Converter::input?,
46
+ union: ^-> Anthropic::Internal::Type::Converter::input?
47
+ }
48
+ | ^-> Anthropic::Internal::Type::Converter::input
49
+ | Anthropic::Internal::Type::Converter::input type_info,
50
+ {
51
+ const: (nil | bool | Integer | Float | Symbol)?,
52
+ enum: ^-> Anthropic::Internal::Type::Converter::input?,
53
+ union: ^-> Anthropic::Internal::Type::Converter::input?
54
+ }
55
+ | ^-> Anthropic::Internal::Type::Converter::input
56
+ | Anthropic::Internal::Type::Converter::input spec
57
+ ) -> ::Hash[Symbol, top]
58
+
59
+ def self.new_coerce_state: (
60
+ ?translate_names: bool
61
+ ) -> Anthropic::Internal::Type::Converter::coerce_state
62
+
40
63
  def self.coerce: (
41
64
  Anthropic::Internal::Type::Converter::input target,
42
65
  top value,
@@ -5,9 +5,9 @@ module Anthropic
5
5
  include Anthropic::Internal::Type::Converter
6
6
  include Anthropic::Internal::Util::SorbetRuntimeSupport
7
7
 
8
- private def self.known_variants: -> ::Array[[Symbol?, (^-> Anthropic::Internal::Type::Converter::input)]]
8
+ private def self.known_variants: -> ::Array[[Symbol?, (^-> Anthropic::Internal::Type::Converter::input), ::Hash[Symbol, top]]]
9
9
 
10
- def self.derefed_variants: -> ::Array[[Symbol?, top]]
10
+ def self.derefed_variants: -> ::Array[[Symbol?, top, ::Hash[Symbol, top]]]
11
11
 
12
12
  def self.variants: -> ::Array[top]
13
13
 
@@ -16,6 +16,7 @@ module Anthropic
16
16
  | :"interleaved-thinking-2025-05-14"
17
17
  | :"code-execution-2025-05-22"
18
18
  | :"extended-cache-ttl-2025-04-11"
19
+ | :"context-1m-2025-08-07"
19
20
 
20
21
  module AnthropicBeta
21
22
  extend Anthropic::Internal::Type::Union
@@ -36,6 +37,7 @@ module Anthropic
36
37
  INTERLEAVED_THINKING_2025_05_14: :"interleaved-thinking-2025-05-14"
37
38
  CODE_EXECUTION_2025_05_22: :"code-execution-2025-05-22"
38
39
  EXTENDED_CACHE_TTL_2025_04_11: :"extended-cache-ttl-2025-04-11"
40
+ CONTEXT_1M_2025_08_07: :"context-1m-2025-08-07"
39
41
  end
40
42
  end
41
43
  end
@@ -3,64 +3,7 @@ module Anthropic
3
3
  class BetaBase64PDFBlock = Beta::BetaBase64PDFBlock
4
4
 
5
5
  module Beta
6
- type beta_base64_pdf_block =
7
- {
8
- source: Anthropic::Models::Beta::BetaBase64PDFBlock::source,
9
- type: :document,
10
- cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
11
- citations: Anthropic::Beta::BetaCitationsConfigParam,
12
- context: String?,
13
- title: String?
14
- }
15
-
16
- class BetaBase64PDFBlock < Anthropic::Internal::Type::BaseModel
17
- attr_accessor source: Anthropic::Models::Beta::BetaBase64PDFBlock::source
18
-
19
- attr_accessor type: :document
20
-
21
- attr_accessor cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
22
-
23
- attr_reader citations: Anthropic::Beta::BetaCitationsConfigParam?
24
-
25
- def citations=: (
26
- Anthropic::Beta::BetaCitationsConfigParam
27
- ) -> Anthropic::Beta::BetaCitationsConfigParam
28
-
29
- attr_accessor context: String?
30
-
31
- attr_accessor title: String?
32
-
33
- def initialize: (
34
- source: Anthropic::Models::Beta::BetaBase64PDFBlock::source,
35
- ?cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
36
- ?citations: Anthropic::Beta::BetaCitationsConfigParam,
37
- ?context: String?,
38
- ?title: String?,
39
- ?type: :document
40
- ) -> void
41
-
42
- def to_hash: -> {
43
- source: Anthropic::Models::Beta::BetaBase64PDFBlock::source,
44
- type: :document,
45
- cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
46
- citations: Anthropic::Beta::BetaCitationsConfigParam,
47
- context: String?,
48
- title: String?
49
- }
50
-
51
- type source =
52
- Anthropic::Beta::BetaBase64PDFSource
53
- | Anthropic::Beta::BetaPlainTextSource
54
- | Anthropic::Beta::BetaContentBlockSource
55
- | Anthropic::Beta::BetaURLPDFSource
56
- | Anthropic::Beta::BetaFileDocumentSource
57
-
58
- module Source
59
- extend Anthropic::Internal::Type::Union
60
-
61
- def self?.variants: -> ::Array[Anthropic::Models::Beta::BetaBase64PDFBlock::source]
62
- end
63
- end
6
+ class BetaBase64PDFBlock = Anthropic::Models::Beta::BetaRequestDocumentBlock
64
7
  end
65
8
  end
66
9
  end
@@ -0,0 +1,23 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaBashCodeExecutionOutputBlock = Beta::BetaBashCodeExecutionOutputBlock
4
+
5
+ module Beta
6
+ type beta_bash_code_execution_output_block =
7
+ { file_id: String, type: :bash_code_execution_output }
8
+
9
+ class BetaBashCodeExecutionOutputBlock < Anthropic::Internal::Type::BaseModel
10
+ attr_accessor file_id: String
11
+
12
+ attr_accessor type: :bash_code_execution_output
13
+
14
+ def initialize: (
15
+ file_id: String,
16
+ ?type: :bash_code_execution_output
17
+ ) -> void
18
+
19
+ def to_hash: -> { file_id: String, type: :bash_code_execution_output }
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaBashCodeExecutionOutputBlockParam = Beta::BetaBashCodeExecutionOutputBlockParam
4
+
5
+ module Beta
6
+ type beta_bash_code_execution_output_block_param =
7
+ { file_id: String, type: :bash_code_execution_output }
8
+
9
+ class BetaBashCodeExecutionOutputBlockParam < Anthropic::Internal::Type::BaseModel
10
+ attr_accessor file_id: String
11
+
12
+ attr_accessor type: :bash_code_execution_output
13
+
14
+ def initialize: (
15
+ file_id: String,
16
+ ?type: :bash_code_execution_output
17
+ ) -> void
18
+
19
+ def to_hash: -> { file_id: String, type: :bash_code_execution_output }
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,44 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaBashCodeExecutionResultBlock = Beta::BetaBashCodeExecutionResultBlock
4
+
5
+ module Beta
6
+ type beta_bash_code_execution_result_block =
7
+ {
8
+ content: ::Array[Anthropic::Beta::BetaBashCodeExecutionOutputBlock],
9
+ return_code: Integer,
10
+ stderr: String,
11
+ stdout: String,
12
+ type: :bash_code_execution_result
13
+ }
14
+
15
+ class BetaBashCodeExecutionResultBlock < Anthropic::Internal::Type::BaseModel
16
+ attr_accessor content: ::Array[Anthropic::Beta::BetaBashCodeExecutionOutputBlock]
17
+
18
+ attr_accessor return_code: Integer
19
+
20
+ attr_accessor stderr: String
21
+
22
+ attr_accessor stdout: String
23
+
24
+ attr_accessor type: :bash_code_execution_result
25
+
26
+ def initialize: (
27
+ content: ::Array[Anthropic::Beta::BetaBashCodeExecutionOutputBlock],
28
+ return_code: Integer,
29
+ stderr: String,
30
+ stdout: String,
31
+ ?type: :bash_code_execution_result
32
+ ) -> void
33
+
34
+ def to_hash: -> {
35
+ content: ::Array[Anthropic::Beta::BetaBashCodeExecutionOutputBlock],
36
+ return_code: Integer,
37
+ stderr: String,
38
+ stdout: String,
39
+ type: :bash_code_execution_result
40
+ }
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,44 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaBashCodeExecutionResultBlockParam = Beta::BetaBashCodeExecutionResultBlockParam
4
+
5
+ module Beta
6
+ type beta_bash_code_execution_result_block_param =
7
+ {
8
+ content: ::Array[Anthropic::Beta::BetaBashCodeExecutionOutputBlockParam],
9
+ return_code: Integer,
10
+ stderr: String,
11
+ stdout: String,
12
+ type: :bash_code_execution_result
13
+ }
14
+
15
+ class BetaBashCodeExecutionResultBlockParam < Anthropic::Internal::Type::BaseModel
16
+ attr_accessor content: ::Array[Anthropic::Beta::BetaBashCodeExecutionOutputBlockParam]
17
+
18
+ attr_accessor return_code: Integer
19
+
20
+ attr_accessor stderr: String
21
+
22
+ attr_accessor stdout: String
23
+
24
+ attr_accessor type: :bash_code_execution_result
25
+
26
+ def initialize: (
27
+ content: ::Array[Anthropic::Beta::BetaBashCodeExecutionOutputBlockParam],
28
+ return_code: Integer,
29
+ stderr: String,
30
+ stdout: String,
31
+ ?type: :bash_code_execution_result
32
+ ) -> void
33
+
34
+ def to_hash: -> {
35
+ content: ::Array[Anthropic::Beta::BetaBashCodeExecutionOutputBlockParam],
36
+ return_code: Integer,
37
+ stderr: String,
38
+ stdout: String,
39
+ type: :bash_code_execution_result
40
+ }
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,44 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaBashCodeExecutionToolResultBlock = Beta::BetaBashCodeExecutionToolResultBlock
4
+
5
+ module Beta
6
+ type beta_bash_code_execution_tool_result_block =
7
+ {
8
+ content: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock::content,
9
+ tool_use_id: String,
10
+ type: :bash_code_execution_tool_result
11
+ }
12
+
13
+ class BetaBashCodeExecutionToolResultBlock < Anthropic::Internal::Type::BaseModel
14
+ attr_accessor content: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock::content
15
+
16
+ attr_accessor tool_use_id: String
17
+
18
+ attr_accessor type: :bash_code_execution_tool_result
19
+
20
+ def initialize: (
21
+ content: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock::content,
22
+ tool_use_id: String,
23
+ ?type: :bash_code_execution_tool_result
24
+ ) -> void
25
+
26
+ def to_hash: -> {
27
+ content: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock::content,
28
+ tool_use_id: String,
29
+ type: :bash_code_execution_tool_result
30
+ }
31
+
32
+ type content =
33
+ Anthropic::Beta::BetaBashCodeExecutionToolResultError
34
+ | Anthropic::Beta::BetaBashCodeExecutionResultBlock
35
+
36
+ module Content
37
+ extend Anthropic::Internal::Type::Union
38
+
39
+ def self?.variants: -> ::Array[Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock::content]
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,49 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaBashCodeExecutionToolResultBlockParam = Beta::BetaBashCodeExecutionToolResultBlockParam
4
+
5
+ module Beta
6
+ type beta_bash_code_execution_tool_result_block_param =
7
+ {
8
+ content: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam::content,
9
+ tool_use_id: String,
10
+ type: :bash_code_execution_tool_result,
11
+ cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
12
+ }
13
+
14
+ class BetaBashCodeExecutionToolResultBlockParam < Anthropic::Internal::Type::BaseModel
15
+ attr_accessor content: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam::content
16
+
17
+ attr_accessor tool_use_id: String
18
+
19
+ attr_accessor type: :bash_code_execution_tool_result
20
+
21
+ attr_accessor cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
22
+
23
+ def initialize: (
24
+ content: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam::content,
25
+ tool_use_id: String,
26
+ ?cache_control: Anthropic::Beta::BetaCacheControlEphemeral?,
27
+ ?type: :bash_code_execution_tool_result
28
+ ) -> void
29
+
30
+ def to_hash: -> {
31
+ content: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam::content,
32
+ tool_use_id: String,
33
+ type: :bash_code_execution_tool_result,
34
+ cache_control: Anthropic::Beta::BetaCacheControlEphemeral?
35
+ }
36
+
37
+ type content =
38
+ Anthropic::Beta::BetaBashCodeExecutionToolResultErrorParam
39
+ | Anthropic::Beta::BetaBashCodeExecutionResultBlockParam
40
+
41
+ module Content
42
+ extend Anthropic::Internal::Type::Union
43
+
44
+ def self?.variants: -> ::Array[Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam::content]
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,48 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaBashCodeExecutionToolResultError = Beta::BetaBashCodeExecutionToolResultError
4
+
5
+ module Beta
6
+ type beta_bash_code_execution_tool_result_error =
7
+ {
8
+ error_code: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultError::error_code,
9
+ type: :bash_code_execution_tool_result_error
10
+ }
11
+
12
+ class BetaBashCodeExecutionToolResultError < Anthropic::Internal::Type::BaseModel
13
+ attr_accessor error_code: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultError::error_code
14
+
15
+ attr_accessor type: :bash_code_execution_tool_result_error
16
+
17
+ def initialize: (
18
+ error_code: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultError::error_code,
19
+ ?type: :bash_code_execution_tool_result_error
20
+ ) -> void
21
+
22
+ def to_hash: -> {
23
+ error_code: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultError::error_code,
24
+ type: :bash_code_execution_tool_result_error
25
+ }
26
+
27
+ type error_code =
28
+ :invalid_tool_input
29
+ | :unavailable
30
+ | :too_many_requests
31
+ | :execution_time_exceeded
32
+ | :output_file_too_large
33
+
34
+ module ErrorCode
35
+ extend Anthropic::Internal::Type::Enum
36
+
37
+ INVALID_TOOL_INPUT: :invalid_tool_input
38
+ UNAVAILABLE: :unavailable
39
+ TOO_MANY_REQUESTS: :too_many_requests
40
+ EXECUTION_TIME_EXCEEDED: :execution_time_exceeded
41
+ OUTPUT_FILE_TOO_LARGE: :output_file_too_large
42
+
43
+ def self?.values: -> ::Array[Anthropic::Models::Beta::BetaBashCodeExecutionToolResultError::error_code]
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,48 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaBashCodeExecutionToolResultErrorParam = Beta::BetaBashCodeExecutionToolResultErrorParam
4
+
5
+ module Beta
6
+ type beta_bash_code_execution_tool_result_error_param =
7
+ {
8
+ error_code: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultErrorParam::error_code,
9
+ type: :bash_code_execution_tool_result_error
10
+ }
11
+
12
+ class BetaBashCodeExecutionToolResultErrorParam < Anthropic::Internal::Type::BaseModel
13
+ attr_accessor error_code: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultErrorParam::error_code
14
+
15
+ attr_accessor type: :bash_code_execution_tool_result_error
16
+
17
+ def initialize: (
18
+ error_code: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultErrorParam::error_code,
19
+ ?type: :bash_code_execution_tool_result_error
20
+ ) -> void
21
+
22
+ def to_hash: -> {
23
+ error_code: Anthropic::Models::Beta::BetaBashCodeExecutionToolResultErrorParam::error_code,
24
+ type: :bash_code_execution_tool_result_error
25
+ }
26
+
27
+ type error_code =
28
+ :invalid_tool_input
29
+ | :unavailable
30
+ | :too_many_requests
31
+ | :execution_time_exceeded
32
+ | :output_file_too_large
33
+
34
+ module ErrorCode
35
+ extend Anthropic::Internal::Type::Enum
36
+
37
+ INVALID_TOOL_INPUT: :invalid_tool_input
38
+ UNAVAILABLE: :unavailable
39
+ TOO_MANY_REQUESTS: :too_many_requests
40
+ EXECUTION_TIME_EXCEEDED: :execution_time_exceeded
41
+ OUTPUT_FILE_TOO_LARGE: :output_file_too_large
42
+
43
+ def self?.values: -> ::Array[Anthropic::Models::Beta::BetaBashCodeExecutionToolResultErrorParam::error_code]
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -9,6 +9,7 @@ module Anthropic
9
9
  document_index: Integer,
10
10
  document_title: String?,
11
11
  end_char_index: Integer,
12
+ file_id: String?,
12
13
  start_char_index: Integer,
13
14
  type: :char_location
14
15
  }
@@ -22,6 +23,8 @@ module Anthropic
22
23
 
23
24
  attr_accessor end_char_index: Integer
24
25
 
26
+ attr_accessor file_id: String?
27
+
25
28
  attr_accessor start_char_index: Integer
26
29
 
27
30
  attr_accessor type: :char_location
@@ -31,6 +34,7 @@ module Anthropic
31
34
  document_index: Integer,
32
35
  document_title: String?,
33
36
  end_char_index: Integer,
37
+ file_id: String?,
34
38
  start_char_index: Integer,
35
39
  ?type: :char_location
36
40
  ) -> void
@@ -40,6 +44,7 @@ module Anthropic
40
44
  document_index: Integer,
41
45
  document_title: String?,
42
46
  end_char_index: Integer,
47
+ file_id: String?,
43
48
  start_char_index: Integer,
44
49
  type: :char_location
45
50
  }
@@ -0,0 +1,17 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaCitationConfig = Beta::BetaCitationConfig
4
+
5
+ module Beta
6
+ type beta_citation_config = { enabled: bool }
7
+
8
+ class BetaCitationConfig < Anthropic::Internal::Type::BaseModel
9
+ attr_accessor enabled: bool
10
+
11
+ def initialize: (enabled: bool) -> void
12
+
13
+ def to_hash: -> { enabled: bool }
14
+ end
15
+ end
16
+ end
17
+ end
@@ -9,6 +9,7 @@ module Anthropic
9
9
  document_index: Integer,
10
10
  document_title: String?,
11
11
  end_block_index: Integer,
12
+ file_id: String?,
12
13
  start_block_index: Integer,
13
14
  type: :content_block_location
14
15
  }
@@ -22,6 +23,8 @@ module Anthropic
22
23
 
23
24
  attr_accessor end_block_index: Integer
24
25
 
26
+ attr_accessor file_id: String?
27
+
25
28
  attr_accessor start_block_index: Integer
26
29
 
27
30
  attr_accessor type: :content_block_location
@@ -31,6 +34,7 @@ module Anthropic
31
34
  document_index: Integer,
32
35
  document_title: String?,
33
36
  end_block_index: Integer,
37
+ file_id: String?,
34
38
  start_block_index: Integer,
35
39
  ?type: :content_block_location
36
40
  ) -> void
@@ -40,6 +44,7 @@ module Anthropic
40
44
  document_index: Integer,
41
45
  document_title: String?,
42
46
  end_block_index: Integer,
47
+ file_id: String?,
43
48
  start_block_index: Integer,
44
49
  type: :content_block_location
45
50
  }
@@ -9,6 +9,7 @@ module Anthropic
9
9
  document_index: Integer,
10
10
  document_title: String?,
11
11
  end_page_number: Integer,
12
+ file_id: String?,
12
13
  start_page_number: Integer,
13
14
  type: :page_location
14
15
  }
@@ -22,6 +23,8 @@ module Anthropic
22
23
 
23
24
  attr_accessor end_page_number: Integer
24
25
 
26
+ attr_accessor file_id: String?
27
+
25
28
  attr_accessor start_page_number: Integer
26
29
 
27
30
  attr_accessor type: :page_location
@@ -31,6 +34,7 @@ module Anthropic
31
34
  document_index: Integer,
32
35
  document_title: String?,
33
36
  end_page_number: Integer,
37
+ file_id: String?,
34
38
  start_page_number: Integer,
35
39
  ?type: :page_location
36
40
  ) -> void
@@ -40,6 +44,7 @@ module Anthropic
40
44
  document_index: Integer,
41
45
  document_title: String?,
42
46
  end_page_number: Integer,
47
+ file_id: String?,
43
48
  start_page_number: Integer,
44
49
  type: :page_location
45
50
  }
@@ -0,0 +1,54 @@
1
+ module Anthropic
2
+ module Models
3
+ class BetaCitationSearchResultLocation = Beta::BetaCitationSearchResultLocation
4
+
5
+ module Beta
6
+ type beta_citation_search_result_location =
7
+ {
8
+ cited_text: String,
9
+ end_block_index: Integer,
10
+ search_result_index: Integer,
11
+ source: String,
12
+ start_block_index: Integer,
13
+ title: String?,
14
+ type: :search_result_location
15
+ }
16
+
17
+ class BetaCitationSearchResultLocation < Anthropic::Internal::Type::BaseModel
18
+ attr_accessor cited_text: String
19
+
20
+ attr_accessor end_block_index: Integer
21
+
22
+ attr_accessor search_result_index: Integer
23
+
24
+ attr_accessor source: String
25
+
26
+ attr_accessor start_block_index: Integer
27
+
28
+ attr_accessor title: String?
29
+
30
+ attr_accessor type: :search_result_location
31
+
32
+ def initialize: (
33
+ cited_text: String,
34
+ end_block_index: Integer,
35
+ search_result_index: Integer,
36
+ source: String,
37
+ start_block_index: Integer,
38
+ title: String?,
39
+ ?type: :search_result_location
40
+ ) -> void
41
+
42
+ def to_hash: -> {
43
+ cited_text: String,
44
+ end_block_index: Integer,
45
+ search_result_index: Integer,
46
+ source: String,
47
+ start_block_index: Integer,
48
+ title: String?,
49
+ type: :search_result_location
50
+ }
51
+ end
52
+ end
53
+ end
54
+ end