anthropic 1.61.0 → 1.62.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 (618) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -0
  3. data/README.md +1 -1
  4. data/lib/anthropic/client.rb +17 -3
  5. data/lib/anthropic/helpers/bedrock/client.rb +26 -13
  6. data/lib/anthropic/helpers/bedrock/mantle_client.rb +10 -0
  7. data/lib/anthropic/helpers/messages.rb +3 -3
  8. data/lib/anthropic/helpers/streaming/message_stream.rb +37 -8
  9. data/lib/anthropic/helpers/vertex/client.rb +10 -0
  10. data/lib/anthropic/internal/type/base_model.rb +5 -1
  11. data/lib/anthropic/models/beta/agent_create_params.rb +37 -0
  12. data/lib/anthropic/models/beta/agent_update_params.rb +37 -0
  13. data/lib/anthropic/models/beta/beta_advisor_message_iteration_usage.rb +2 -2
  14. data/lib/anthropic/models/beta/beta_citations_delta.rb +59 -0
  15. data/lib/anthropic/models/beta/beta_clear_tool_uses_20250919_edit.rb +22 -0
  16. data/lib/anthropic/models/beta/beta_cloud_config.rb +29 -0
  17. data/lib/anthropic/models/beta/beta_cloud_config_params.rb +32 -3
  18. data/lib/anthropic/models/beta/beta_code_execution_tool_20260120.rb +3 -3
  19. data/lib/anthropic/models/beta/beta_code_execution_tool_20260521.rb +2 -2
  20. data/lib/anthropic/models/beta/beta_content_block.rb +89 -0
  21. data/lib/anthropic/models/beta/beta_content_block_param.rb +113 -0
  22. data/lib/anthropic/models/beta/beta_content_block_source_content.rb +28 -0
  23. data/lib/anthropic/models/beta/beta_context_management_config.rb +39 -0
  24. data/lib/anthropic/models/beta/beta_context_management_response.rb +26 -0
  25. data/lib/anthropic/models/beta/beta_diagnostics.rb +36 -3
  26. data/lib/anthropic/models/beta/beta_diagnostics_param.rb +3 -3
  27. data/lib/anthropic/models/beta/beta_document_block.rb +24 -0
  28. data/lib/anthropic/models/beta/beta_dream.rb +18 -7
  29. data/lib/anthropic/models/beta/beta_dream_input.rb +28 -2
  30. data/lib/anthropic/models/beta/beta_dream_memory_store_input.rb +3 -1
  31. data/lib/anthropic/models/beta/beta_dream_model_config.rb +3 -3
  32. data/lib/anthropic/models/beta/beta_dream_model_config_param.rb +2 -2
  33. data/lib/anthropic/models/beta/beta_environment.rb +26 -2
  34. data/lib/anthropic/models/beta/beta_fallback_block.rb +3 -3
  35. data/lib/anthropic/models/beta/beta_fallback_block_param.rb +3 -3
  36. data/lib/anthropic/models/beta/beta_fallback_credit_not_applied.rb +2 -2
  37. data/lib/anthropic/models/beta/beta_fallback_credit_token_param.rb +3 -3
  38. data/lib/anthropic/models/beta/beta_fallback_credit_usage.rb +29 -2
  39. data/lib/anthropic/models/beta/beta_fallback_info.rb +2 -2
  40. data/lib/anthropic/models/beta/beta_fallback_info_param.rb +2 -2
  41. data/lib/anthropic/models/beta/beta_fallback_message_iteration_usage.rb +3 -3
  42. data/lib/anthropic/models/beta/beta_fallback_param.rb +32 -3
  43. data/lib/anthropic/models/beta/beta_image_block_param.rb +30 -0
  44. data/lib/anthropic/models/beta/beta_iterations_usage.rb +39 -0
  45. data/lib/anthropic/models/beta/beta_limited_network.rb +2 -2
  46. data/lib/anthropic/models/beta/beta_limited_network_params.rb +3 -3
  47. data/lib/anthropic/models/beta/beta_managed_agents_advisor_params.rb +3 -3
  48. data/lib/anthropic/models/beta/beta_managed_agents_agent.rb +60 -2
  49. data/lib/anthropic/models/beta/beta_managed_agents_agent_params.rb +3 -3
  50. data/lib/anthropic/models/beta/beta_managed_agents_agent_tool_config.rb +20 -0
  51. data/lib/anthropic/models/beta/beta_managed_agents_agent_tool_config_params.rb +22 -2
  52. data/lib/anthropic/models/beta/beta_managed_agents_agent_toolset20260401_bash_input.rb +4 -4
  53. data/lib/anthropic/models/beta/beta_managed_agents_agent_toolset20260401_edit_input.rb +3 -3
  54. data/lib/anthropic/models/beta/beta_managed_agents_agent_toolset20260401_glob_input.rb +3 -3
  55. data/lib/anthropic/models/beta/beta_managed_agents_agent_toolset20260401_grep_input.rb +3 -3
  56. data/lib/anthropic/models/beta/beta_managed_agents_agent_toolset20260401_read_input.rb +3 -3
  57. data/lib/anthropic/models/beta/beta_managed_agents_agent_toolset_default_config.rb +20 -0
  58. data/lib/anthropic/models/beta/beta_managed_agents_agent_toolset_default_config_params.rb +22 -2
  59. data/lib/anthropic/models/beta/beta_managed_agents_agent_with_overrides_params.rb +42 -4
  60. data/lib/anthropic/models/beta/beta_managed_agents_cron_schedule.rb +2 -2
  61. data/lib/anthropic/models/beta/beta_managed_agents_cron_schedule_params.rb +3 -3
  62. data/lib/anthropic/models/beta/beta_managed_agents_custom_tool_params.rb +3 -3
  63. data/lib/anthropic/models/beta/beta_managed_agents_deleted_memory_store.rb +2 -2
  64. data/lib/anthropic/models/beta/beta_managed_agents_delta_event.rb +3 -3
  65. data/lib/anthropic/models/beta/beta_managed_agents_deployment.rb +3 -3
  66. data/lib/anthropic/models/beta/beta_managed_agents_deployment_initial_event.rb +30 -0
  67. data/lib/anthropic/models/beta/beta_managed_agents_deployment_initial_event_params.rb +30 -0
  68. data/lib/anthropic/models/beta/beta_managed_agents_deployment_paused_reason.rb +22 -0
  69. data/lib/anthropic/models/beta/beta_managed_agents_deployment_paused_reason_error.rb +44 -0
  70. data/lib/anthropic/models/beta/beta_managed_agents_deployment_run.rb +53 -3
  71. data/lib/anthropic/models/beta/beta_managed_agents_deployment_user_define_outcome_event.rb +24 -0
  72. data/lib/anthropic/models/beta/beta_managed_agents_deployment_user_message_event.rb +32 -0
  73. data/lib/anthropic/models/beta/beta_managed_agents_github_repository_resource_config.rb +24 -0
  74. data/lib/anthropic/models/beta/beta_managed_agents_github_repository_resource_params.rb +24 -0
  75. data/lib/anthropic/models/beta/beta_managed_agents_mcp_tool_config.rb +20 -0
  76. data/lib/anthropic/models/beta/beta_managed_agents_mcp_tool_config_params.rb +20 -0
  77. data/lib/anthropic/models/beta/beta_managed_agents_mcp_toolset_default_config.rb +20 -0
  78. data/lib/anthropic/models/beta/beta_managed_agents_mcp_toolset_default_config_params.rb +20 -0
  79. data/lib/anthropic/models/beta/beta_managed_agents_mcp_toolset_params.rb +2 -2
  80. data/lib/anthropic/models/beta/beta_managed_agents_memory_store.rb +3 -3
  81. data/lib/anthropic/models/beta/beta_managed_agents_memory_store_resource_config.rb +2 -2
  82. data/lib/anthropic/models/beta/beta_managed_agents_memory_store_resource_param.rb +2 -2
  83. data/lib/anthropic/models/beta/beta_managed_agents_model_config.rb +28 -2
  84. data/lib/anthropic/models/beta/beta_managed_agents_model_config_params.rb +2 -2
  85. data/lib/anthropic/models/beta/beta_managed_agents_multiagent.rb +28 -2
  86. data/lib/anthropic/models/beta/beta_managed_agents_multiagent_coordinator.rb +28 -2
  87. data/lib/anthropic/models/beta/beta_managed_agents_multiagent_coordinator_params.rb +3 -3
  88. data/lib/anthropic/models/beta/beta_managed_agents_multiagent_params.rb +3 -3
  89. data/lib/anthropic/models/beta/beta_managed_agents_outcome_evaluation_resource.rb +2 -2
  90. data/lib/anthropic/models/beta/beta_managed_agents_schedule.rb +2 -2
  91. data/lib/anthropic/models/beta/beta_managed_agents_schedule_params.rb +3 -3
  92. data/lib/anthropic/models/beta/beta_managed_agents_session.rb +2 -2
  93. data/lib/anthropic/models/beta/beta_managed_agents_session_agent.rb +61 -3
  94. data/lib/anthropic/models/beta/beta_managed_agents_session_agent_update.rb +41 -3
  95. data/lib/anthropic/models/beta/beta_managed_agents_session_multiagent_coordinator.rb +38 -0
  96. data/lib/anthropic/models/beta/beta_managed_agents_session_resource_config.rb +41 -0
  97. data/lib/anthropic/models/beta/beta_managed_agents_session_stats.rb +2 -2
  98. data/lib/anthropic/models/beta/beta_managed_agents_session_thread_agent.rb +58 -0
  99. data/lib/anthropic/models/beta/beta_managed_agents_session_updated_event.rb +4 -4
  100. data/lib/anthropic/models/beta/beta_managed_agents_session_usage.rb +2 -2
  101. data/lib/anthropic/models/beta/beta_managed_agents_session_usage_event.rb +2 -2
  102. data/lib/anthropic/models/beta/beta_managed_agents_skill_params.rb +24 -0
  103. data/lib/anthropic/models/beta/beta_managed_agents_start_event.rb +3 -3
  104. data/lib/anthropic/models/beta/beta_managed_agents_start_event_preview.rb +25 -0
  105. data/lib/anthropic/models/beta/beta_managed_agents_trigger_context.rb +22 -0
  106. data/lib/anthropic/models/beta/beta_managed_agents_url_mcp_server_params.rb +2 -2
  107. data/lib/anthropic/models/beta/beta_managed_agents_user_tool_result_event.rb +40 -4
  108. data/lib/anthropic/models/beta/beta_memory_tool_20250818_command.rb +46 -0
  109. data/lib/anthropic/models/beta/beta_message_iteration_usage.rb +2 -2
  110. data/lib/anthropic/models/beta/beta_mid_conversation_system_block_param.rb +34 -0
  111. data/lib/anthropic/models/beta/beta_output_behavior.rb +49 -0
  112. data/lib/anthropic/models/beta/beta_output_behavior_create_new.rb +33 -0
  113. data/lib/anthropic/models/beta/beta_output_behavior_update_existing.rb +39 -0
  114. data/lib/anthropic/models/beta/beta_raw_content_block_delta.rb +47 -0
  115. data/lib/anthropic/models/beta/beta_raw_content_block_start_event.rb +90 -0
  116. data/lib/anthropic/models/beta/beta_raw_message_stream_event.rb +43 -0
  117. data/lib/anthropic/models/beta/beta_refusal_stop_details.rb +2 -2
  118. data/lib/anthropic/models/beta/beta_request_document_block.rb +36 -0
  119. data/lib/anthropic/models/beta/beta_request_tool_addition_block.rb +29 -3
  120. data/lib/anthropic/models/beta/beta_request_tool_removal_block.rb +29 -3
  121. data/lib/anthropic/models/beta/beta_server_tool_use_block.rb +24 -0
  122. data/lib/anthropic/models/beta/beta_server_tool_use_block_param.rb +24 -0
  123. data/lib/anthropic/models/beta/beta_text_citation.rb +59 -0
  124. data/lib/anthropic/models/beta/beta_text_citation_param.rb +57 -0
  125. data/lib/anthropic/models/beta/beta_thinking_config_param.rb +29 -0
  126. data/lib/anthropic/models/beta/beta_token_task_budget.rb +2 -2
  127. data/lib/anthropic/models/beta/beta_tool_choice.rb +31 -0
  128. data/lib/anthropic/models/beta/beta_tool_choice_any.rb +2 -2
  129. data/lib/anthropic/models/beta/beta_tool_choice_auto.rb +2 -2
  130. data/lib/anthropic/models/beta/beta_tool_choice_tool.rb +2 -2
  131. data/lib/anthropic/models/beta/beta_tool_result_block_param.rb +42 -0
  132. data/lib/anthropic/models/beta/beta_tool_use_block.rb +24 -0
  133. data/lib/anthropic/models/beta/beta_tool_use_block_param.rb +24 -0
  134. data/lib/anthropic/models/beta/beta_tunnel.rb +2 -2
  135. data/lib/anthropic/models/beta/beta_tunnel_token.rb +2 -2
  136. data/lib/anthropic/models/beta/beta_user_profile.rb +3 -3
  137. data/lib/anthropic/models/beta/beta_web_fetch_tool_20260309.rb +2 -2
  138. data/lib/anthropic/models/beta/beta_web_fetch_tool_result_block.rb +24 -0
  139. data/lib/anthropic/models/beta/beta_web_fetch_tool_result_block_param.rb +24 -0
  140. data/lib/anthropic/models/beta/beta_web_search_tool_result_block.rb +24 -0
  141. data/lib/anthropic/models/beta/beta_web_search_tool_result_block_param.rb +24 -0
  142. data/lib/anthropic/models/beta/beta_webhook_event_data.rb +114 -0
  143. data/lib/anthropic/models/beta/deployment_create_params.rb +42 -0
  144. data/lib/anthropic/models/beta/deployment_update_params.rb +42 -0
  145. data/lib/anthropic/models/beta/dream_create_params.rb +14 -1
  146. data/lib/anthropic/models/beta/environment_create_params.rb +27 -0
  147. data/lib/anthropic/models/beta/environment_update_params.rb +27 -0
  148. data/lib/anthropic/models/beta/environments/beta_self_hosted_work.rb +3 -3
  149. data/lib/anthropic/models/beta/environments/beta_self_hosted_work_queue_stats.rb +4 -4
  150. data/lib/anthropic/models/beta/environments/beta_self_hosted_work_update_request.rb +2 -2
  151. data/lib/anthropic/models/beta/memory_stores/beta_managed_agents_actor.rb +32 -0
  152. data/lib/anthropic/models/beta/memory_stores/beta_managed_agents_api_actor.rb +3 -3
  153. data/lib/anthropic/models/beta/memory_stores/beta_managed_agents_content_sha256_precondition.rb +4 -4
  154. data/lib/anthropic/models/beta/memory_stores/beta_managed_agents_error.rb +46 -0
  155. data/lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory.rb +4 -4
  156. data/lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory_list_item.rb +42 -0
  157. data/lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory_prefix.rb +4 -4
  158. data/lib/anthropic/models/beta/memory_stores/beta_managed_agents_memory_version.rb +4 -4
  159. data/lib/anthropic/models/beta/memory_stores/beta_managed_agents_precondition.rb +4 -4
  160. data/lib/anthropic/models/beta/memory_stores/beta_managed_agents_session_actor.rb +3 -3
  161. data/lib/anthropic/models/beta/messages/batch_create_params.rb +4 -4
  162. data/lib/anthropic/models/beta/messages/beta_message_batch_individual_response.rb +3 -3
  163. data/lib/anthropic/models/beta/messages/beta_message_batch_result.rb +28 -0
  164. data/lib/anthropic/models/beta/session_create_params.rb +70 -0
  165. data/lib/anthropic/models/beta/sessions/beta_managed_agents_agent_custom_tool_use_event.rb +3 -3
  166. data/lib/anthropic/models/beta/sessions/beta_managed_agents_agent_mcp_tool_result_event.rb +36 -0
  167. data/lib/anthropic/models/beta/sessions/beta_managed_agents_agent_mcp_tool_use_event.rb +2 -2
  168. data/lib/anthropic/models/beta/sessions/beta_managed_agents_agent_message_event.rb +22 -0
  169. data/lib/anthropic/models/beta/sessions/beta_managed_agents_agent_thread_message_received_event.rb +35 -3
  170. data/lib/anthropic/models/beta/sessions/beta_managed_agents_agent_thread_message_sent_event.rb +35 -3
  171. data/lib/anthropic/models/beta/sessions/beta_managed_agents_agent_tool_result_event.rb +36 -0
  172. data/lib/anthropic/models/beta/sessions/beta_managed_agents_agent_tool_use_event.rb +2 -2
  173. data/lib/anthropic/models/beta/sessions/beta_managed_agents_base64_image_source.rb +2 -2
  174. data/lib/anthropic/models/beta/sessions/beta_managed_agents_billing_error.rb +22 -0
  175. data/lib/anthropic/models/beta/sessions/beta_managed_agents_credential_host_unreachable_error.rb +22 -0
  176. data/lib/anthropic/models/beta/sessions/beta_managed_agents_document_block.rb +32 -0
  177. data/lib/anthropic/models/beta/sessions/beta_managed_agents_event_params.rb +54 -0
  178. data/lib/anthropic/models/beta/sessions/beta_managed_agents_github_repository_resource.rb +24 -0
  179. data/lib/anthropic/models/beta/sessions/beta_managed_agents_image_block.rb +34 -0
  180. data/lib/anthropic/models/beta/sessions/beta_managed_agents_mcp_authentication_failed_error.rb +22 -0
  181. data/lib/anthropic/models/beta/sessions/beta_managed_agents_mcp_connection_failed_error.rb +22 -0
  182. data/lib/anthropic/models/beta/sessions/beta_managed_agents_memory_store_resource.rb +2 -2
  183. data/lib/anthropic/models/beta/sessions/beta_managed_agents_model_overloaded_error.rb +22 -0
  184. data/lib/anthropic/models/beta/sessions/beta_managed_agents_model_rate_limited_error.rb +22 -0
  185. data/lib/anthropic/models/beta/sessions/beta_managed_agents_model_request_failed_error.rb +22 -0
  186. data/lib/anthropic/models/beta/sessions/beta_managed_agents_send_session_events.rb +60 -0
  187. data/lib/anthropic/models/beta/sessions/beta_managed_agents_session_error_event.rb +44 -2
  188. data/lib/anthropic/models/beta/sessions/beta_managed_agents_session_event.rb +160 -0
  189. data/lib/anthropic/models/beta/sessions/beta_managed_agents_session_requires_action.rb +4 -4
  190. data/lib/anthropic/models/beta/sessions/beta_managed_agents_session_resource.rb +51 -0
  191. data/lib/anthropic/models/beta/sessions/beta_managed_agents_session_status_idle_event.rb +30 -0
  192. data/lib/anthropic/models/beta/sessions/beta_managed_agents_session_thread.rb +38 -0
  193. data/lib/anthropic/models/beta/sessions/beta_managed_agents_session_thread_stats.rb +2 -2
  194. data/lib/anthropic/models/beta/sessions/beta_managed_agents_session_thread_status_idle_event.rb +30 -0
  195. data/lib/anthropic/models/beta/sessions/beta_managed_agents_session_thread_usage.rb +2 -2
  196. data/lib/anthropic/models/beta/sessions/beta_managed_agents_session_usage_snapshot.rb +2 -2
  197. data/lib/anthropic/models/beta/sessions/beta_managed_agents_span_model_usage.rb +2 -2
  198. data/lib/anthropic/models/beta/sessions/beta_managed_agents_span_outcome_evaluation_end_event.rb +4 -4
  199. data/lib/anthropic/models/beta/sessions/beta_managed_agents_span_outcome_evaluation_ongoing_event.rb +4 -4
  200. data/lib/anthropic/models/beta/sessions/beta_managed_agents_span_outcome_evaluation_start_event.rb +2 -2
  201. data/lib/anthropic/models/beta/sessions/beta_managed_agents_stream_session_events.rb +170 -0
  202. data/lib/anthropic/models/beta/sessions/beta_managed_agents_stream_session_thread_events.rb +170 -0
  203. data/lib/anthropic/models/beta/sessions/beta_managed_agents_text_rubric_params.rb +2 -2
  204. data/lib/anthropic/models/beta/sessions/beta_managed_agents_unknown_error.rb +22 -0
  205. data/lib/anthropic/models/beta/sessions/beta_managed_agents_user_custom_tool_result_event.rb +38 -2
  206. data/lib/anthropic/models/beta/sessions/beta_managed_agents_user_custom_tool_result_event_params.rb +38 -2
  207. data/lib/anthropic/models/beta/sessions/beta_managed_agents_user_define_outcome_event.rb +27 -3
  208. data/lib/anthropic/models/beta/sessions/beta_managed_agents_user_define_outcome_event_params.rb +28 -0
  209. data/lib/anthropic/models/beta/sessions/beta_managed_agents_user_interrupt_event.rb +2 -2
  210. data/lib/anthropic/models/beta/sessions/beta_managed_agents_user_interrupt_event_params.rb +2 -2
  211. data/lib/anthropic/models/beta/sessions/beta_managed_agents_user_message_event.rb +32 -0
  212. data/lib/anthropic/models/beta/sessions/beta_managed_agents_user_message_event_params.rb +32 -0
  213. data/lib/anthropic/models/beta/sessions/beta_managed_agents_user_tool_confirmation_event.rb +2 -2
  214. data/lib/anthropic/models/beta/sessions/beta_managed_agents_user_tool_confirmation_event_params.rb +2 -2
  215. data/lib/anthropic/models/beta/sessions/beta_managed_agents_user_tool_result_event_params.rb +40 -4
  216. data/lib/anthropic/models/beta/sessions/resource_retrieve_response.rb +50 -0
  217. data/lib/anthropic/models/beta/sessions/resource_update_response.rb +50 -0
  218. data/lib/anthropic/models/beta/user_profile_create_params.rb +4 -4
  219. data/lib/anthropic/models/beta/vaults/beta_managed_agents_credential.rb +34 -0
  220. data/lib/anthropic/models/beta/vaults/beta_managed_agents_credential_networking_params.rb +26 -0
  221. data/lib/anthropic/models/beta/vaults/beta_managed_agents_environment_variable_auth_response.rb +26 -0
  222. data/lib/anthropic/models/beta/vaults/beta_managed_agents_limited_credential_networking_params.rb +2 -2
  223. data/lib/anthropic/models/beta/vaults/beta_managed_agents_limited_credential_networking_response.rb +2 -2
  224. data/lib/anthropic/models/beta/vaults/beta_managed_agents_mcp_oauth_refresh_params.rb +24 -0
  225. data/lib/anthropic/models/beta/vaults/beta_managed_agents_mcp_oauth_refresh_response.rb +22 -0
  226. data/lib/anthropic/models/beta/vaults/beta_managed_agents_mcp_oauth_refresh_update_params.rb +22 -0
  227. data/lib/anthropic/models/beta/vaults/credential_create_params.rb +40 -0
  228. data/lib/anthropic/models/beta/vaults/credential_update_params.rb +36 -0
  229. data/lib/anthropic/models/beta_error.rb +36 -0
  230. data/lib/anthropic/models/beta_monetary_amount.rb +2 -2
  231. data/lib/anthropic/models/citations_delta.rb +59 -0
  232. data/lib/anthropic/models/code_execution_tool_20260120.rb +3 -3
  233. data/lib/anthropic/models/code_execution_tool_20260521.rb +2 -2
  234. data/lib/anthropic/models/content_block.rb +67 -0
  235. data/lib/anthropic/models/content_block_param.rb +87 -0
  236. data/lib/anthropic/models/content_block_source_content.rb +28 -0
  237. data/lib/anthropic/models/document_block.rb +24 -0
  238. data/lib/anthropic/models/document_block_param.rb +32 -0
  239. data/lib/anthropic/models/error_object.rb +36 -0
  240. data/lib/anthropic/models/image_block_param.rb +26 -0
  241. data/lib/anthropic/models/messages/batch_create_params.rb +4 -4
  242. data/lib/anthropic/models/messages/message_batch_individual_response.rb +3 -3
  243. data/lib/anthropic/models/messages/message_batch_result.rb +28 -0
  244. data/lib/anthropic/models/raw_content_block_delta.rb +39 -0
  245. data/lib/anthropic/models/raw_content_block_start_event.rb +67 -0
  246. data/lib/anthropic/models/raw_message_stream_event.rb +41 -0
  247. data/lib/anthropic/models/refusal_stop_details.rb +2 -2
  248. data/lib/anthropic/models/server_tool_use_block.rb +24 -0
  249. data/lib/anthropic/models/server_tool_use_block_param.rb +24 -0
  250. data/lib/anthropic/models/text_citation.rb +59 -0
  251. data/lib/anthropic/models/text_citation_param.rb +57 -0
  252. data/lib/anthropic/models/thinking_config_param.rb +29 -0
  253. data/lib/anthropic/models/tool_choice.rb +31 -0
  254. data/lib/anthropic/models/tool_choice_any.rb +2 -2
  255. data/lib/anthropic/models/tool_choice_auto.rb +2 -2
  256. data/lib/anthropic/models/tool_choice_tool.rb +2 -2
  257. data/lib/anthropic/models/tool_result_block_param.rb +42 -0
  258. data/lib/anthropic/models/tool_use_block.rb +24 -0
  259. data/lib/anthropic/models/tool_use_block_param.rb +24 -0
  260. data/lib/anthropic/models/web_fetch_tool_20260309.rb +2 -2
  261. data/lib/anthropic/models/web_fetch_tool_result_block.rb +24 -0
  262. data/lib/anthropic/models/web_fetch_tool_result_block_param.rb +24 -0
  263. data/lib/anthropic/models/web_search_tool_result_block.rb +24 -0
  264. data/lib/anthropic/models/web_search_tool_result_block_param.rb +24 -0
  265. data/lib/anthropic/resources/beta/agents.rb +6 -6
  266. data/lib/anthropic/resources/beta/deployment_runs.rb +2 -2
  267. data/lib/anthropic/resources/beta/deployments.rb +6 -6
  268. data/lib/anthropic/resources/beta/dreams.rb +8 -3
  269. data/lib/anthropic/resources/beta/environments/work.rb +9 -9
  270. data/lib/anthropic/resources/beta/environments.rb +6 -6
  271. data/lib/anthropic/resources/beta/files.rb +2 -2
  272. data/lib/anthropic/resources/beta/memory_stores/memories.rb +6 -6
  273. data/lib/anthropic/resources/beta/memory_stores.rb +6 -6
  274. data/lib/anthropic/resources/beta/messages/batches.rb +6 -6
  275. data/lib/anthropic/resources/beta/messages.rb +9 -9
  276. data/lib/anthropic/resources/beta/models.rb +3 -3
  277. data/lib/anthropic/resources/beta/sessions/events.rb +4 -4
  278. data/lib/anthropic/resources/beta/sessions/resources.rb +6 -6
  279. data/lib/anthropic/resources/beta/sessions/threads/events.rb +2 -2
  280. data/lib/anthropic/resources/beta/sessions/threads.rb +2 -2
  281. data/lib/anthropic/resources/beta/sessions.rb +6 -6
  282. data/lib/anthropic/resources/beta/skills/versions.rb +10 -10
  283. data/lib/anthropic/resources/beta/skills.rb +8 -8
  284. data/lib/anthropic/resources/beta/tunnels/certificates.rb +6 -6
  285. data/lib/anthropic/resources/beta/tunnels.rb +3 -3
  286. data/lib/anthropic/resources/beta/user_profiles.rb +5 -5
  287. data/lib/anthropic/resources/beta/vaults/credentials.rb +6 -6
  288. data/lib/anthropic/resources/beta/vaults.rb +6 -6
  289. data/lib/anthropic/resources/completions.rb +6 -6
  290. data/lib/anthropic/resources/messages/batches.rb +6 -6
  291. data/lib/anthropic/resources/messages.rb +9 -9
  292. data/lib/anthropic/resources/models.rb +3 -3
  293. data/lib/anthropic/version.rb +1 -1
  294. data/lib/anthropic.rb +3 -0
  295. data/rbi/anthropic/client.rbi +5 -0
  296. data/rbi/anthropic/helpers/bedrock/client.rbi +8 -0
  297. data/rbi/anthropic/helpers/bedrock/mantle_client.rbi +4 -0
  298. data/rbi/anthropic/helpers/vertex/client.rbi +5 -0
  299. data/rbi/anthropic/models/beta/agent_create_params.rbi +50 -0
  300. data/rbi/anthropic/models/beta/agent_update_params.rbi +50 -0
  301. data/rbi/anthropic/models/beta/beta_citations_delta.rbi +60 -0
  302. data/rbi/anthropic/models/beta/beta_clear_tool_uses_20250919_edit.rbi +10 -0
  303. data/rbi/anthropic/models/beta/beta_cloud_config.rbi +23 -0
  304. data/rbi/anthropic/models/beta/beta_cloud_config_params.rbi +25 -0
  305. data/rbi/anthropic/models/beta/beta_content_block.rbi +142 -0
  306. data/rbi/anthropic/models/beta/beta_content_block_param.rbi +170 -0
  307. data/rbi/anthropic/models/beta/beta_content_block_source_content.rbi +38 -0
  308. data/rbi/anthropic/models/beta/beta_context_management_config.rbi +55 -0
  309. data/rbi/anthropic/models/beta/beta_context_management_response.rbi +23 -0
  310. data/rbi/anthropic/models/beta/beta_diagnostics.rbi +18 -0
  311. data/rbi/anthropic/models/beta/beta_document_block.rbi +12 -0
  312. data/rbi/anthropic/models/beta/beta_dream.rbi +20 -3
  313. data/rbi/anthropic/models/beta/beta_dream_input.rbi +15 -1
  314. data/rbi/anthropic/models/beta/beta_dream_memory_store_input.rbi +3 -1
  315. data/rbi/anthropic/models/beta/beta_environment.rbi +22 -0
  316. data/rbi/anthropic/models/beta/beta_fallback_credit_usage.rbi +30 -0
  317. data/rbi/anthropic/models/beta/beta_fallback_param.rbi +37 -0
  318. data/rbi/anthropic/models/beta/beta_image_block_param.rbi +21 -0
  319. data/rbi/anthropic/models/beta/beta_iterations_usage.rbi +34 -0
  320. data/rbi/anthropic/models/beta/beta_managed_agents_agent.rbi +51 -0
  321. data/rbi/anthropic/models/beta/beta_managed_agents_agent_tool_config.rbi +10 -0
  322. data/rbi/anthropic/models/beta/beta_managed_agents_agent_tool_config_params.rbi +10 -0
  323. data/rbi/anthropic/models/beta/beta_managed_agents_agent_toolset_default_config.rbi +10 -0
  324. data/rbi/anthropic/models/beta/beta_managed_agents_agent_toolset_default_config_params.rbi +10 -0
  325. data/rbi/anthropic/models/beta/beta_managed_agents_agent_with_overrides_params.rbi +52 -0
  326. data/rbi/anthropic/models/beta/beta_managed_agents_deployment_initial_event.rbi +43 -0
  327. data/rbi/anthropic/models/beta/beta_managed_agents_deployment_initial_event_params.rbi +43 -0
  328. data/rbi/anthropic/models/beta/beta_managed_agents_deployment_paused_reason.rbi +33 -0
  329. data/rbi/anthropic/models/beta/beta_managed_agents_deployment_paused_reason_error.rbi +10 -0
  330. data/rbi/anthropic/models/beta/beta_managed_agents_deployment_run.rbi +14 -0
  331. data/rbi/anthropic/models/beta/beta_managed_agents_deployment_user_define_outcome_event.rbi +20 -0
  332. data/rbi/anthropic/models/beta/beta_managed_agents_deployment_user_message_event.rbi +39 -0
  333. data/rbi/anthropic/models/beta/beta_managed_agents_github_repository_resource_config.rbi +20 -0
  334. data/rbi/anthropic/models/beta/beta_managed_agents_github_repository_resource_params.rbi +20 -0
  335. data/rbi/anthropic/models/beta/beta_managed_agents_mcp_tool_config.rbi +10 -0
  336. data/rbi/anthropic/models/beta/beta_managed_agents_mcp_tool_config_params.rbi +10 -0
  337. data/rbi/anthropic/models/beta/beta_managed_agents_mcp_toolset_default_config.rbi +10 -0
  338. data/rbi/anthropic/models/beta/beta_managed_agents_mcp_toolset_default_config_params.rbi +10 -0
  339. data/rbi/anthropic/models/beta/beta_managed_agents_model_config.rbi +10 -0
  340. data/rbi/anthropic/models/beta/beta_managed_agents_multiagent.rbi +21 -0
  341. data/rbi/anthropic/models/beta/beta_managed_agents_multiagent_coordinator.rbi +21 -0
  342. data/rbi/anthropic/models/beta/beta_managed_agents_session_agent.rbi +55 -0
  343. data/rbi/anthropic/models/beta/beta_managed_agents_session_agent_update.rbi +52 -0
  344. data/rbi/anthropic/models/beta/beta_managed_agents_session_multiagent_coordinator.rbi +53 -0
  345. data/rbi/anthropic/models/beta/beta_managed_agents_session_resource_config.rbi +46 -0
  346. data/rbi/anthropic/models/beta/beta_managed_agents_session_thread_agent.rbi +55 -0
  347. data/rbi/anthropic/models/beta/beta_managed_agents_skill_params.rbi +18 -0
  348. data/rbi/anthropic/models/beta/beta_managed_agents_start_event_preview.rbi +15 -0
  349. data/rbi/anthropic/models/beta/beta_managed_agents_trigger_context.rbi +14 -0
  350. data/rbi/anthropic/models/beta/beta_managed_agents_user_tool_result_event.rbi +50 -0
  351. data/rbi/anthropic/models/beta/beta_memory_tool_20250818_command.rbi +39 -0
  352. data/rbi/anthropic/models/beta/beta_mid_conversation_system_block_param.rbi +43 -0
  353. data/rbi/anthropic/models/beta/beta_output_behavior.rbi +42 -0
  354. data/rbi/anthropic/models/beta/beta_output_behavior_create_new.rbi +71 -0
  355. data/rbi/anthropic/models/beta/beta_output_behavior_update_existing.rbi +83 -0
  356. data/rbi/anthropic/models/beta/beta_raw_content_block_delta.rbi +50 -0
  357. data/rbi/anthropic/models/beta/beta_raw_content_block_start_event.rbi +144 -0
  358. data/rbi/anthropic/models/beta/beta_raw_message_stream_event.rbi +72 -0
  359. data/rbi/anthropic/models/beta/beta_request_document_block.rbi +25 -0
  360. data/rbi/anthropic/models/beta/beta_request_tool_addition_block.rbi +14 -0
  361. data/rbi/anthropic/models/beta/beta_request_tool_removal_block.rbi +14 -0
  362. data/rbi/anthropic/models/beta/beta_server_tool_use_block.rbi +10 -0
  363. data/rbi/anthropic/models/beta/beta_server_tool_use_block_param.rbi +10 -0
  364. data/rbi/anthropic/models/beta/beta_text_citation.rbi +60 -0
  365. data/rbi/anthropic/models/beta/beta_text_citation_param.rbi +58 -0
  366. data/rbi/anthropic/models/beta/beta_thinking_config_param.rbi +37 -0
  367. data/rbi/anthropic/models/beta/beta_tool_choice.rbi +21 -0
  368. data/rbi/anthropic/models/beta/beta_tool_result_block_param.rbi +62 -0
  369. data/rbi/anthropic/models/beta/beta_tool_use_block.rbi +10 -0
  370. data/rbi/anthropic/models/beta/beta_tool_use_block_param.rbi +10 -0
  371. data/rbi/anthropic/models/beta/beta_user_profile.rbi +4 -4
  372. data/rbi/anthropic/models/beta/beta_web_fetch_tool_result_block.rbi +10 -0
  373. data/rbi/anthropic/models/beta/beta_web_fetch_tool_result_block_param.rbi +10 -0
  374. data/rbi/anthropic/models/beta/beta_web_search_tool_result_block.rbi +10 -0
  375. data/rbi/anthropic/models/beta/beta_web_search_tool_result_block_param.rbi +10 -0
  376. data/rbi/anthropic/models/beta/beta_webhook_event_data.rbi +25 -0
  377. data/rbi/anthropic/models/beta/deployment_create_params.rbi +49 -0
  378. data/rbi/anthropic/models/beta/deployment_update_params.rbi +49 -0
  379. data/rbi/anthropic/models/beta/dream_create_params.rbi +40 -0
  380. data/rbi/anthropic/models/beta/environment_create_params.rbi +30 -0
  381. data/rbi/anthropic/models/beta/environment_update_params.rbi +30 -0
  382. data/rbi/anthropic/models/beta/memory_stores/beta_managed_agents_actor.rbi +26 -0
  383. data/rbi/anthropic/models/beta/memory_stores/beta_managed_agents_error.rbi +20 -0
  384. data/rbi/anthropic/models/beta/memory_stores/beta_managed_agents_memory_list_item.rbi +53 -0
  385. data/rbi/anthropic/models/beta/messages/beta_message_batch_result.rbi +14 -0
  386. data/rbi/anthropic/models/beta/session_create_params.rbi +85 -0
  387. data/rbi/anthropic/models/beta/sessions/beta_managed_agents_agent_mcp_tool_result_event.rbi +50 -0
  388. data/rbi/anthropic/models/beta/sessions/beta_managed_agents_agent_message_event.rbi +14 -0
  389. data/rbi/anthropic/models/beta/sessions/beta_managed_agents_agent_thread_message_received_event.rbi +39 -0
  390. data/rbi/anthropic/models/beta/sessions/beta_managed_agents_agent_thread_message_sent_event.rbi +39 -0
  391. data/rbi/anthropic/models/beta/sessions/beta_managed_agents_agent_tool_result_event.rbi +50 -0
  392. data/rbi/anthropic/models/beta/sessions/beta_managed_agents_billing_error.rbi +10 -0
  393. data/rbi/anthropic/models/beta/sessions/beta_managed_agents_credential_host_unreachable_error.rbi +10 -0
  394. data/rbi/anthropic/models/beta/sessions/beta_managed_agents_document_block.rbi +30 -0
  395. data/rbi/anthropic/models/beta/sessions/beta_managed_agents_event_params.rbi +79 -0
  396. data/rbi/anthropic/models/beta/sessions/beta_managed_agents_github_repository_resource.rbi +20 -0
  397. data/rbi/anthropic/models/beta/sessions/beta_managed_agents_image_block.rbi +27 -0
  398. data/rbi/anthropic/models/beta/sessions/beta_managed_agents_mcp_authentication_failed_error.rbi +10 -0
  399. data/rbi/anthropic/models/beta/sessions/beta_managed_agents_mcp_connection_failed_error.rbi +10 -0
  400. data/rbi/anthropic/models/beta/sessions/beta_managed_agents_model_overloaded_error.rbi +10 -0
  401. data/rbi/anthropic/models/beta/sessions/beta_managed_agents_model_rate_limited_error.rbi +10 -0
  402. data/rbi/anthropic/models/beta/sessions/beta_managed_agents_model_request_failed_error.rbi +10 -0
  403. data/rbi/anthropic/models/beta/sessions/beta_managed_agents_send_session_events.rbi +89 -0
  404. data/rbi/anthropic/models/beta/sessions/beta_managed_agents_session_error_event.rbi +34 -0
  405. data/rbi/anthropic/models/beta/sessions/beta_managed_agents_session_event.rbi +203 -0
  406. data/rbi/anthropic/models/beta/sessions/beta_managed_agents_session_resource.rbi +60 -0
  407. data/rbi/anthropic/models/beta/sessions/beta_managed_agents_session_status_idle_event.rbi +18 -0
  408. data/rbi/anthropic/models/beta/sessions/beta_managed_agents_session_thread.rbi +53 -0
  409. data/rbi/anthropic/models/beta/sessions/beta_managed_agents_session_thread_status_idle_event.rbi +18 -0
  410. data/rbi/anthropic/models/beta/sessions/beta_managed_agents_stream_session_events.rbi +222 -0
  411. data/rbi/anthropic/models/beta/sessions/beta_managed_agents_stream_session_thread_events.rbi +222 -0
  412. data/rbi/anthropic/models/beta/sessions/beta_managed_agents_unknown_error.rbi +10 -0
  413. data/rbi/anthropic/models/beta/sessions/beta_managed_agents_user_custom_tool_result_event.rbi +50 -0
  414. data/rbi/anthropic/models/beta/sessions/beta_managed_agents_user_custom_tool_result_event_params.rbi +50 -0
  415. data/rbi/anthropic/models/beta/sessions/beta_managed_agents_user_define_outcome_event.rbi +20 -0
  416. data/rbi/anthropic/models/beta/sessions/beta_managed_agents_user_define_outcome_event_params.rbi +21 -0
  417. data/rbi/anthropic/models/beta/sessions/beta_managed_agents_user_message_event.rbi +39 -0
  418. data/rbi/anthropic/models/beta/sessions/beta_managed_agents_user_message_event_params.rbi +39 -0
  419. data/rbi/anthropic/models/beta/sessions/beta_managed_agents_user_tool_result_event_params.rbi +50 -0
  420. data/rbi/anthropic/models/beta/sessions/resource_retrieve_response.rbi +60 -0
  421. data/rbi/anthropic/models/beta/sessions/resource_update_response.rbi +60 -0
  422. data/rbi/anthropic/models/beta/user_profile_create_params.rbi +6 -6
  423. data/rbi/anthropic/models/beta/vaults/beta_managed_agents_credential.rbi +40 -0
  424. data/rbi/anthropic/models/beta/vaults/beta_managed_agents_credential_networking_params.rbi +20 -0
  425. data/rbi/anthropic/models/beta/vaults/beta_managed_agents_environment_variable_auth_response.rbi +19 -0
  426. data/rbi/anthropic/models/beta/vaults/beta_managed_agents_mcp_oauth_refresh_params.rbi +17 -0
  427. data/rbi/anthropic/models/beta/vaults/beta_managed_agents_mcp_oauth_refresh_response.rbi +10 -0
  428. data/rbi/anthropic/models/beta/vaults/beta_managed_agents_mcp_oauth_refresh_update_params.rbi +17 -0
  429. data/rbi/anthropic/models/beta/vaults/credential_create_params.rbi +49 -0
  430. data/rbi/anthropic/models/beta/vaults/credential_update_params.rbi +45 -0
  431. data/rbi/anthropic/models/beta_error.rbi +10 -0
  432. data/rbi/anthropic/models/citations_delta.rbi +60 -0
  433. data/rbi/anthropic/models/content_block.rbi +109 -0
  434. data/rbi/anthropic/models/content_block_param.rbi +122 -0
  435. data/rbi/anthropic/models/content_block_source_content.rbi +36 -0
  436. data/rbi/anthropic/models/document_block.rbi +12 -0
  437. data/rbi/anthropic/models/document_block_param.rbi +14 -0
  438. data/rbi/anthropic/models/error_object.rbi +10 -0
  439. data/rbi/anthropic/models/image_block_param.rbi +13 -0
  440. data/rbi/anthropic/models/messages/message_batch_result.rbi +12 -0
  441. data/rbi/anthropic/models/raw_content_block_delta.rbi +35 -0
  442. data/rbi/anthropic/models/raw_content_block_start_event.rbi +111 -0
  443. data/rbi/anthropic/models/raw_message_stream_event.rbi +62 -0
  444. data/rbi/anthropic/models/server_tool_use_block.rbi +10 -0
  445. data/rbi/anthropic/models/server_tool_use_block_param.rbi +10 -0
  446. data/rbi/anthropic/models/text_citation.rbi +60 -0
  447. data/rbi/anthropic/models/text_citation_param.rbi +58 -0
  448. data/rbi/anthropic/models/thinking_config_param.rbi +33 -0
  449. data/rbi/anthropic/models/tool_choice.rbi +21 -0
  450. data/rbi/anthropic/models/tool_result_block_param.rbi +60 -0
  451. data/rbi/anthropic/models/tool_use_block.rbi +10 -0
  452. data/rbi/anthropic/models/tool_use_block_param.rbi +10 -0
  453. data/rbi/anthropic/models/web_fetch_tool_result_block.rbi +10 -0
  454. data/rbi/anthropic/models/web_fetch_tool_result_block_param.rbi +10 -0
  455. data/rbi/anthropic/models/web_search_tool_result_block.rbi +10 -0
  456. data/rbi/anthropic/models/web_search_tool_result_block_param.rbi +10 -0
  457. data/rbi/anthropic/resources/beta/dreams.rbi +9 -0
  458. data/rbi/anthropic/resources/beta/user_profiles.rbi +3 -3
  459. data/sig/anthropic/client.rbs +1 -0
  460. data/sig/anthropic/helpers/bedrock/client.rbs +4 -0
  461. data/sig/anthropic/helpers/vertex/client.rbs +2 -0
  462. data/sig/anthropic/models/beta/agent_create_params.rbs +30 -0
  463. data/sig/anthropic/models/beta/agent_update_params.rbs +30 -0
  464. data/sig/anthropic/models/beta/beta_citations_delta.rbs +63 -0
  465. data/sig/anthropic/models/beta/beta_clear_tool_uses_20250919_edit.rbs +14 -0
  466. data/sig/anthropic/models/beta/beta_cloud_config.rbs +17 -0
  467. data/sig/anthropic/models/beta/beta_cloud_config_params.rbs +17 -0
  468. data/sig/anthropic/models/beta/beta_content_block.rbs +130 -0
  469. data/sig/anthropic/models/beta/beta_content_block_param.rbs +200 -0
  470. data/sig/anthropic/models/beta/beta_content_block_source_content.rbs +20 -0
  471. data/sig/anthropic/models/beta/beta_context_management_config.rbs +32 -0
  472. data/sig/anthropic/models/beta/beta_context_management_response.rbs +18 -0
  473. data/sig/anthropic/models/beta/beta_diagnostics.rbs +28 -0
  474. data/sig/anthropic/models/beta/beta_document_block.rbs +17 -0
  475. data/sig/anthropic/models/beta/beta_dream.rbs +5 -0
  476. data/sig/anthropic/models/beta/beta_dream_input.rbs +15 -0
  477. data/sig/anthropic/models/beta/beta_environment.rbs +15 -0
  478. data/sig/anthropic/models/beta/beta_fallback_credit_usage.rbs +15 -0
  479. data/sig/anthropic/models/beta/beta_fallback_param.rbs +20 -0
  480. data/sig/anthropic/models/beta/beta_image_block_param.rbs +22 -0
  481. data/sig/anthropic/models/beta/beta_iterations_usage.rbs +46 -0
  482. data/sig/anthropic/models/beta/beta_managed_agents_agent.rbs +47 -0
  483. data/sig/anthropic/models/beta/beta_managed_agents_agent_tool_config.rbs +11 -0
  484. data/sig/anthropic/models/beta/beta_managed_agents_agent_tool_config_params.rbs +11 -0
  485. data/sig/anthropic/models/beta/beta_managed_agents_agent_toolset_default_config.rbs +11 -0
  486. data/sig/anthropic/models/beta/beta_managed_agents_agent_toolset_default_config_params.rbs +11 -0
  487. data/sig/anthropic/models/beta/beta_managed_agents_agent_with_overrides_params.rbs +30 -0
  488. data/sig/anthropic/models/beta/beta_managed_agents_deployment_initial_event.rbs +24 -0
  489. data/sig/anthropic/models/beta/beta_managed_agents_deployment_initial_event_params.rbs +24 -0
  490. data/sig/anthropic/models/beta/beta_managed_agents_deployment_paused_reason.rbs +13 -0
  491. data/sig/anthropic/models/beta/beta_managed_agents_deployment_paused_reason_error.rbs +49 -0
  492. data/sig/anthropic/models/beta/beta_managed_agents_deployment_run.rbs +76 -0
  493. data/sig/anthropic/models/beta/beta_managed_agents_deployment_user_define_outcome_event.rbs +15 -0
  494. data/sig/anthropic/models/beta/beta_managed_agents_deployment_user_message_event.rbs +27 -0
  495. data/sig/anthropic/models/beta/beta_managed_agents_github_repository_resource_config.rbs +15 -0
  496. data/sig/anthropic/models/beta/beta_managed_agents_github_repository_resource_params.rbs +15 -0
  497. data/sig/anthropic/models/beta/beta_managed_agents_mcp_tool_config.rbs +11 -0
  498. data/sig/anthropic/models/beta/beta_managed_agents_mcp_tool_config_params.rbs +11 -0
  499. data/sig/anthropic/models/beta/beta_managed_agents_mcp_toolset_default_config.rbs +11 -0
  500. data/sig/anthropic/models/beta/beta_managed_agents_mcp_toolset_default_config_params.rbs +11 -0
  501. data/sig/anthropic/models/beta/beta_managed_agents_model_config.rbs +18 -0
  502. data/sig/anthropic/models/beta/beta_managed_agents_multiagent.rbs +17 -0
  503. data/sig/anthropic/models/beta/beta_managed_agents_multiagent_coordinator.rbs +17 -0
  504. data/sig/anthropic/models/beta/beta_managed_agents_session_agent.rbs +47 -0
  505. data/sig/anthropic/models/beta/beta_managed_agents_session_agent_update.rbs +30 -0
  506. data/sig/anthropic/models/beta/beta_managed_agents_session_multiagent_coordinator.rbs +30 -0
  507. data/sig/anthropic/models/beta/beta_managed_agents_session_resource_config.rbs +29 -0
  508. data/sig/anthropic/models/beta/beta_managed_agents_session_thread_agent.rbs +47 -0
  509. data/sig/anthropic/models/beta/beta_managed_agents_skill_params.rbs +17 -0
  510. data/sig/anthropic/models/beta/beta_managed_agents_start_event_preview.rbs +14 -0
  511. data/sig/anthropic/models/beta/beta_managed_agents_trigger_context.rbs +13 -0
  512. data/sig/anthropic/models/beta/beta_managed_agents_user_tool_result_event.rbs +34 -0
  513. data/sig/anthropic/models/beta/beta_memory_tool_20250818_command.rbs +45 -0
  514. data/sig/anthropic/models/beta/beta_mid_conversation_system_block_param.rbs +26 -0
  515. data/sig/anthropic/models/beta/beta_output_behavior.rbs +30 -0
  516. data/sig/anthropic/models/beta/beta_output_behavior_create_new.rbs +32 -0
  517. data/sig/anthropic/models/beta/beta_output_behavior_update_existing.rbs +39 -0
  518. data/sig/anthropic/models/beta/beta_raw_content_block_delta.rbs +39 -0
  519. data/sig/anthropic/models/beta/beta_raw_content_block_start_event.rbs +130 -0
  520. data/sig/anthropic/models/beta/beta_raw_message_stream_event.rbs +39 -0
  521. data/sig/anthropic/models/beta/beta_request_document_block.rbs +32 -0
  522. data/sig/anthropic/models/beta/beta_request_tool_addition_block.rbs +20 -0
  523. data/sig/anthropic/models/beta/beta_request_tool_removal_block.rbs +20 -0
  524. data/sig/anthropic/models/beta/beta_server_tool_use_block.rbs +15 -0
  525. data/sig/anthropic/models/beta/beta_server_tool_use_block_param.rbs +15 -0
  526. data/sig/anthropic/models/beta/beta_text_citation.rbs +63 -0
  527. data/sig/anthropic/models/beta/beta_text_citation_param.rbs +59 -0
  528. data/sig/anthropic/models/beta/beta_thinking_config_param.rbs +20 -0
  529. data/sig/anthropic/models/beta/beta_tool_choice.rbs +21 -0
  530. data/sig/anthropic/models/beta/beta_tool_result_block_param.rbs +49 -0
  531. data/sig/anthropic/models/beta/beta_tool_use_block.rbs +15 -0
  532. data/sig/anthropic/models/beta/beta_tool_use_block_param.rbs +15 -0
  533. data/sig/anthropic/models/beta/beta_web_fetch_tool_result_block.rbs +15 -0
  534. data/sig/anthropic/models/beta/beta_web_fetch_tool_result_block_param.rbs +15 -0
  535. data/sig/anthropic/models/beta/beta_web_search_tool_result_block.rbs +15 -0
  536. data/sig/anthropic/models/beta/beta_web_search_tool_result_block_param.rbs +15 -0
  537. data/sig/anthropic/models/beta/beta_webhook_event_data.rbs +283 -0
  538. data/sig/anthropic/models/beta/deployment_create_params.rbs +31 -0
  539. data/sig/anthropic/models/beta/deployment_update_params.rbs +31 -0
  540. data/sig/anthropic/models/beta/dream_create_params.rbs +9 -0
  541. data/sig/anthropic/models/beta/environment_create_params.rbs +15 -0
  542. data/sig/anthropic/models/beta/environment_update_params.rbs +15 -0
  543. data/sig/anthropic/models/beta/memory_stores/beta_managed_agents_actor.rbs +20 -0
  544. data/sig/anthropic/models/beta/memory_stores/beta_managed_agents_error.rbs +59 -0
  545. data/sig/anthropic/models/beta/memory_stores/beta_managed_agents_memory_list_item.rbs +30 -0
  546. data/sig/anthropic/models/beta/messages/beta_message_batch_result.rbs +21 -0
  547. data/sig/anthropic/models/beta/session_create_params.rbs +50 -0
  548. data/sig/anthropic/models/beta/sessions/beta_managed_agents_agent_mcp_tool_result_event.rbs +34 -0
  549. data/sig/anthropic/models/beta/sessions/beta_managed_agents_agent_message_event.rbs +13 -0
  550. data/sig/anthropic/models/beta/sessions/beta_managed_agents_agent_thread_message_received_event.rbs +27 -0
  551. data/sig/anthropic/models/beta/sessions/beta_managed_agents_agent_thread_message_sent_event.rbs +27 -0
  552. data/sig/anthropic/models/beta/sessions/beta_managed_agents_agent_tool_result_event.rbs +34 -0
  553. data/sig/anthropic/models/beta/sessions/beta_managed_agents_billing_error.rbs +14 -0
  554. data/sig/anthropic/models/beta/sessions/beta_managed_agents_credential_host_unreachable_error.rbs +14 -0
  555. data/sig/anthropic/models/beta/sessions/beta_managed_agents_document_block.rbs +28 -0
  556. data/sig/anthropic/models/beta/sessions/beta_managed_agents_event_params.rbs +54 -0
  557. data/sig/anthropic/models/beta/sessions/beta_managed_agents_github_repository_resource.rbs +15 -0
  558. data/sig/anthropic/models/beta/sessions/beta_managed_agents_image_block.rbs +22 -0
  559. data/sig/anthropic/models/beta/sessions/beta_managed_agents_mcp_authentication_failed_error.rbs +14 -0
  560. data/sig/anthropic/models/beta/sessions/beta_managed_agents_mcp_connection_failed_error.rbs +14 -0
  561. data/sig/anthropic/models/beta/sessions/beta_managed_agents_model_overloaded_error.rbs +14 -0
  562. data/sig/anthropic/models/beta/sessions/beta_managed_agents_model_rate_limited_error.rbs +14 -0
  563. data/sig/anthropic/models/beta/sessions/beta_managed_agents_model_request_failed_error.rbs +14 -0
  564. data/sig/anthropic/models/beta/sessions/beta_managed_agents_send_session_events.rbs +75 -0
  565. data/sig/anthropic/models/beta/sessions/beta_managed_agents_session_error_event.rbs +65 -0
  566. data/sig/anthropic/models/beta/sessions/beta_managed_agents_session_event.rbs +313 -0
  567. data/sig/anthropic/models/beta/sessions/beta_managed_agents_session_resource.rbs +43 -0
  568. data/sig/anthropic/models/beta/sessions/beta_managed_agents_session_status_idle_event.rbs +19 -0
  569. data/sig/anthropic/models/beta/sessions/beta_managed_agents_session_thread.rbs +30 -0
  570. data/sig/anthropic/models/beta/sessions/beta_managed_agents_session_thread_status_idle_event.rbs +19 -0
  571. data/sig/anthropic/models/beta/sessions/beta_managed_agents_stream_session_events.rbs +325 -0
  572. data/sig/anthropic/models/beta/sessions/beta_managed_agents_stream_session_thread_events.rbs +325 -0
  573. data/sig/anthropic/models/beta/sessions/beta_managed_agents_unknown_error.rbs +14 -0
  574. data/sig/anthropic/models/beta/sessions/beta_managed_agents_user_custom_tool_result_event.rbs +34 -0
  575. data/sig/anthropic/models/beta/sessions/beta_managed_agents_user_custom_tool_result_event_params.rbs +34 -0
  576. data/sig/anthropic/models/beta/sessions/beta_managed_agents_user_define_outcome_event.rbs +15 -0
  577. data/sig/anthropic/models/beta/sessions/beta_managed_agents_user_define_outcome_event_params.rbs +15 -0
  578. data/sig/anthropic/models/beta/sessions/beta_managed_agents_user_message_event.rbs +27 -0
  579. data/sig/anthropic/models/beta/sessions/beta_managed_agents_user_message_event_params.rbs +27 -0
  580. data/sig/anthropic/models/beta/sessions/beta_managed_agents_user_tool_result_event_params.rbs +34 -0
  581. data/sig/anthropic/models/beta/sessions/resource_retrieve_response.rbs +43 -0
  582. data/sig/anthropic/models/beta/sessions/resource_update_response.rbs +43 -0
  583. data/sig/anthropic/models/beta/vaults/beta_managed_agents_credential.rbs +27 -0
  584. data/sig/anthropic/models/beta/vaults/beta_managed_agents_credential_networking_params.rbs +13 -0
  585. data/sig/anthropic/models/beta/vaults/beta_managed_agents_environment_variable_auth_response.rbs +13 -0
  586. data/sig/anthropic/models/beta/vaults/beta_managed_agents_mcp_oauth_refresh_params.rbs +17 -0
  587. data/sig/anthropic/models/beta/vaults/beta_managed_agents_mcp_oauth_refresh_response.rbs +14 -0
  588. data/sig/anthropic/models/beta/vaults/beta_managed_agents_mcp_oauth_refresh_update_params.rbs +14 -0
  589. data/sig/anthropic/models/beta/vaults/credential_create_params.rbs +33 -0
  590. data/sig/anthropic/models/beta/vaults/credential_update_params.rbs +28 -0
  591. data/sig/anthropic/models/beta_error.rbs +42 -0
  592. data/sig/anthropic/models/citations_delta.rbs +63 -0
  593. data/sig/anthropic/models/content_block.rbs +91 -0
  594. data/sig/anthropic/models/content_block_param.rbs +145 -0
  595. data/sig/anthropic/models/content_block_source_content.rbs +20 -0
  596. data/sig/anthropic/models/document_block.rbs +17 -0
  597. data/sig/anthropic/models/document_block_param.rbs +24 -0
  598. data/sig/anthropic/models/error_object.rbs +42 -0
  599. data/sig/anthropic/models/image_block_param.rbs +14 -0
  600. data/sig/anthropic/models/messages/message_batch_result.rbs +21 -0
  601. data/sig/anthropic/models/raw_content_block_delta.rbs +27 -0
  602. data/sig/anthropic/models/raw_content_block_start_event.rbs +91 -0
  603. data/sig/anthropic/models/raw_message_stream_event.rbs +37 -0
  604. data/sig/anthropic/models/server_tool_use_block.rbs +15 -0
  605. data/sig/anthropic/models/server_tool_use_block_param.rbs +15 -0
  606. data/sig/anthropic/models/text_citation.rbs +63 -0
  607. data/sig/anthropic/models/text_citation_param.rbs +59 -0
  608. data/sig/anthropic/models/thinking_config_param.rbs +18 -0
  609. data/sig/anthropic/models/tool_choice.rbs +21 -0
  610. data/sig/anthropic/models/tool_result_block_param.rbs +49 -0
  611. data/sig/anthropic/models/tool_use_block.rbs +15 -0
  612. data/sig/anthropic/models/tool_use_block_param.rbs +15 -0
  613. data/sig/anthropic/models/web_fetch_tool_result_block.rbs +15 -0
  614. data/sig/anthropic/models/web_fetch_tool_result_block_param.rbs +15 -0
  615. data/sig/anthropic/models/web_search_tool_result_block.rbs +15 -0
  616. data/sig/anthropic/models/web_search_tool_result_block_param.rbs +15 -0
  617. data/sig/anthropic/resources/beta/dreams.rbs +1 -0
  618. metadata +11 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 70039e0b3caf6cf562834b86cb64726a92d6b39b6c51bf25e076d901f1a336bf
4
- data.tar.gz: 26532ca157534b56a16276bcc6a9b2dc85c4817bbf2cb83feb05269882be7d03
3
+ metadata.gz: 68e6d71ef0a8a1c6dba5ce56ca4c950073401b65fe3311ff8b305bb50f3e1895
4
+ data.tar.gz: ed43b20d2eb03cc4f7651213e403bb1eedd4ef682304524d82c535a9a04d680c
5
5
  SHA512:
6
- metadata.gz: 0a061ad34ba81ad33b17e46e95c26d57c68660a2323c8f890541f12d13bf657a935ad0de3ceea801d31fb200f7a9f5d92b53f99d31d56cfb7904169bdba37e29
7
- data.tar.gz: '08cccc073d696911273fc044c063e0cc9b65391e75f5893fed0593773667ec8449165f143c488c967a9c6507805561177a4354917c4f473ef8cd80f21d87d41a'
6
+ metadata.gz: 211153854d618da94e0d1c6cc4a7f8a28b4cbb6982df843301c293167115c12b4dcabea8ba618871150ba9cdebab08c4a6a17b0db164035ed907a54537713e16
7
+ data.tar.gz: 4df9827fe320d1f15bbdbcbfbcf2d77865506001d2b64314de497161700763fa86b500d9a114c7a8e1cb23d1a439aa0deef53e6ed16916da2e4d76ef7276fcff
data/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.62.0 (2026-08-13)
4
+
5
+ Full Changelog: [v1.61.0...v1.62.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v1.61.0...v1.62.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** add output_behavior to dream creation (create a new memory store or update the input store in place) ([836125f](https://github.com/anthropics/anthropic-sdk-ruby/commit/836125f10cee42677d814fa7bb85f693914c6af9))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * **bedrock:** adopt the default-credentials hook in place of the direct base-client bind ([#145](https://github.com/anthropics/anthropic-sdk-ruby/issues/145)) ([e082f28](https://github.com/anthropics/anthropic-sdk-ruby/commit/e082f280846cd00bda4f89b9fb6ad50b4a4a5feb))
15
+ * **client:** accumulate streamed input for server tool use blocks ([#162](https://github.com/anthropics/anthropic-sdk-ruby/issues/162)) ([75382d8](https://github.com/anthropics/anthropic-sdk-ruby/commit/75382d81ebb6b3bedad92749f26e4625d8203097))
16
+ * **client:** add models ([055b440](https://github.com/anthropics/anthropic-sdk-ruby/commit/055b440aa315cf644b08ede51a19f448fab00cbf))
17
+ * **internal:** don't resolve lazy field types when hashing a model class ([#155](https://github.com/anthropics/anthropic-sdk-ruby/issues/155)) ([0a2c06f](https://github.com/anthropics/anthropic-sdk-ruby/commit/0a2c06fcbdb345d751ae0850cac70177cb232d53))
18
+ * **streaming:** apply all message_delta fields when accumulating streamed messages ([#160](https://github.com/anthropics/anthropic-sdk-ruby/issues/160)) ([e537ae2](https://github.com/anthropics/anthropic-sdk-ruby/commit/e537ae23ac5c5701b47812e9062db9c3bd9f29da))
19
+ * **vertex:** don't resolve the shared config store during client init ([#142](https://github.com/anthropics/anthropic-sdk-ruby/issues/142)) ([4108bd4](https://github.com/anthropics/anthropic-sdk-ruby/commit/4108bd4aa3fd3517b51971fdd25f15351bd8f5be))
20
+
21
+
22
+ ### Documentation
23
+
24
+ * **api:** clarify that user profile name is optional for resold profiles ([e68fd57](https://github.com/anthropics/anthropic-sdk-ruby/commit/e68fd57357fed4964666d84d011b38873abff02d))
25
+ * **client:** move truncated-docs note below the description in YARD doc blocks ([3db8b94](https://github.com/anthropics/anthropic-sdk-ruby/commit/3db8b9489cd2adb207edbb0165ea11fbacc19db4))
26
+ * fix Symbol typo in RDoc comments ([#163](https://github.com/anthropics/anthropic-sdk-ruby/issues/163)) ([1102732](https://github.com/anthropics/anthropic-sdk-ruby/commit/1102732847ffc02eef9d2c69e233f5e6f56787d8))
27
+
3
28
  ## 1.61.0 (2026-08-07)
4
29
 
5
30
  Full Changelog: [v1.60.0...v1.61.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v1.60.0...v1.61.0)
data/README.md CHANGED
@@ -15,7 +15,7 @@ Add to your application's Gemfile:
15
15
  <!-- x-release-please-start-version -->
16
16
 
17
17
  ```ruby
18
- gem "anthropic", "~> 1.61.0"
18
+ gem "anthropic", "~> 1.62.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
@@ -197,7 +197,7 @@ module Anthropic
197
197
 
198
198
  has_explicit_credential = api_key || auth_token || credentials || config
199
199
 
200
- unless has_explicit_credential
200
+ if !has_explicit_credential && resolve_default_credentials?
201
201
  api_key = ENV["ANTHROPIC_API_KEY"]
202
202
  auth_token = ENV["ANTHROPIC_AUTH_TOKEN"]
203
203
  end
@@ -223,7 +223,7 @@ module Anthropic
223
223
  @credentials = credentials
224
224
  end
225
225
 
226
- if @credentials.nil? && @api_key.nil? && @auth_token.nil?
226
+ if @credentials.nil? && @api_key.nil? && @auth_token.nil? && resolve_default_credentials?
227
227
  default_base_url = base_url || "https://api.anthropic.com"
228
228
  result = Anthropic::Credentials.default_credentials(base_url: default_base_url)
229
229
  if result
@@ -234,7 +234,7 @@ module Anthropic
234
234
  end
235
235
 
236
236
  warn_explicit_shadow(api_key: api_key, auth_token: auth_token, credentials: credentials || config)
237
- warn_env_shadow(api_key: api_key, auth_token: auth_token)
237
+ warn_env_shadow(api_key: api_key, auth_token: auth_token) if resolve_default_credentials?
238
238
 
239
239
  if @credentials
240
240
  @token_cache = Anthropic::Credentials::TokenCache.new(@credentials)
@@ -295,6 +295,20 @@ module Anthropic
295
295
 
296
296
  private
297
297
 
298
+ # @api private
299
+ #
300
+ # Whether to resolve credentials from the default chain (the static
301
+ # +ANTHROPIC_API_KEY+ / +ANTHROPIC_AUTH_TOKEN+ env vars and the shared
302
+ # config store / federation auto-discovery, precedence steps 2–5 above)
303
+ # when no explicit credential argument is passed. Called once from
304
+ # {#initialize}, so overrides must not depend on subclass instance state.
305
+ # Subclasses that bring their own auth scheme override this to +false+ so
306
+ # ambient first-party credentials are never resolved or folded into
307
+ # requests bound for another platform's endpoint.
308
+ #
309
+ # @return [Boolean]
310
+ def resolve_default_credentials? = true
311
+
298
312
  def warn_explicit_shadow(api_key:, auth_token:, credentials:)
299
313
  return if credentials.nil?
300
314
 
@@ -60,7 +60,7 @@ module Anthropic
60
60
  # the Bedrock URL rewrite and SigV4 signing happen inside the continuation, per
61
61
  # attempt.
62
62
  #
63
- def initialize( # rubocop:disable Lint/MissingSuper
63
+ def initialize(
64
64
  aws_region: nil,
65
65
  base_url: nil,
66
66
  max_retries: self.class::DEFAULT_MAX_RETRIES,
@@ -126,31 +126,44 @@ module Anthropic
126
126
  "https://bedrock-runtime.#{@aws_region}.amazonaws.com"
127
127
  )
128
128
 
129
- @api_key = nil
130
- @auth_token = @signer ? nil : api_key
131
- @credentials = nil
132
- @token_cache = nil
133
129
  # For AWSAuth#auth_headers: suppress key headers in SigV4 mode; in
134
130
  # API-key mode fall through to the base bearer-token handling.
135
131
  @use_sig_v4 = !@signer.nil?
136
132
  @use_bearer_auth = false
137
133
 
138
- # Skip Anthropic::Client#initialize and bind BaseClient#initialize directly:
139
- # the parent's initializer runs OIDC/credential-provider resolution that does
140
- # not apply here.
141
- Anthropic::Internal::Transport::BaseClient.instance_method(:initialize).bind(self).call(
134
+ # The Bedrock bearer rides the base client's `auth_token` slot;
135
+ # {#resolve_default_credentials?} keeps first-party credential
136
+ # auto-discovery out of the picture when it is absent.
137
+ super(
138
+ auth_token: @signer ? nil : api_key,
142
139
  base_url: base_url,
143
140
  timeout: timeout,
144
141
  max_retries: max_retries,
145
142
  initial_retry_delay: initial_retry_delay,
146
143
  max_retry_delay: max_retry_delay,
147
- headers: {"anthropic-version" => "2023-06-01"},
148
144
  middleware: middleware
149
145
  )
146
+ end
147
+
148
+ # @api private
149
+ #
150
+ # Auth is SigV4 or the Bedrock bearer only — never resolve ambient
151
+ # first-party credentials, which would fold the shared config store's
152
+ # headers and bearer into requests bound for a third-party endpoint.
153
+ #
154
+ # @return [Boolean]
155
+ private def resolve_default_credentials? = false
150
156
 
151
- @messages = Anthropic::Resources::Messages.new(client: self)
152
- @completions = Anthropic::Resources::Completions.new(client: self)
153
- @beta = Anthropic::Resources::Beta.new(client: self)
157
+ # The Models API is not available on Bedrock, so the resource the
158
+ # parent wires up would target routes the Bedrock host does not serve
159
+ # keep it unavailable, matching the SDK's other Bedrock clients.
160
+ #
161
+ # @raise [NotImplementedError]
162
+ def models
163
+ # rubocop:disable Layout/LineLength
164
+ message = "Please instead use https://docs.anthropic.com/en/api/claude-on-amazon-bedrock#list-available-models to list available models on Bedrock."
165
+ # rubocop:enable Layout/LineLength
166
+ raise NotImplementedError.new(message)
154
167
  end
155
168
 
156
169
  # @api private
@@ -113,6 +113,16 @@ module Anthropic
113
113
  "Models listing is not supported on Bedrock Mantle. Only Messages (/v1/messages) is supported."
114
114
  end
115
115
 
116
+ # @api private
117
+ #
118
+ # Auth is SigV4 or the Bedrock bearer only (or skipped entirely) —
119
+ # never resolve ambient first-party credentials, which would fold the
120
+ # shared config store's headers and bearer into requests bound for a
121
+ # third-party endpoint.
122
+ #
123
+ # @return [Boolean]
124
+ private def resolve_default_credentials? = false
125
+
116
126
  # @api private
117
127
  #
118
128
  # @return [#call]
@@ -9,7 +9,7 @@ module Anthropic
9
9
  # Extract tool models from the request and convert them to JSON Schema
10
10
  # Returns a hash mapping tool name to Ruby model.
11
11
  #
12
- # @param data [Hash{Sybmol=>Object}]
12
+ # @param data [Hash{Symbol=>Object}]
13
13
  #
14
14
  # @param strict [Boolean, nil]
15
15
  #
@@ -128,13 +128,13 @@ module Anthropic
128
128
 
129
129
  # @api private
130
130
  #
131
- # @param raw [Hash{Sybmol=>Object}]
131
+ # @param raw [Hash{Symbol=>Object}]
132
132
  #
133
133
  # @param tools [Hash{String=>Class}]
134
134
  #
135
135
  # @param models [Hash{String=>Class}]
136
136
  #
137
- # @return [Hash{Sybmol=>Object}]
137
+ # @return [Hash{Symbol=>Object}]
138
138
  def parse_input_schemas!(raw, tools:, models:)
139
139
  raw[:content]&.each do |content|
140
140
  case content
@@ -123,12 +123,14 @@ module Anthropic
123
123
  case (delta = event.delta)
124
124
  in Anthropic::Models::TextDelta | Anthropic::Models::BetaTextDelta if content.type == :text
125
125
  content.text += delta.text
126
- in Anthropic::Models::InputJSONDelta | Anthropic::Models::BetaInputJSONDelta if content.type == :tool_use
127
- json_buf = content._json_buf.to_s
126
+ in Anthropic::Models::InputJSONDelta | Anthropic::Models::BetaInputJSONDelta if tracks_tool_input?(content)
127
+ # `input` itself is the partial-JSON buffer mid-stream: it starts as the
128
+ # `{}` placeholder from content_block_start and holds the raw String once
129
+ # the first delta lands (server/MCP tool blocks have no `_json_buf`).
130
+ json_buf = content.input.is_a?(String) ? content.input : ""
128
131
  json_buf += delta.partial_json
129
132
 
130
133
  content.input = json_buf
131
- content._json_buf = json_buf
132
134
  in Anthropic::Models::CitationsDelta | Anthropic::Models::BetaCitationsDelta if content.type == :text
133
135
  content.citations ||= []
134
136
  content.citations << delta.citation
@@ -147,7 +149,7 @@ module Anthropic
147
149
  # finished block must carry the decoded object, as in the non-streaming
148
150
  # message and the other SDKs' accumulators.
149
151
  case current_snapshot.content[event.index]
150
- in {type: :tool_use, input: String => raw} => content
152
+ in {input: String => raw} => content if tracks_tool_input?(content)
151
153
  begin
152
154
  content.input = decode_tool_use_input(raw)
153
155
  rescue JSON::ParserError
@@ -156,9 +158,15 @@ module Anthropic
156
158
  else
157
159
  end
158
160
  in Anthropic::Models::RawMessageDeltaEvent | Anthropic::Models::BetaRawMessageDeltaEvent
159
- current_snapshot.stop_reason = event.delta.stop_reason
160
- current_snapshot.stop_sequence = event.delta.stop_sequence
161
+ # message_start already seeds the null placeholders for these, and the
162
+ # generated setters cannot take a nil, so skip the ones the event omits.
163
+ current_snapshot.stop_reason = event.delta.stop_reason unless event.delta.stop_reason.nil?
164
+ current_snapshot.stop_sequence = event.delta.stop_sequence unless event.delta.stop_sequence.nil?
161
165
  current_snapshot.stop_details = event.delta.stop_details unless event.delta.stop_details.nil?
166
+
167
+ # Only reported once a container actually ran, and never on message_start.
168
+ current_snapshot.container = event.delta.container unless event.delta.container.nil?
169
+
162
170
  current_snapshot.usage.output_tokens = event.usage.output_tokens
163
171
 
164
172
  # The message_delta usage is authoritative for the final counts; carry every
@@ -176,6 +184,9 @@ module Anthropic
176
184
  unless event.usage.server_tool_use.nil?
177
185
  current_snapshot.usage.server_tool_use = event.usage.server_tool_use
178
186
  end
187
+ unless event.usage.output_tokens_details.nil?
188
+ current_snapshot.usage.output_tokens_details = event.usage.output_tokens_details
189
+ end
179
190
 
180
191
  if event.is_a?(Anthropic::Models::BetaRawMessageDeltaEvent)
181
192
  unless event.usage.iterations.nil?
@@ -184,6 +195,10 @@ module Anthropic
184
195
  unless event.usage.fallback_credit.nil?
185
196
  current_snapshot.usage.fallback_credit = event.usage.fallback_credit
186
197
  end
198
+ # Applied context-management edits ride on the event, not on `delta`.
199
+ unless event.context_management.nil?
200
+ current_snapshot.context_management = event.context_management
201
+ end
187
202
  end
188
203
  else
189
204
  end
@@ -222,7 +237,7 @@ module Anthropic
222
237
  text: delta.text,
223
238
  snapshot: content_block.text
224
239
  )
225
- in Anthropic::Models::InputJSONDelta | Anthropic::Models::BetaInputJSONDelta if content_block.type == :tool_use
240
+ in Anthropic::Models::InputJSONDelta | Anthropic::Models::BetaInputJSONDelta if tracks_tool_input?(content_block)
226
241
  events_to_yield << Anthropic::Streaming::InputJsonEvent.new(
227
242
  type: :input_json,
228
243
  partial_json: delta.partial_json,
@@ -269,7 +284,21 @@ module Anthropic
269
284
 
270
285
  # @api private
271
286
  #
272
- # Decodes a tool_use block's buffered partial-JSON input. An empty buffer
287
+ # Content block types whose `input` streams in as input_json_delta events.
288
+ TOOL_INPUT_BLOCK_TYPES = [:tool_use, :server_tool_use, :mcp_tool_use].freeze
289
+
290
+ # @api private
291
+ #
292
+ # @param content_block [Object]
293
+ #
294
+ # @return [Boolean]
295
+ private def tracks_tool_input?(content_block)
296
+ TOOL_INPUT_BLOCK_TYPES.include?(content_block.type)
297
+ end
298
+
299
+ # @api private
300
+ #
301
+ # Decodes a tool-use block's buffered partial-JSON input. An empty buffer
273
302
  # means a no-argument tool call, which the wire encodes as an empty object.
274
303
  #
275
304
  # @param raw [String]
@@ -116,6 +116,16 @@ module Anthropic
116
116
  @beta = Anthropic::Resources::Beta.new(client: self)
117
117
  end
118
118
 
119
+ # @api private
120
+ #
121
+ # Auth is Google OAuth (or a per-request token) only — never resolve
122
+ # ambient first-party credentials, which would fold the shared config
123
+ # store's headers and bearer into requests bound for a third-party
124
+ # endpoint.
125
+ #
126
+ # @return [Boolean]
127
+ private def resolve_default_credentials? = false
128
+
119
129
  # @api private
120
130
  #
121
131
  # @param req [Hash{Symbol=>Object}] .
@@ -210,8 +210,12 @@ module Anthropic
210
210
 
211
211
  # @api public
212
212
  #
213
+ # Must not resolve the lazy `type_fn`s: some runtimes (JRuby) call `Class#hash`
214
+ # from inside `Module#include`, before every referenced constant is loaded.
215
+ # Still consistent with `==`, since equal `fields` implies equal non-type entries.
216
+ #
213
217
  # @return [Integer]
214
- def hash = fields.hash
218
+ def hash = known_fields.transform_values { |field| field.except(:type_fn) }.hash
215
219
  end
216
220
 
217
221
  # @api public
@@ -142,6 +142,43 @@ module Anthropic
142
142
 
143
143
  # @!method self.variants
144
144
  # @return [Array(Anthropic::Models::Beta::BetaManagedAgentsAgentToolset20260401Params, Anthropic::Models::Beta::BetaManagedAgentsMCPToolsetParams, Anthropic::Models::Beta::BetaManagedAgentsCustomToolParams)]
145
+
146
+ # Creates a new instance of the variant class whose `type` matches the given
147
+ # value, passing the remaining arguments to its constructor.
148
+ #
149
+ # Some parameter documentations has been truncated, see
150
+ # {Anthropic::Models::Beta::AgentCreateParams::Tool} for more details.
151
+ #
152
+ # @param type [Symbol, String]
153
+ #
154
+ # @param args [Hash{Symbol=>Object}] Attributes for the chosen variant.
155
+ #
156
+ # @option args [Array<Anthropic::Models::Beta::BetaManagedAgentsAgentToolConfigParams>, Array<Anthropic::Models::Beta::BetaManagedAgentsMCPToolConfigParams>] :configs Per-tool configuration overrides.
157
+ #
158
+ # @option args [Anthropic::Models::Beta::BetaManagedAgentsAgentToolsetDefaultConfigParams, nil, Anthropic::Models::Beta::BetaManagedAgentsMCPToolsetDefaultConfigParams, nil] :default_config Default configuration for all tools in a toolset.
159
+ #
160
+ # @option args [String] :mcp_server_name Name of the MCP server. Must match a server name from the mcp_servers array. 1-2
161
+ #
162
+ # @option args [String] :description Description of what the tool does, shown to the agent to help it decide when to
163
+ #
164
+ # @option args [Anthropic::Models::Beta::BetaManagedAgentsCustomToolInputSchema] :input_schema JSON Schema for custom tool input parameters.
165
+ #
166
+ # @option args [String] :name Unique name for the tool. 1-128 characters; letters, digits, underscores, and hy
167
+ #
168
+ # @raise [ArgumentError]
169
+ # @return [Anthropic::Models::Beta::BetaManagedAgentsAgentToolset20260401Params, Anthropic::Models::Beta::BetaManagedAgentsMCPToolsetParams, Anthropic::Models::Beta::BetaManagedAgentsCustomToolParams]
170
+ def self.new(type:, **args)
171
+ case type.to_sym
172
+ when :agent_toolset_20260401
173
+ Anthropic::Beta::BetaManagedAgentsAgentToolset20260401Params.new(**args)
174
+ when :mcp_toolset
175
+ Anthropic::Beta::BetaManagedAgentsMCPToolsetParams.new(**args)
176
+ when :custom
177
+ Anthropic::Beta::BetaManagedAgentsCustomToolParams.new(**args)
178
+ else
179
+ raise ArgumentError, "unknown type: #{type}"
180
+ end
181
+ end
145
182
  end
146
183
  end
147
184
  end
@@ -170,6 +170,43 @@ module Anthropic
170
170
 
171
171
  # @!method self.variants
172
172
  # @return [Array(Anthropic::Models::Beta::BetaManagedAgentsAgentToolset20260401Params, Anthropic::Models::Beta::BetaManagedAgentsMCPToolsetParams, Anthropic::Models::Beta::BetaManagedAgentsCustomToolParams)]
173
+
174
+ # Creates a new instance of the variant class whose `type` matches the given
175
+ # value, passing the remaining arguments to its constructor.
176
+ #
177
+ # Some parameter documentations has been truncated, see
178
+ # {Anthropic::Models::Beta::AgentUpdateParams::Tool} for more details.
179
+ #
180
+ # @param type [Symbol, String]
181
+ #
182
+ # @param args [Hash{Symbol=>Object}] Attributes for the chosen variant.
183
+ #
184
+ # @option args [Array<Anthropic::Models::Beta::BetaManagedAgentsAgentToolConfigParams>, Array<Anthropic::Models::Beta::BetaManagedAgentsMCPToolConfigParams>] :configs Per-tool configuration overrides.
185
+ #
186
+ # @option args [Anthropic::Models::Beta::BetaManagedAgentsAgentToolsetDefaultConfigParams, nil, Anthropic::Models::Beta::BetaManagedAgentsMCPToolsetDefaultConfigParams, nil] :default_config Default configuration for all tools in a toolset.
187
+ #
188
+ # @option args [String] :mcp_server_name Name of the MCP server. Must match a server name from the mcp_servers array. 1-2
189
+ #
190
+ # @option args [String] :description Description of what the tool does, shown to the agent to help it decide when to
191
+ #
192
+ # @option args [Anthropic::Models::Beta::BetaManagedAgentsCustomToolInputSchema] :input_schema JSON Schema for custom tool input parameters.
193
+ #
194
+ # @option args [String] :name Unique name for the tool. 1-128 characters; letters, digits, underscores, and hy
195
+ #
196
+ # @raise [ArgumentError]
197
+ # @return [Anthropic::Models::Beta::BetaManagedAgentsAgentToolset20260401Params, Anthropic::Models::Beta::BetaManagedAgentsMCPToolsetParams, Anthropic::Models::Beta::BetaManagedAgentsCustomToolParams]
198
+ def self.new(type:, **args)
199
+ case type.to_sym
200
+ when :agent_toolset_20260401
201
+ Anthropic::Beta::BetaManagedAgentsAgentToolset20260401Params.new(**args)
202
+ when :mcp_toolset
203
+ Anthropic::Beta::BetaManagedAgentsMCPToolsetParams.new(**args)
204
+ when :custom
205
+ Anthropic::Beta::BetaManagedAgentsCustomToolParams.new(**args)
206
+ else
207
+ raise ArgumentError, "unknown type: #{type}"
208
+ end
209
+ end
173
210
  end
174
211
  end
175
212
  end
@@ -50,11 +50,11 @@ module Anthropic
50
50
  required :type, const: :advisor_message
51
51
 
52
52
  # @!method initialize(cache_creation:, cache_creation_input_tokens:, cache_read_input_tokens:, input_tokens:, model:, output_tokens:, type: :advisor_message)
53
+ # Token usage for an advisor sub-inference iteration.
54
+ #
53
55
  # Some parameter documentations has been truncated, see
54
56
  # {Anthropic::Models::Beta::BetaAdvisorMessageIterationUsage} for more details.
55
57
  #
56
- # Token usage for an advisor sub-inference iteration.
57
- #
58
58
  # @param cache_creation [Anthropic::Models::Beta::BetaCacheCreation, nil] Breakdown of cached tokens by TTL
59
59
  #
60
60
  # @param cache_creation_input_tokens [Integer] The number of input tokens used to create the cache entry.
@@ -36,6 +36,65 @@ module Anthropic
36
36
 
37
37
  # @!method self.variants
38
38
  # @return [Array(Anthropic::Models::Beta::BetaCitationCharLocation, Anthropic::Models::Beta::BetaCitationPageLocation, Anthropic::Models::Beta::BetaCitationContentBlockLocation, Anthropic::Models::Beta::BetaCitationsWebSearchResultLocation, Anthropic::Models::Beta::BetaCitationSearchResultLocation)]
39
+
40
+ # Creates a new instance of the variant class whose `type` matches the given
41
+ # value, passing the remaining arguments to its constructor.
42
+ #
43
+ # Some parameter documentations has been truncated, see
44
+ # {Anthropic::Models::Beta::BetaCitationsDelta::Citation} for more details.
45
+ #
46
+ # @param type [Symbol, String]
47
+ #
48
+ # @param args [Hash{Symbol=>Object}] Attributes for the chosen variant.
49
+ #
50
+ # @option args [String] :cited_text The full text of the cited block range, concatenated.
51
+ #
52
+ # @option args [Integer] :document_index
53
+ #
54
+ # @option args [String, nil] :document_title
55
+ #
56
+ # @option args [Integer] :end_char_index
57
+ #
58
+ # @option args [String, nil] :file_id
59
+ #
60
+ # @option args [Integer] :start_char_index
61
+ #
62
+ # @option args [Integer] :end_page_number
63
+ #
64
+ # @option args [Integer] :start_page_number
65
+ #
66
+ # @option args [Integer] :end_block_index Exclusive 0-based end index of the cited block range in the source's `content` a
67
+ #
68
+ # @option args [Integer] :start_block_index 0-based index of the first cited block in the source's `content` array.
69
+ #
70
+ # @option args [String] :encrypted_index
71
+ #
72
+ # @option args [String, nil] :title
73
+ #
74
+ # @option args [String] :url
75
+ #
76
+ # @option args [Integer] :search_result_index 0-based index of the cited search result among all `search_result` content block
77
+ #
78
+ # @option args [String] :source
79
+ #
80
+ # @raise [ArgumentError]
81
+ # @return [Anthropic::Models::Beta::BetaCitationCharLocation, Anthropic::Models::Beta::BetaCitationPageLocation, Anthropic::Models::Beta::BetaCitationContentBlockLocation, Anthropic::Models::Beta::BetaCitationsWebSearchResultLocation, Anthropic::Models::Beta::BetaCitationSearchResultLocation]
82
+ def self.new(type:, **args)
83
+ case type.to_sym
84
+ when :char_location
85
+ Anthropic::Beta::BetaCitationCharLocation.new(**args)
86
+ when :page_location
87
+ Anthropic::Beta::BetaCitationPageLocation.new(**args)
88
+ when :content_block_location
89
+ Anthropic::Beta::BetaCitationContentBlockLocation.new(**args)
90
+ when :web_search_result_location
91
+ Anthropic::Beta::BetaCitationsWebSearchResultLocation.new(**args)
92
+ when :search_result_location
93
+ Anthropic::Beta::BetaCitationSearchResultLocation.new(**args)
94
+ else
95
+ raise ArgumentError, "unknown type: #{type}"
96
+ end
97
+ end
39
98
  end
40
99
  end
41
100
  end
@@ -89,6 +89,28 @@ module Anthropic
89
89
 
90
90
  # @!method self.variants
91
91
  # @return [Array(Anthropic::Models::Beta::BetaInputTokensTrigger, Anthropic::Models::Beta::BetaToolUsesTrigger)]
92
+
93
+ # Creates a new instance of the variant class whose `type` matches the given
94
+ # value, passing the remaining arguments to its constructor.
95
+ #
96
+ # @param type [Symbol, String]
97
+ #
98
+ # @param args [Hash{Symbol=>Object}] Attributes for the chosen variant.
99
+ #
100
+ # @option args [Integer] :value
101
+ #
102
+ # @raise [ArgumentError]
103
+ # @return [Anthropic::Models::Beta::BetaInputTokensTrigger, Anthropic::Models::Beta::BetaToolUsesTrigger]
104
+ def self.new(type:, **args)
105
+ case type.to_sym
106
+ when :input_tokens
107
+ Anthropic::Beta::BetaInputTokensTrigger.new(**args)
108
+ when :tool_uses
109
+ Anthropic::Beta::BetaToolUsesTrigger.new(**args)
110
+ else
111
+ raise ArgumentError, "unknown type: #{type}"
112
+ end
113
+ end
92
114
  end
93
115
  end
94
116
  end
@@ -47,6 +47,35 @@ module Anthropic
47
47
 
48
48
  # @!method self.variants
49
49
  # @return [Array(Anthropic::Models::Beta::BetaUnrestrictedNetwork, Anthropic::Models::Beta::BetaLimitedNetwork)]
50
+
51
+ # Creates a new instance of the variant class whose `type` matches the given
52
+ # value, passing the remaining arguments to its constructor.
53
+ #
54
+ # Some parameter documentations has been truncated, see
55
+ # {Anthropic::Models::Beta::BetaCloudConfig::Networking} for more details.
56
+ #
57
+ # @param type [Symbol, String]
58
+ #
59
+ # @param args [Hash{Symbol=>Object}] Attributes for the chosen variant.
60
+ #
61
+ # @option args [Boolean] :allow_mcp_servers Permits outbound access to MCP server endpoints configured on the agent, beyond
62
+ #
63
+ # @option args [Boolean] :allow_package_managers Permits outbound access to public package registries (PyPI, npm, etc.) beyond th
64
+ #
65
+ # @option args [Array<String>] :allowed_hosts Specifies domains the container can reach.
66
+ #
67
+ # @raise [ArgumentError]
68
+ # @return [Anthropic::Models::Beta::BetaUnrestrictedNetwork, Anthropic::Models::Beta::BetaLimitedNetwork]
69
+ def self.new(type:, **args)
70
+ case type.to_sym
71
+ when :unrestricted
72
+ Anthropic::Beta::BetaUnrestrictedNetwork.new(**args)
73
+ when :limited
74
+ Anthropic::Beta::BetaLimitedNetwork.new(**args)
75
+ else
76
+ raise ArgumentError, "unknown type: #{type}"
77
+ end
78
+ end
50
79
  end
51
80
  end
52
81
  end
@@ -27,13 +27,13 @@ module Anthropic
27
27
  optional :packages, -> { Anthropic::Beta::BetaPackagesParams }, nil?: true
28
28
 
29
29
  # @!method initialize(networking: nil, packages: nil, type: :cloud)
30
- # Some parameter documentations has been truncated, see
31
- # {Anthropic::Models::Beta::BetaCloudConfigParams} for more details.
32
- #
33
30
  # Request params for `cloud` environment configuration.
34
31
  #
35
32
  # Fields default to null; on update, omitted fields preserve the existing value.
36
33
  #
34
+ # Some parameter documentations has been truncated, see
35
+ # {Anthropic::Models::Beta::BetaCloudConfigParams} for more details.
36
+ #
37
37
  # @param networking [Anthropic::Models::Beta::BetaUnrestrictedNetwork, Anthropic::Models::Beta::BetaLimitedNetworkParams, nil] Network configuration policy. Omit on update to preserve the existing value.
38
38
  #
39
39
  # @param packages [Anthropic::Models::Beta::BetaPackagesParams, nil] Specify packages (and optionally their versions) available in this environment.
@@ -59,6 +59,35 @@ module Anthropic
59
59
 
60
60
  # @!method self.variants
61
61
  # @return [Array(Anthropic::Models::Beta::BetaUnrestrictedNetwork, Anthropic::Models::Beta::BetaLimitedNetworkParams)]
62
+
63
+ # Creates a new instance of the variant class whose `type` matches the given
64
+ # value, passing the remaining arguments to its constructor.
65
+ #
66
+ # Some parameter documentations has been truncated, see
67
+ # {Anthropic::Models::Beta::BetaCloudConfigParams::Networking} for more details.
68
+ #
69
+ # @param type [Symbol, String]
70
+ #
71
+ # @param args [Hash{Symbol=>Object}] Attributes for the chosen variant.
72
+ #
73
+ # @option args [Boolean, nil] :allow_mcp_servers Permits outbound access to MCP server endpoints configured on the agent, beyond
74
+ #
75
+ # @option args [Boolean, nil] :allow_package_managers Permits outbound access to public package registries (PyPI, npm, etc.) beyond th
76
+ #
77
+ # @option args [Array<String>, nil] :allowed_hosts Specifies domains the container can reach.
78
+ #
79
+ # @raise [ArgumentError]
80
+ # @return [Anthropic::Models::Beta::BetaUnrestrictedNetwork, Anthropic::Models::Beta::BetaLimitedNetworkParams]
81
+ def self.new(type:, **args)
82
+ case type.to_sym
83
+ when :unrestricted
84
+ Anthropic::Beta::BetaUnrestrictedNetwork.new(**args)
85
+ when :limited
86
+ Anthropic::Beta::BetaLimitedNetworkParams.new(**args)
87
+ else
88
+ raise ArgumentError, "unknown type: #{type}"
89
+ end
90
+ end
62
91
  end
63
92
  end
64
93
  end
@@ -43,12 +43,12 @@ module Anthropic
43
43
  optional :strict, Anthropic::Internal::Type::Boolean
44
44
 
45
45
  # @!method initialize(allowed_callers: nil, cache_control: nil, defer_loading: nil, strict: nil, name: :code_execution, type: :code_execution_20260120)
46
- # Some parameter documentations has been truncated, see
47
- # {Anthropic::Models::Beta::BetaCodeExecutionTool20260120} for more details.
48
- #
49
46
  # Code execution tool with REPL state persistence (daemon mode + gVisor
50
47
  # checkpoint).
51
48
  #
49
+ # Some parameter documentations has been truncated, see
50
+ # {Anthropic::Models::Beta::BetaCodeExecutionTool20260120} for more details.
51
+ #
52
52
  # @param allowed_callers [Array<Symbol, Anthropic::Models::Beta::BetaCodeExecutionTool20260120::AllowedCaller>]
53
53
  #
54
54
  # @param cache_control [Anthropic::Models::Beta::BetaCacheControlEphemeral, nil] Create a cache control breakpoint at this content block.