anthropic 2.2.0 → 2.3.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 (275) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +34 -0
  3. data/README.md +2 -2
  4. data/lib/anthropic/client.rb +1 -1
  5. data/lib/anthropic/helpers/bedrock/client.rb +6 -3
  6. data/lib/anthropic/helpers/google_cloud/client.rb +9 -25
  7. data/lib/anthropic/helpers/refusal_fallback.rb +1 -2
  8. data/lib/anthropic/helpers/stainless_helper_header.rb +3 -2
  9. data/lib/anthropic/internal/tracing.rb +20 -0
  10. data/lib/anthropic/internal/transport/base_client.rb +16 -2
  11. data/lib/anthropic/models/anthropic_beta.rb +3 -0
  12. data/lib/anthropic/models/beta/beta_code_execution_tool_20260120.rb +10 -2
  13. data/lib/anthropic/models/beta/beta_code_execution_tool_result_block_content.rb +5 -1
  14. data/lib/anthropic/models/beta/beta_code_execution_tool_result_block_param_content.rb +1 -1
  15. data/lib/anthropic/models/beta/beta_encrypted_code_execution_result_block.rb +9 -1
  16. data/lib/anthropic/models/beta/beta_encrypted_code_execution_result_block_param.rb +2 -1
  17. data/lib/anthropic/models/beta/beta_response_tool_union.rb +5 -1
  18. data/lib/anthropic/models/beta/beta_skill_params.rb +1 -1
  19. data/lib/anthropic/models/beta/beta_tool_union.rb +5 -1
  20. data/lib/anthropic/models/beta/environments/beta_self_hosted_work_heartbeat_response.rb +7 -2
  21. data/lib/anthropic/models/beta/environments/beta_self_hosted_work_queue_stats.rb +2 -4
  22. data/lib/anthropic/models/beta/message_count_tokens_params.rb +5 -1
  23. data/lib/anthropic/models/beta/organization/beta_claude_tag_default_setting_source.rb +21 -0
  24. data/lib/anthropic/models/beta/organization/beta_claude_tag_guest_policy.rb +63 -0
  25. data/lib/anthropic/models/beta/organization/beta_claude_tag_guest_policy_allow.rb +21 -0
  26. data/lib/anthropic/models/beta/organization/beta_claude_tag_guest_policy_channel_only.rb +21 -0
  27. data/lib/anthropic/models/beta/organization/beta_claude_tag_guest_policy_restrict.rb +21 -0
  28. data/lib/anthropic/models/beta/organization/beta_claude_tag_setting_source.rb +87 -0
  29. data/lib/anthropic/models/beta/organization/beta_claude_tag_setting_sources.rb +72 -0
  30. data/lib/anthropic/models/beta/organization/beta_claude_tag_settings.rb +70 -0
  31. data/lib/anthropic/models/beta/organization/beta_claude_tag_settings_create.rb +67 -0
  32. data/lib/anthropic/models/beta/organization/beta_claude_tag_settings_update.rb +67 -0
  33. data/lib/anthropic/models/beta/organization/beta_claude_tag_slack_channel_identifiers.rb +37 -0
  34. data/lib/anthropic/models/beta/organization/beta_claude_tag_slack_channel_setting_source.rb +29 -0
  35. data/lib/anthropic/models/beta/organization/beta_claude_tag_slack_default_setting_source.rb +22 -0
  36. data/lib/anthropic/models/beta/organization/beta_claude_tag_slack_grid_channel_setting_source.rb +31 -0
  37. data/lib/anthropic/models/beta/organization/beta_claude_tag_slack_parent_channel_setting_source.rb +30 -0
  38. data/lib/anthropic/models/beta/organization/beta_claude_tag_slack_workspace_identifiers.rb +23 -0
  39. data/lib/anthropic/models/beta/organization/beta_claude_tag_slack_workspace_setting_source.rb +29 -0
  40. data/lib/anthropic/models/beta/organization/beta_external_key.rb +3 -3
  41. data/lib/anthropic/models/beta/organization/claude_tag/beta_claude_tag_bundle.rb +66 -0
  42. data/lib/anthropic/models/beta/organization/claude_tag/beta_claude_tag_deleted_slack_channel.rb +32 -0
  43. data/lib/anthropic/models/beta/organization/claude_tag/beta_claude_tag_slack_channel.rb +87 -0
  44. data/lib/anthropic/models/beta/organization/claude_tag/beta_claude_tag_slack_workspace.rb +86 -0
  45. data/lib/anthropic/models/beta/organization/claude_tag/bundle_list_params.rb +49 -0
  46. data/lib/anthropic/models/beta/organization/claude_tag/bundle_retrieve_params.rb +41 -0
  47. data/lib/anthropic/models/beta/organization/claude_tag/bundles/beta_claude_tag_bundle_target.rb +76 -0
  48. data/lib/anthropic/models/beta/organization/claude_tag/bundles/beta_claude_tag_bundle_target_create.rb +70 -0
  49. data/lib/anthropic/models/beta/organization/claude_tag/bundles/beta_claude_tag_deleted_bundle_target.rb +34 -0
  50. data/lib/anthropic/models/beta/organization/claude_tag/bundles/beta_claude_tag_slack_channel_bundle_target.rb +57 -0
  51. data/lib/anthropic/models/beta/organization/claude_tag/bundles/beta_claude_tag_slack_channel_bundle_target_create.rb +38 -0
  52. data/lib/anthropic/models/beta/organization/claude_tag/bundles/beta_claude_tag_slack_workspace_bundle_target.rb +57 -0
  53. data/lib/anthropic/models/beta/organization/claude_tag/bundles/beta_claude_tag_slack_workspace_bundle_target_create.rb +38 -0
  54. data/lib/anthropic/models/beta/organization/claude_tag/bundles/target_create_params.rb +43 -0
  55. data/lib/anthropic/models/beta/organization/claude_tag/bundles/target_delete_params.rb +53 -0
  56. data/lib/anthropic/models/beta/organization/claude_tag/bundles/target_list_params.rb +59 -0
  57. data/lib/anthropic/models/beta/organization/claude_tag/bundles/target_retrieve_params.rb +53 -0
  58. data/lib/anthropic/models/beta/organization/claude_tag/slack_channel_create_params.rb +50 -0
  59. data/lib/anthropic/models/beta/organization/claude_tag/slack_channel_delete_params.rb +41 -0
  60. data/lib/anthropic/models/beta/organization/claude_tag/slack_channel_list_params.rb +79 -0
  61. data/lib/anthropic/models/beta/organization/claude_tag/slack_channel_retrieve_params.rb +52 -0
  62. data/lib/anthropic/models/beta/organization/claude_tag/slack_channel_update_params.rb +49 -0
  63. data/lib/anthropic/models/beta/organization/claude_tag/slack_workspace_list_params.rb +70 -0
  64. data/lib/anthropic/models/beta/organization/claude_tag/slack_workspace_retrieve_params.rb +52 -0
  65. data/lib/anthropic/models/beta/organization/claude_tag/slack_workspace_update_params.rb +49 -0
  66. data/lib/anthropic/models/code_execution_tool_20260120.rb +10 -2
  67. data/lib/anthropic/models/code_execution_tool_result_block_content.rb +5 -1
  68. data/lib/anthropic/models/code_execution_tool_result_block_param_content.rb +1 -1
  69. data/lib/anthropic/models/encrypted_code_execution_result_block.rb +9 -1
  70. data/lib/anthropic/models/encrypted_code_execution_result_block_param.rb +2 -1
  71. data/lib/anthropic/models/message_count_tokens_tool.rb +5 -1
  72. data/lib/anthropic/models/organization/external_key.rb +3 -3
  73. data/lib/anthropic/models/skill_params.rb +1 -1
  74. data/lib/anthropic/models/tool_union.rb +5 -1
  75. data/lib/anthropic/resources/beta/agents/versions.rb +2 -1
  76. data/lib/anthropic/resources/beta/agents.rb +10 -5
  77. data/lib/anthropic/resources/beta/deployment_runs.rb +4 -2
  78. data/lib/anthropic/resources/beta/deployments.rb +16 -8
  79. data/lib/anthropic/resources/beta/dreams.rb +10 -5
  80. data/lib/anthropic/resources/beta/environments/work.rb +16 -8
  81. data/lib/anthropic/resources/beta/environments.rb +12 -6
  82. data/lib/anthropic/resources/beta/files.rb +10 -5
  83. data/lib/anthropic/resources/beta/memory_stores/memories.rb +10 -5
  84. data/lib/anthropic/resources/beta/memory_stores/memory_versions.rb +6 -11
  85. data/lib/anthropic/resources/beta/memory_stores.rb +12 -6
  86. data/lib/anthropic/resources/beta/messages/batches.rb +12 -6
  87. data/lib/anthropic/resources/beta/messages.rb +6 -3
  88. data/lib/anthropic/resources/beta/models.rb +4 -2
  89. data/lib/anthropic/resources/beta/organization/analytics/apps/chat/projects.rb +2 -1
  90. data/lib/anthropic/resources/beta/organization/analytics/artifacts.rb +2 -1
  91. data/lib/anthropic/resources/beta/organization/analytics/connectors.rb +2 -1
  92. data/lib/anthropic/resources/beta/organization/analytics/cost.rb +2 -1
  93. data/lib/anthropic/resources/beta/organization/analytics/cost_report.rb +2 -1
  94. data/lib/anthropic/resources/beta/organization/analytics/plugins.rb +2 -1
  95. data/lib/anthropic/resources/beta/organization/analytics/skills.rb +2 -1
  96. data/lib/anthropic/resources/beta/organization/analytics/summaries.rb +2 -1
  97. data/lib/anthropic/resources/beta/organization/analytics/usage.rb +2 -1
  98. data/lib/anthropic/resources/beta/organization/analytics/usage_report.rb +2 -1
  99. data/lib/anthropic/resources/beta/organization/analytics/user_cost_report.rb +5 -4
  100. data/lib/anthropic/resources/beta/organization/analytics/user_usage_report.rb +5 -4
  101. data/lib/anthropic/resources/beta/organization/analytics/users.rb +2 -1
  102. data/lib/anthropic/resources/beta/organization/api_keys.rb +6 -3
  103. data/lib/anthropic/resources/beta/organization/claude_tag/bundles/targets.rb +204 -0
  104. data/lib/anthropic/resources/beta/organization/claude_tag/bundles.rb +102 -0
  105. data/lib/anthropic/resources/beta/organization/claude_tag/slack_channels.rb +263 -0
  106. data/lib/anthropic/resources/beta/organization/claude_tag/slack_workspaces.rb +162 -0
  107. data/lib/anthropic/resources/beta/organization/claude_tag.rb +31 -0
  108. data/lib/anthropic/resources/beta/organization/compliance_settings.rb +4 -2
  109. data/lib/anthropic/resources/beta/organization/external_keys.rb +12 -6
  110. data/lib/anthropic/resources/beta/organization/federation/issuers.rb +10 -5
  111. data/lib/anthropic/resources/beta/organization/federation/rules/workspaces.rb +6 -3
  112. data/lib/anthropic/resources/beta/organization/federation/rules.rb +10 -5
  113. data/lib/anthropic/resources/beta/organization/invites.rb +8 -4
  114. data/lib/anthropic/resources/beta/organization/plugin_marketplaces.rb +10 -5
  115. data/lib/anthropic/resources/beta/organization/plugins/installation_settings.rb +6 -11
  116. data/lib/anthropic/resources/beta/organization/plugins/shares.rb +2 -1
  117. data/lib/anthropic/resources/beta/organization/plugins/versions.rb +8 -4
  118. data/lib/anthropic/resources/beta/organization/plugins.rb +10 -5
  119. data/lib/anthropic/resources/beta/organization/rate_limits.rb +2 -1
  120. data/lib/anthropic/resources/beta/organization/rbac_groups/members.rb +6 -3
  121. data/lib/anthropic/resources/beta/organization/rbac_groups.rb +10 -5
  122. data/lib/anthropic/resources/beta/organization/rbac_roles/permissions.rb +2 -1
  123. data/lib/anthropic/resources/beta/organization/rbac_roles.rb +4 -2
  124. data/lib/anthropic/resources/beta/organization/service_accounts/workspaces.rb +6 -3
  125. data/lib/anthropic/resources/beta/organization/service_accounts.rb +10 -5
  126. data/lib/anthropic/resources/beta/organization/spend_limits/effective.rb +2 -1
  127. data/lib/anthropic/resources/beta/organization/spend_limits/increase_requests.rb +8 -4
  128. data/lib/anthropic/resources/beta/organization/spend_limits.rb +8 -4
  129. data/lib/anthropic/resources/beta/organization/telemetry_destinations/workspaces.rb +6 -3
  130. data/lib/anthropic/resources/beta/organization/telemetry_destinations.rb +12 -6
  131. data/lib/anthropic/resources/beta/organization/users.rb +8 -4
  132. data/lib/anthropic/resources/beta/organization/webhooks.rb +12 -9
  133. data/lib/anthropic/resources/beta/organization/workspaces/members.rb +10 -5
  134. data/lib/anthropic/resources/beta/organization/workspaces/rate_limits.rb +4 -6
  135. data/lib/anthropic/resources/beta/organization/workspaces/service_accounts.rb +10 -5
  136. data/lib/anthropic/resources/beta/organization/workspaces.rb +10 -5
  137. data/lib/anthropic/resources/beta/organization.rb +6 -1
  138. data/lib/anthropic/resources/beta/sessions/events.rb +6 -3
  139. data/lib/anthropic/resources/beta/sessions/resources.rb +10 -5
  140. data/lib/anthropic/resources/beta/sessions/threads/events.rb +4 -2
  141. data/lib/anthropic/resources/beta/sessions/threads.rb +6 -3
  142. data/lib/anthropic/resources/beta/sessions.rb +12 -6
  143. data/lib/anthropic/resources/beta/skills/versions.rb +10 -5
  144. data/lib/anthropic/resources/beta/skills.rb +8 -4
  145. data/lib/anthropic/resources/beta/tunnels/certificates.rb +8 -4
  146. data/lib/anthropic/resources/beta/tunnels.rb +12 -6
  147. data/lib/anthropic/resources/beta/user_profiles/action_urls.rb +2 -1
  148. data/lib/anthropic/resources/beta/user_profiles.rb +12 -6
  149. data/lib/anthropic/resources/beta/vaults/credentials.rb +14 -7
  150. data/lib/anthropic/resources/beta/vaults.rb +12 -6
  151. data/lib/anthropic/version.rb +1 -1
  152. data/lib/anthropic.rb +47 -0
  153. data/rbi/anthropic/helpers/google_cloud/client.rbi +0 -4
  154. data/rbi/anthropic/internal/tracing.rbi +28 -0
  155. data/rbi/anthropic/internal/transport/base_client.rbi +5 -1
  156. data/rbi/anthropic/internal/type/base_page.rbi +2 -0
  157. data/rbi/anthropic/internal/type/base_stream.rbi +2 -0
  158. data/rbi/anthropic/internal/type/request_parameters.rbi +4 -0
  159. data/rbi/anthropic/models/anthropic_beta.rbi +5 -0
  160. data/rbi/anthropic/models/beta/beta_code_execution_tool_20260120.rbi +10 -2
  161. data/rbi/anthropic/models/beta/beta_encrypted_code_execution_result_block.rbi +9 -1
  162. data/rbi/anthropic/models/beta/beta_encrypted_code_execution_result_block_param.rbi +2 -1
  163. data/rbi/anthropic/models/beta/beta_skill_params.rbi +1 -1
  164. data/rbi/anthropic/models/beta/environments/beta_self_hosted_work_heartbeat_response.rbi +4 -2
  165. data/rbi/anthropic/models/beta/environments/beta_self_hosted_work_queue_stats.rbi +2 -4
  166. data/rbi/anthropic/models/beta/organization/beta_claude_tag_default_setting_source.rbi +31 -0
  167. data/rbi/anthropic/models/beta/organization/beta_claude_tag_guest_policy.rbi +87 -0
  168. data/rbi/anthropic/models/beta/organization/beta_claude_tag_guest_policy_allow.rbi +31 -0
  169. data/rbi/anthropic/models/beta/organization/beta_claude_tag_guest_policy_channel_only.rbi +31 -0
  170. data/rbi/anthropic/models/beta/organization/beta_claude_tag_guest_policy_restrict.rbi +31 -0
  171. data/rbi/anthropic/models/beta/organization/beta_claude_tag_setting_source.rbi +115 -0
  172. data/rbi/anthropic/models/beta/organization/beta_claude_tag_setting_sources.rbi +178 -0
  173. data/rbi/anthropic/models/beta/organization/beta_claude_tag_settings.rbi +108 -0
  174. data/rbi/anthropic/models/beta/organization/beta_claude_tag_settings_create.rbi +110 -0
  175. data/rbi/anthropic/models/beta/organization/beta_claude_tag_settings_update.rbi +110 -0
  176. data/rbi/anthropic/models/beta/organization/beta_claude_tag_slack_channel_identifiers.rbi +50 -0
  177. data/rbi/anthropic/models/beta/organization/beta_claude_tag_slack_channel_setting_source.rbi +43 -0
  178. data/rbi/anthropic/models/beta/organization/beta_claude_tag_slack_default_setting_source.rbi +32 -0
  179. data/rbi/anthropic/models/beta/organization/beta_claude_tag_slack_grid_channel_setting_source.rbi +67 -0
  180. data/rbi/anthropic/models/beta/organization/beta_claude_tag_slack_parent_channel_setting_source.rbi +44 -0
  181. data/rbi/anthropic/models/beta/organization/beta_claude_tag_slack_workspace_identifiers.rbi +36 -0
  182. data/rbi/anthropic/models/beta/organization/beta_claude_tag_slack_workspace_setting_source.rbi +43 -0
  183. data/rbi/anthropic/models/beta/organization/beta_external_key.rbi +4 -4
  184. data/rbi/anthropic/models/beta/organization/claude_tag/beta_claude_tag_bundle.rbi +87 -0
  185. data/rbi/anthropic/models/beta/organization/claude_tag/beta_claude_tag_deleted_slack_channel.rbi +41 -0
  186. data/rbi/anthropic/models/beta/organization/claude_tag/beta_claude_tag_slack_channel.rbi +154 -0
  187. data/rbi/anthropic/models/beta/organization/claude_tag/beta_claude_tag_slack_workspace.rbi +151 -0
  188. data/rbi/anthropic/models/beta/organization/claude_tag/bundle_list_params.rbi +92 -0
  189. data/rbi/anthropic/models/beta/organization/claude_tag/bundle_retrieve_params.rbi +78 -0
  190. data/rbi/anthropic/models/beta/organization/claude_tag/bundles/beta_claude_tag_bundle_target.rbi +102 -0
  191. data/rbi/anthropic/models/beta/organization/claude_tag/bundles/beta_claude_tag_bundle_target_create.rbi +92 -0
  192. data/rbi/anthropic/models/beta/organization/claude_tag/bundles/beta_claude_tag_deleted_bundle_target.rbi +43 -0
  193. data/rbi/anthropic/models/beta/organization/claude_tag/bundles/beta_claude_tag_slack_channel_bundle_target.rbi +78 -0
  194. data/rbi/anthropic/models/beta/organization/claude_tag/bundles/beta_claude_tag_slack_channel_bundle_target_create.rbi +51 -0
  195. data/rbi/anthropic/models/beta/organization/claude_tag/bundles/beta_claude_tag_slack_workspace_bundle_target.rbi +78 -0
  196. data/rbi/anthropic/models/beta/organization/claude_tag/bundles/beta_claude_tag_slack_workspace_bundle_target_create.rbi +51 -0
  197. data/rbi/anthropic/models/beta/organization/claude_tag/bundles/target_create_params.rbi +82 -0
  198. data/rbi/anthropic/models/beta/organization/claude_tag/bundles/target_delete_params.rbi +94 -0
  199. data/rbi/anthropic/models/beta/organization/claude_tag/bundles/target_list_params.rbi +104 -0
  200. data/rbi/anthropic/models/beta/organization/claude_tag/bundles/target_retrieve_params.rbi +94 -0
  201. data/rbi/anthropic/models/beta/organization/claude_tag/slack_channel_create_params.rbi +118 -0
  202. data/rbi/anthropic/models/beta/organization/claude_tag/slack_channel_delete_params.rbi +78 -0
  203. data/rbi/anthropic/models/beta/organization/claude_tag/slack_channel_list_params.rbi +134 -0
  204. data/rbi/anthropic/models/beta/organization/claude_tag/slack_channel_retrieve_params.rbi +95 -0
  205. data/rbi/anthropic/models/beta/organization/claude_tag/slack_channel_update_params.rbi +100 -0
  206. data/rbi/anthropic/models/beta/organization/claude_tag/slack_workspace_list_params.rbi +124 -0
  207. data/rbi/anthropic/models/beta/organization/claude_tag/slack_workspace_retrieve_params.rbi +95 -0
  208. data/rbi/anthropic/models/beta/organization/claude_tag/slack_workspace_update_params.rbi +100 -0
  209. data/rbi/anthropic/models/code_execution_tool_20260120.rbi +10 -2
  210. data/rbi/anthropic/models/encrypted_code_execution_result_block.rbi +9 -1
  211. data/rbi/anthropic/models/encrypted_code_execution_result_block_param.rbi +2 -1
  212. data/rbi/anthropic/models/organization/external_key.rbi +4 -4
  213. data/rbi/anthropic/models/skill_params.rbi +1 -1
  214. data/rbi/anthropic/resources/beta/organization/analytics/user_cost_report.rbi +3 -3
  215. data/rbi/anthropic/resources/beta/organization/analytics/user_usage_report.rbi +3 -3
  216. data/rbi/anthropic/resources/beta/organization/claude_tag/bundles/targets.rbi +140 -0
  217. data/rbi/anthropic/resources/beta/organization/claude_tag/bundles.rbi +75 -0
  218. data/rbi/anthropic/resources/beta/organization/claude_tag/slack_channels.rbi +203 -0
  219. data/rbi/anthropic/resources/beta/organization/claude_tag/slack_workspaces.rbi +123 -0
  220. data/rbi/anthropic/resources/beta/organization/claude_tag.rbi +37 -0
  221. data/rbi/anthropic/resources/beta/organization.rbi +3 -0
  222. data/sig/anthropic/helpers/google_cloud/client.rbs +0 -2
  223. data/sig/anthropic/internal/tracing.rbs +14 -0
  224. data/sig/anthropic/internal/transport/base_client.rbs +3 -0
  225. data/sig/anthropic/internal/type/request_parameters.rbs +2 -0
  226. data/sig/anthropic/models/anthropic_beta.rbs +2 -0
  227. data/sig/anthropic/models/beta/organization/beta_claude_tag_default_setting_source.rbs +17 -0
  228. data/sig/anthropic/models/beta/organization/beta_claude_tag_guest_policy.rbs +45 -0
  229. data/sig/anthropic/models/beta/organization/beta_claude_tag_guest_policy_allow.rbs +17 -0
  230. data/sig/anthropic/models/beta/organization/beta_claude_tag_guest_policy_channel_only.rbs +17 -0
  231. data/sig/anthropic/models/beta/organization/beta_claude_tag_guest_policy_restrict.rbs +17 -0
  232. data/sig/anthropic/models/beta/organization/beta_claude_tag_setting_source.rbs +73 -0
  233. data/sig/anthropic/models/beta/organization/beta_claude_tag_setting_sources.rbs +44 -0
  234. data/sig/anthropic/models/beta/organization/beta_claude_tag_settings.rbs +44 -0
  235. data/sig/anthropic/models/beta/organization/beta_claude_tag_settings_create.rbs +44 -0
  236. data/sig/anthropic/models/beta/organization/beta_claude_tag_settings_update.rbs +44 -0
  237. data/sig/anthropic/models/beta/organization/beta_claude_tag_slack_channel_identifiers.rbs +20 -0
  238. data/sig/anthropic/models/beta/organization/beta_claude_tag_slack_channel_setting_source.rbs +23 -0
  239. data/sig/anthropic/models/beta/organization/beta_claude_tag_slack_default_setting_source.rbs +18 -0
  240. data/sig/anthropic/models/beta/organization/beta_claude_tag_slack_grid_channel_setting_source.rbs +29 -0
  241. data/sig/anthropic/models/beta/organization/beta_claude_tag_slack_parent_channel_setting_source.rbs +26 -0
  242. data/sig/anthropic/models/beta/organization/beta_claude_tag_slack_workspace_identifiers.rbs +18 -0
  243. data/sig/anthropic/models/beta/organization/beta_claude_tag_slack_workspace_setting_source.rbs +23 -0
  244. data/sig/anthropic/models/beta/organization/claude_tag/beta_claude_tag_bundle.rbs +51 -0
  245. data/sig/anthropic/models/beta/organization/claude_tag/beta_claude_tag_deleted_slack_channel.rbs +22 -0
  246. data/sig/anthropic/models/beta/organization/claude_tag/beta_claude_tag_slack_channel.rbs +56 -0
  247. data/sig/anthropic/models/beta/organization/claude_tag/beta_claude_tag_slack_workspace.rbs +56 -0
  248. data/sig/anthropic/models/beta/organization/claude_tag/bundle_list_params.rbs +50 -0
  249. data/sig/anthropic/models/beta/organization/claude_tag/bundle_retrieve_params.rbs +41 -0
  250. data/sig/anthropic/models/beta/organization/claude_tag/bundles/beta_claude_tag_bundle_target.rbs +54 -0
  251. data/sig/anthropic/models/beta/organization/claude_tag/bundles/beta_claude_tag_bundle_target_create.rbs +48 -0
  252. data/sig/anthropic/models/beta/organization/claude_tag/bundles/beta_claude_tag_deleted_bundle_target.rbs +27 -0
  253. data/sig/anthropic/models/beta/organization/claude_tag/bundles/beta_claude_tag_slack_channel_bundle_target.rbs +43 -0
  254. data/sig/anthropic/models/beta/organization/claude_tag/bundles/beta_claude_tag_slack_channel_bundle_target_create.rbs +27 -0
  255. data/sig/anthropic/models/beta/organization/claude_tag/bundles/beta_claude_tag_slack_workspace_bundle_target.rbs +43 -0
  256. data/sig/anthropic/models/beta/organization/claude_tag/bundles/beta_claude_tag_slack_workspace_bundle_target_create.rbs +30 -0
  257. data/sig/anthropic/models/beta/organization/claude_tag/bundles/target_create_params.rbs +43 -0
  258. data/sig/anthropic/models/beta/organization/claude_tag/bundles/target_delete_params.rbs +48 -0
  259. data/sig/anthropic/models/beta/organization/claude_tag/bundles/target_list_params.rbs +57 -0
  260. data/sig/anthropic/models/beta/organization/claude_tag/bundles/target_retrieve_params.rbs +48 -0
  261. data/sig/anthropic/models/beta/organization/claude_tag/slack_channel_create_params.rbs +50 -0
  262. data/sig/anthropic/models/beta/organization/claude_tag/slack_channel_delete_params.rbs +38 -0
  263. data/sig/anthropic/models/beta/organization/claude_tag/slack_channel_list_params.rbs +69 -0
  264. data/sig/anthropic/models/beta/organization/claude_tag/slack_channel_retrieve_params.rbs +48 -0
  265. data/sig/anthropic/models/beta/organization/claude_tag/slack_channel_update_params.rbs +46 -0
  266. data/sig/anthropic/models/beta/organization/claude_tag/slack_workspace_list_params.rbs +64 -0
  267. data/sig/anthropic/models/beta/organization/claude_tag/slack_workspace_retrieve_params.rbs +48 -0
  268. data/sig/anthropic/models/beta/organization/claude_tag/slack_workspace_update_params.rbs +46 -0
  269. data/sig/anthropic/resources/beta/organization/claude_tag/bundles/targets.rbs +44 -0
  270. data/sig/anthropic/resources/beta/organization/claude_tag/bundles.rbs +28 -0
  271. data/sig/anthropic/resources/beta/organization/claude_tag/slack_channels.rbs +50 -0
  272. data/sig/anthropic/resources/beta/organization/claude_tag/slack_workspaces.rbs +36 -0
  273. data/sig/anthropic/resources/beta/organization/claude_tag.rbs +17 -0
  274. data/sig/anthropic/resources/beta/organization.rbs +2 -0
  275. metadata +142 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0fa0ec3e782fb7fc0c20e1c0a5e85c5c7b8b83891d1e42a3e604b22936a3e52a
4
- data.tar.gz: 1ffcd5af0856f4677a04899b7c0e5c2b2703da055d14a58aa1042a710d89e466
3
+ metadata.gz: 19e65c78c32b38c06866fa6d8bc50f8219170fc73c7a2171c118e89a3c8fdf65
4
+ data.tar.gz: d2a9d4159eaf896aa79f238e7980f9fb15a523a44aa77e7165ef18bbb2bd3969
5
5
  SHA512:
6
- metadata.gz: 5dc4b3c320eae3c0aad79ec29f21235792820cc8d946ad64b849a81403be3cfeac29bddd270d5db09a6744aee60ada26dc0dd1a42129d584a35377a4389ab2af
7
- data.tar.gz: 06a39cffd5d2f99b951bc98e34967972c17da8a04da48395ae2d426640b71ad36649b6053f704c53112c5050861d4825664dca1947d65af7df66f64f3d2832d0
6
+ metadata.gz: a875dfc422ae1a9257e133e34307c40d3779f1560cb3c4b88a1193e2824f6a6b8b245ac2c459cd1a31c75a357bdfabc06a55f2f2620863b3928d54588c91cc11
7
+ data.tar.gz: 72a6f11b4fa46e78254ce2593557d6bdb48b4e9db948b973a1392536e05fe332b7544149095c78ca7239cc4e11fd5a7e97fc552825316c433aae0392920ce01a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.3.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v2.2.0...v2.3.0) (2026-10-23)
4
+
5
+ ### Features
6
+
7
+ * **api:** add Claude Tag endpoints for Claude Enterprise organizations
8
+ * **google-cloud:** add user profiles and send them to the organization endpoint; `user_profiles` calls used to raise `NotImplementedError`
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **bedrock:** `BedrockClient` with an API key takes its region from `AWS_REGION`, then `AWS_DEFAULT_REGION`, when `aws_region` is not passed
14
+ * **client:** link the long-request error message to the SDK documentation
15
+
16
+
17
+ ### Chores
18
+
19
+ * **client:** stop sending query params hardcoded in endpoint paths
20
+ * **docs:** improve the descriptions of the code execution tool and its encrypted results
21
+ * **docs:** reword work queue, skill and external key descriptions
22
+ * **docs:** update descriptions of the per-user usage and cost reports
23
+ * **internal:** carry endpoint path query params to the request layer
24
+ * **internal:** check the repository by owner and public name in workflows
25
+ * **internal:** lint against mixing a module into a class from outside
26
+ * **internal:** read the beta route qualifier instead of the beta=true query
27
+ * **internal:** remove preview build upload from CI
28
+ * **internal:** stop expecting the beta query param in tests
29
+ * **internal:** test that rbi and sig declare every public method
30
+
31
+
32
+ ### Documentation
33
+
34
+ * **google-cloud:** update the product name
35
+ * update the README and the example request
36
+
3
37
  ## [2.2.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v2.1.0...v2.2.0) (2026-10-23)
4
38
 
5
39
  ### Features
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", "~> 2.2.0"
18
+ gem "anthropic", "~> 2.3.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
@@ -33,7 +33,7 @@ anthropic = Anthropic::Client.new(
33
33
  message = anthropic.messages.create(
34
34
  max_tokens: 1024,
35
35
  messages: [{role: "user", content: "Hello, Claude"}],
36
- model: "claude-opus-5-5"
36
+ model: Anthropic::Model::CLAUDE_OPUS_5_5
37
37
  )
38
38
 
39
39
  puts(message.content)
@@ -118,7 +118,7 @@ module Anthropic
118
118
  if expected_time > default_time || (max_nonstreaming_tokens && max_tokens > max_nonstreaming_tokens)
119
119
  raise ArgumentError.new(
120
120
  "Streaming is required for operations that may take longer than 10 minutes. " \
121
- "See https://github.com/anthropics/anthropic-sdk-ruby#long-requests for more details"
121
+ "See https://platform.claude.com/docs/en/cli-sdks-libraries/sdks/ruby#streaming for more details"
122
122
  )
123
123
  end
124
124
 
@@ -28,6 +28,7 @@ module Anthropic
28
28
  #
29
29
  # @param aws_region [String, nil] Enforce the AWS Region to use. If unset, the region is set according to the
30
30
  # AWS SDK's default resolution order, described at https://github.com/aws/aws-sdk-ruby?tab=readme-ov-file#configuration
31
+ # With an API key, defaults to `ENV["AWS_REGION"]`, then `ENV["AWS_DEFAULT_REGION"]`.
31
32
  #
32
33
  # @param aws_access_key [String, nil] Optional AWS access key to use for authentication. Overrides profile and credential provider chain
33
34
  #
@@ -118,7 +119,7 @@ module Anthropic
118
119
  credentials: @aws_credentials
119
120
  )
120
121
  else
121
- @aws_region = aws_region
122
+ @aws_region = aws_region || env_lookup("AWS_REGION", "AWS_DEFAULT_REGION")
122
123
  end
123
124
 
124
125
  base_url = ENV["ANTHROPIC_BEDROCK_BASE_URL"] if base_url.to_s.empty?
@@ -309,14 +310,16 @@ module Anthropic
309
310
  private def validate_bedrock_request!(request_components)
310
311
  # Id-parameterized routes pass `path` as an Array whose first element
311
312
  # is the format string (e.g. `["v1/messages/batches/%1$s", id]`).
312
- case Array(request_components[:path]).first.to_s
313
+ path = Array(request_components[:path]).first.to_s
314
+ beta = request_components.dig(:qualifiers, :beta) == "true" || path.include?("?beta=true")
315
+ case path
313
316
  in %r{^v1/messages/batches}
314
317
  message = "The Batch API is not supported in Bedrock yet"
315
318
  raise NotImplementedError.new(message)
316
319
  in %r{v1/messages/count_tokens}
317
320
  message = "Token counting is not supported in Bedrock yet"
318
321
  raise NotImplementedError.new(message)
319
- in %r{v1/models\?beta=true}
322
+ in %r{v1/models(\?|\z)} if beta
320
323
  # rubocop:disable Layout/LineLength
321
324
  message = "Please instead use https://docs.anthropic.com/en/api/claude-on-amazon-bedrock#list-available-models to list available models on Bedrock."
322
325
  # rubocop:enable Layout/LineLength
@@ -3,14 +3,14 @@
3
3
  module Anthropic
4
4
  module Helpers
5
5
  module GoogleCloud
6
- # Client for Claude Platform on Google Cloud — the first-party Anthropic
7
- # API served through the Google Cloud gateway.
6
+ # Client for Claude Models on Google Cloud (Anthropic managed) — the
7
+ # first-party Anthropic API served through the Google Cloud gateway.
8
8
  #
9
9
  # This is distinct from {Anthropic::VertexClient}, which targets the
10
10
  # `:rawPredict` publisher-model API (publisher model IDs, messages
11
11
  # only). This client speaks the full first-party Anthropic API: requests
12
12
  # pass through the gateway unchanged — standard `/v1/*` paths, standard
13
- # model names. The gateway does not serve the User Profiles API.
13
+ # model names.
14
14
  class Client < Anthropic::Client
15
15
  # OAuth2 scope required to call the gateway.
16
16
  SCOPE = "https://www.googleapis.com/auth/cloud-platform"
@@ -26,9 +26,9 @@ module Anthropic
26
26
  # served from a base with no workspace in it.
27
27
  ORGANIZATION_URL_TEMPLATE = "#{LOCATION_URL_TEMPLATE}/claudeOrganization/invoke".freeze
28
28
 
29
- ORGANIZATION_PATH_PREFIX = "/v1/organizations/"
29
+ ORGANIZATION_PATH_PATTERN = %r{\A/v1/(?:organizations/|user_profiles(?:/|\z))}
30
30
 
31
- private_constant :LOCATION_URL_TEMPLATE, :ORGANIZATION_PATH_PREFIX
31
+ private_constant :LOCATION_URL_TEMPLATE, :ORGANIZATION_PATH_PATTERN
32
32
 
33
33
  # @return [String, nil]
34
34
  attr_reader :project
@@ -63,7 +63,8 @@ module Anthropic
63
63
  # @param workspace_id [String, nil] Defaults to
64
64
  # `ENV["ANTHROPIC_GOOGLE_CLOUD_WORKSPACE_ID"]`. Required when the base
65
65
  # URL is derived, except for organization-level routes
66
- # (`/v1/organizations/`), which need no workspace ID.
66
+ # (`/v1/organizations/` and `/v1/user_profiles`), which need no
67
+ # workspace ID.
67
68
  #
68
69
  # @param base_url [String, nil] Override the gateway base URL for every
69
70
  # route. Defaults to `ENV["ANTHROPIC_GOOGLE_CLOUD_BASE_URL"]`, otherwise
@@ -154,10 +155,7 @@ module Anthropic
154
155
  # No first-party credential is ever passed up, and
155
156
  # {#resolve_default_credentials?} keeps the parent from discovering
156
157
  # one; `base_url` is always resolved by this point, so the parent's
157
- # `ANTHROPIC_BASE_URL` fallback never applies. The parent wires up
158
- # every resource; {#user_profiles} withholds the one the gateway does
159
- # not serve, and {#build_request} refuses the user profile routes
160
- # however the resource is reached.
158
+ # `ANTHROPIC_BASE_URL` fallback never applies.
161
159
  super(
162
160
  base_url: base_url,
163
161
  timeout: timeout,
@@ -175,13 +173,6 @@ module Anthropic
175
173
  # @see Anthropic::Client#resolve_default_credentials?
176
174
  private def resolve_default_credentials? = false
177
175
 
178
- # User profiles are not supported on the Google Cloud gateway.
179
- #
180
- # @raise [NotImplementedError]
181
- def user_profiles
182
- raise NotImplementedError.new("User profiles are not supported on the Google Cloud gateway.")
183
- end
184
-
185
176
  # @api private
186
177
  #
187
178
  # @param req [Hash{Symbol=>Object}] .
@@ -219,15 +210,8 @@ module Anthropic
219
210
  # @option opts [Float, nil] :timeout
220
211
  #
221
212
  # @raise [ArgumentError]
222
- # @raise [NotImplementedError]
223
213
  # @return [Hash{Symbol=>Object}]
224
214
  private def build_request(req, opts)
225
- # Id-parameterized routes pass `path` as an Array whose first element
226
- # is the format string (e.g. `["v1/user_profiles/%1$s", id]`).
227
- if Array(req[:path]).first.to_s.start_with?("v1/user_profiles")
228
- raise NotImplementedError.new("User profiles are not supported on the Google Cloud gateway.")
229
- end
230
-
231
215
  request = super
232
216
  return request if @organization_base_url.nil?
233
217
 
@@ -238,7 +222,7 @@ module Anthropic
238
222
  return request unless under_base_url
239
223
 
240
224
  path = url.path.delete_prefix(base_url.path)
241
- if path.start_with?(ORGANIZATION_PATH_PREFIX)
225
+ if path.match?(ORGANIZATION_PATH_PATTERN)
242
226
  url = url.dup
243
227
  url.path = "#{@organization_base_url.path}#{path}"
244
228
  {**request, url: url}
@@ -225,8 +225,7 @@ module Anthropic
225
225
  return false unless req.method == :post
226
226
  return false unless req.body.is_a?(Hash)
227
227
  return false unless req.url.path&.end_with?("/v1/messages")
228
- query = URI.decode_www_form(req.url.query.to_s).to_h
229
- query["beta"] == "true"
228
+ req.metadata.dig(:qualifiers, :beta) == "true"
230
229
  end
231
230
 
232
231
  # @return [Anthropic::APIRequest] `req` with `@betas` appended to the
@@ -24,8 +24,9 @@ module Anthropic
24
24
  # The {HEADER} value to set after appending `value` to whatever is
25
25
  # already present in `headers` — existing tags keep their position, the
26
26
  # new tag goes at the end, duplicates are dropped, joined as one
27
- # comma-separated string. The backend logs the header as one opaque
28
- # string, so a second header line or a clobbered value loses data.
27
+ # comma-separated string. The new tag is merged into the existing value
28
+ # rather than replacing it, because a second header line or a clobbered
29
+ # value loses data.
29
30
  #
30
31
  # @param headers [Hash{String => String}]
31
32
  # @param value [String]
@@ -353,6 +353,26 @@ module Anthropic
353
353
  ORGANIZATION_WEBHOOKS_DELETE = "anthropic.organization.webhooks.delete"
354
354
  ORGANIZATION_WEBHOOKS_REGENERATE_SIGNING_SECRET =
355
355
  "anthropic.organization.webhooks.regenerate_signing_secret"
356
+ ORGANIZATION_CLAUDE_TAG_SLACK_CHANNELS_CREATE = "anthropic.organization.claude_tag.slack_channels.create"
357
+ ORGANIZATION_CLAUDE_TAG_SLACK_CHANNELS_RETRIEVE =
358
+ "anthropic.organization.claude_tag.slack_channels.retrieve"
359
+ ORGANIZATION_CLAUDE_TAG_SLACK_CHANNELS_UPDATE = "anthropic.organization.claude_tag.slack_channels.update"
360
+ ORGANIZATION_CLAUDE_TAG_SLACK_CHANNELS_LIST = "anthropic.organization.claude_tag.slack_channels.list"
361
+ ORGANIZATION_CLAUDE_TAG_SLACK_CHANNELS_DELETE = "anthropic.organization.claude_tag.slack_channels.delete"
362
+ ORGANIZATION_CLAUDE_TAG_SLACK_WORKSPACES_RETRIEVE =
363
+ "anthropic.organization.claude_tag.slack_workspaces.retrieve"
364
+ ORGANIZATION_CLAUDE_TAG_SLACK_WORKSPACES_UPDATE =
365
+ "anthropic.organization.claude_tag.slack_workspaces.update"
366
+ ORGANIZATION_CLAUDE_TAG_SLACK_WORKSPACES_LIST = "anthropic.organization.claude_tag.slack_workspaces.list"
367
+ ORGANIZATION_CLAUDE_TAG_BUNDLES_RETRIEVE = "anthropic.organization.claude_tag.bundles.retrieve"
368
+ ORGANIZATION_CLAUDE_TAG_BUNDLES_LIST = "anthropic.organization.claude_tag.bundles.list"
369
+ ORGANIZATION_CLAUDE_TAG_BUNDLES_TARGETS_CREATE =
370
+ "anthropic.organization.claude_tag.bundles.targets.create"
371
+ ORGANIZATION_CLAUDE_TAG_BUNDLES_TARGETS_RETRIEVE =
372
+ "anthropic.organization.claude_tag.bundles.targets.retrieve"
373
+ ORGANIZATION_CLAUDE_TAG_BUNDLES_TARGETS_LIST = "anthropic.organization.claude_tag.bundles.targets.list"
374
+ ORGANIZATION_CLAUDE_TAG_BUNDLES_TARGETS_DELETE =
375
+ "anthropic.organization.claude_tag.bundles.targets.delete"
356
376
  end
357
377
 
358
378
  # @type [Hash{String=>String}]
@@ -41,6 +41,7 @@ module Anthropic
41
41
  :page,
42
42
  :stream,
43
43
  :model,
44
+ :qualifiers,
44
45
  :span_name,
45
46
  :span_attributes,
46
47
  :span_created_id,
@@ -100,6 +101,8 @@ module Anthropic
100
101
  #
101
102
  # @option request [Float] :timeout
102
103
  #
104
+ # @option request [Hash{Symbol=>String}, nil] :qualifiers
105
+ #
103
106
  # @option request [Array<String>, nil] :span_query
104
107
  #
105
108
  # @option request [Array<String>, nil] :span_content_query
@@ -335,6 +338,9 @@ module Anthropic
335
338
  #
336
339
  # @option req [Anthropic::Internal::Type::Converter, Class, nil] :model
337
340
  #
341
+ # @option req [Hash{Symbol=>String}, nil] :qualifiers internal: the query pairs that tell the operation apart from the others with its
342
+ # path in the OpenAPI document
343
+ #
338
344
  # @option req [String, nil] :span_name
339
345
  #
340
346
  # @option req [Hash{String=>Object}, nil] :span_attributes
@@ -428,6 +434,7 @@ module Anthropic
428
434
  body: body,
429
435
  max_retries: opts.fetch(:max_retries, @max_retries),
430
436
  timeout: timeout,
437
+ qualifiers: req[:qualifiers],
431
438
  user_header_keys: user_header_keys,
432
439
  # For paginated requests `model` is the page's *item* type, not the
433
440
  # response envelope's — middleware `parse` falls back to the raw
@@ -439,7 +446,7 @@ module Anthropic
439
446
  span_content_query: req[:span_content_query],
440
447
  options: opts.except(:middleware),
441
448
  middleware: request_middleware,
442
- metadata: {}
449
+ metadata: {qualifiers: req[:qualifiers]}.compact
443
450
  }
444
451
  end
445
452
 
@@ -540,6 +547,8 @@ module Anthropic
540
547
  #
541
548
  # @option request [Float] :timeout
542
549
  #
550
+ # @option request [Hash{Symbol=>String}, nil] :qualifiers
551
+ #
543
552
  # @option request [Array<String>, nil] :span_query
544
553
  #
545
554
  # @option request [Array<String>, nil] :span_content_query
@@ -738,7 +747,7 @@ module Anthropic
738
747
  # Execute the request specified by `req`. This is the method that all resource
739
748
  # methods call into.
740
749
  #
741
- # @overload request(method, path, query: {}, headers: {}, body: nil, unwrap: nil, page: nil, stream: nil, model: Anthropic::Internal::Type::Unknown, span_name: nil, span_attributes: nil, span_created_id: nil, span_route: nil, span_query: nil, span_content_query: nil, options: {})
750
+ # @overload request(method, path, query: {}, headers: {}, body: nil, unwrap: nil, page: nil, stream: nil, model: Anthropic::Internal::Type::Unknown, qualifiers: nil, span_name: nil, span_attributes: nil, span_created_id: nil, span_route: nil, span_query: nil, span_content_query: nil, options: {})
742
751
  #
743
752
  # @param method [Symbol]
744
753
  #
@@ -758,6 +767,9 @@ module Anthropic
758
767
  #
759
768
  # @param model [Anthropic::Internal::Type::Converter, Class, nil]
760
769
  #
770
+ # @param qualifiers [Hash{Symbol=>String}, nil] internal: the query pairs that tell the operation apart from the others with its
771
+ # path in the OpenAPI document
772
+ #
761
773
  # @param span_name [String, nil]
762
774
  #
763
775
  # @param span_attributes [Hash{String=>Object}, nil]
@@ -913,6 +925,7 @@ module Anthropic
913
925
  T::Class[Anthropic::Internal::Type::BaseStream[T.anything, Anthropic::Internal::Type::BaseModel]]
914
926
  ),
915
927
  model: T.nilable(Anthropic::Internal::Type::Converter::Input),
928
+ qualifiers: T.nilable(T::Hash[Symbol, String]),
916
929
  span_name: T.nilable(String),
917
930
  span_attributes: T.nilable(T::Hash[String, T.anything]),
918
931
  span_created_id: T.nilable(T.any(String, T::Hash[String, Symbol])),
@@ -932,6 +945,7 @@ module Anthropic
932
945
  body: T.anything,
933
946
  max_retries: Integer,
934
947
  timeout: Float,
948
+ qualifiers: T.nilable(T::Hash[Symbol, String]),
935
949
  user_header_keys: T::Array[String],
936
950
  cast_to: T.nilable(Anthropic::Internal::Type::Converter::Input),
937
951
  stream: T.nilable(T::Class[T.anything]),
@@ -113,6 +113,8 @@ module Anthropic
113
113
 
114
114
  variant const: -> { Anthropic::Models::AnthropicBeta::ANALYTICS_USAGE_COST_2026_08_24 }
115
115
 
116
+ variant const: -> { Anthropic::Models::AnthropicBeta::EXPERIMENTAL_CLAUDE_TAG_2026_10_21 }
117
+
116
118
  variant String
117
119
 
118
120
  # @!method self.variants
@@ -178,6 +180,7 @@ module Anthropic
178
180
  WEBHOOKS_2026_10_07 = :"webhooks-2026-10-07"
179
181
  MESSAGE_THREADS_2026_08_12 = :"message-threads-2026-08-12"
180
182
  ANALYTICS_USAGE_COST_2026_08_24 = :"analytics-usage-cost-2026-08-24"
183
+ EXPERIMENTAL_CLAUDE_TAG_2026_10_21 = :"experimental-claude-tag-2026-10-21"
181
184
 
182
185
  # @!endgroup
183
186
  end
@@ -43,8 +43,16 @@ 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
- # Code execution tool with REPL state persistence (daemon mode + gVisor
47
- # checkpoint).
46
+ # A `tools` entry for the code execution tool, version `code_execution_20260120`.
47
+ # It adds REPL state persistence to version `code_execution_20250825`.
48
+ #
49
+ # REPL state persistence applies with programmatic tool calling. With it, the
50
+ # Python interpreter state, such as variable bindings, persists across requests
51
+ # that reuse the container.
52
+ #
53
+ # See the
54
+ # [code execution tool guide](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool#tool-versions)
55
+ # to learn what each tool version adds.
48
56
  #
49
57
  # Some parameter documentations has been truncated, see
50
58
  # {Anthropic::Models::Beta::BetaCodeExecutionTool20260120} for more details.
@@ -10,7 +10,11 @@ module Anthropic
10
10
 
11
11
  variant -> { Anthropic::Beta::BetaCodeExecutionResultBlock }
12
12
 
13
- # Code execution result with encrypted stdout for PFC + web_search results.
13
+ # The output and exit code of Python code that Claude ran with the code execution tool, with standard output in encrypted form.
14
+ #
15
+ # The API returns this block in place of `code_execution_result` when the code called the web search tool.
16
+ #
17
+ # See the [programmatic tool calling guide](https://platform.claude.com/docs/en/agents-and-tools/tool-use/programmatic-tool-calling) to learn more about programmatic tool calling.
14
18
  variant -> { Anthropic::Beta::BetaEncryptedCodeExecutionResultBlock }
15
19
 
16
20
  # @!method self.variants
@@ -10,7 +10,7 @@ module Anthropic
10
10
 
11
11
  variant -> { Anthropic::Beta::BetaCodeExecutionResultBlockParam }
12
12
 
13
- # Code execution result with encrypted stdout for PFC + web_search results.
13
+ # The output and exit code of Python code that Claude ran with the code execution tool, with standard output in encrypted form, sent back in a later request.
14
14
  variant -> { Anthropic::Beta::BetaEncryptedCodeExecutionResultBlockParam }
15
15
 
16
16
  # @!method self.variants
@@ -31,7 +31,15 @@ module Anthropic
31
31
  required :type, const: :encrypted_code_execution_result
32
32
 
33
33
  # @!method initialize(content:, encrypted_stdout:, return_code:, stderr:, type: :encrypted_code_execution_result)
34
- # Code execution result with encrypted stdout for PFC + web_search results.
34
+ # The output and exit code of Python code that Claude ran with the code execution
35
+ # tool, with standard output in encrypted form.
36
+ #
37
+ # The API returns this block in place of `code_execution_result` when the code
38
+ # called the web search tool.
39
+ #
40
+ # See the
41
+ # [programmatic tool calling guide](https://platform.claude.com/docs/en/agents-and-tools/tool-use/programmatic-tool-calling)
42
+ # to learn more about programmatic tool calling.
35
43
  #
36
44
  # @param content [Array<Anthropic::Models::Beta::BetaCodeExecutionOutputBlock>]
37
45
  # @param encrypted_stdout [String]
@@ -31,7 +31,8 @@ module Anthropic
31
31
  required :type, const: :encrypted_code_execution_result
32
32
 
33
33
  # @!method initialize(content:, encrypted_stdout:, return_code:, stderr:, type: :encrypted_code_execution_result)
34
- # Code execution result with encrypted stdout for PFC + web_search results.
34
+ # The output and exit code of Python code that Claude ran with the code execution
35
+ # tool, with standard output in encrypted form, sent back in a later request.
35
36
  #
36
37
  # @param content [Array<Anthropic::Models::Beta::BetaCodeExecutionOutputBlockParam>]
37
38
  # @param encrypted_stdout [String]
@@ -17,7 +17,11 @@ module Anthropic
17
17
 
18
18
  variant -> { Anthropic::Beta::BetaCodeExecutionTool20250825 }
19
19
 
20
- # Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
20
+ # A `tools` entry for the code execution tool, version `code_execution_20260120`. It adds REPL state persistence to version `code_execution_20250825`.
21
+ #
22
+ # REPL state persistence applies with programmatic tool calling. With it, the Python interpreter state, such as variable bindings, persists across requests that reuse the container.
23
+ #
24
+ # See the [code execution tool guide](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool#tool-versions) to learn what each tool version adds.
21
25
  variant -> { Anthropic::Beta::BetaCodeExecutionTool20260120 }
22
26
 
23
27
  # Code execution tool with REPL state persistence.
@@ -23,7 +23,7 @@ module Anthropic
23
23
  optional :version, String
24
24
 
25
25
  # @!method initialize(skill_id:, type:, version: nil)
26
- # Specification for a skill to be loaded in a container (request model).
26
+ # Specification for a skill to be loaded in a container.
27
27
  #
28
28
  # @param skill_id [String] Skill ID
29
29
  #
@@ -16,7 +16,11 @@ module Anthropic
16
16
 
17
17
  variant -> { Anthropic::Beta::BetaCodeExecutionTool20250825 }
18
18
 
19
- # Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
19
+ # A `tools` entry for the code execution tool, version `code_execution_20260120`. It adds REPL state persistence to version `code_execution_20250825`.
20
+ #
21
+ # REPL state persistence applies with programmatic tool calling. With it, the Python interpreter state, such as variable bindings, persists across requests that reuse the container.
22
+ #
23
+ # See the [code execution tool guide](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool#tool-versions) to learn what each tool version adds.
20
24
  variant -> { Anthropic::Beta::BetaCodeExecutionTool20260120 }
21
25
 
22
26
  # Code execution tool with REPL state persistence.
@@ -7,7 +7,8 @@ module Anthropic
7
7
  # @see Anthropic::Resources::Beta::Environments::Work#heartbeat
8
8
  class BetaSelfHostedWorkHeartbeatResponse < Anthropic::Internal::Type::BaseModel
9
9
  # @!attribute last_heartbeat
10
- # RFC 3339 timestamp of the actual heartbeat from DB
10
+ # RFC 3339 timestamp of the most recent heartbeat recorded for this work item, or
11
+ # an empty string if none has been recorded
11
12
  #
12
13
  # @return [String]
13
14
  required :last_heartbeat, String
@@ -39,7 +40,11 @@ module Anthropic
39
40
  # @!method initialize(last_heartbeat:, lease_extended:, state:, ttl_seconds:, type: :work_heartbeat)
40
41
  # Response after recording a heartbeat for a work item.
41
42
  #
42
- # @param last_heartbeat [String] RFC 3339 timestamp of the actual heartbeat from DB
43
+ # Some parameter documentations has been truncated, see
44
+ # {Anthropic::Models::Beta::Environments::BetaSelfHostedWorkHeartbeatResponse} for
45
+ # more details.
46
+ #
47
+ # @param last_heartbeat [String] RFC 3339 timestamp of the most recent heartbeat recorded for this work item, or
43
48
  #
44
49
  # @param lease_extended [Boolean] Whether the heartbeat succeeded in extending the lease
45
50
  #
@@ -7,7 +7,7 @@ module Anthropic
7
7
  # @see Anthropic::Resources::Beta::Environments::Work#stats
8
8
  class BetaSelfHostedWorkQueueStats < Anthropic::Internal::Type::BaseModel
9
9
  # @!attribute depth
10
- # Number of work items waiting to be picked up (lag from consumer group)
10
+ # Number of work items waiting to be picked up
11
11
  #
12
12
  # @return [Integer]
13
13
  required :depth, Integer
@@ -41,13 +41,11 @@ module Anthropic
41
41
  # @!method initialize(depth:, oldest_queued_at:, pending:, workers_polling:, type: :work_queue_stats)
42
42
  # Statistics about the work queue for an environment.
43
43
  #
44
- # Uses Redis Stream consumer group metrics for O(1) queries.
45
- #
46
44
  # Some parameter documentations has been truncated, see
47
45
  # {Anthropic::Models::Beta::Environments::BetaSelfHostedWorkQueueStats} for more
48
46
  # details.
49
47
  #
50
- # @param depth [Integer] Number of work items waiting to be picked up (lag from consumer group)
48
+ # @param depth [Integer] Number of work items waiting to be picked up
51
49
  #
52
50
  # @param oldest_queued_at [String, nil] RFC 3339 timestamp of oldest item in the work stream (includes both queued and p
53
51
  #
@@ -386,7 +386,11 @@ module Anthropic
386
386
 
387
387
  variant -> { Anthropic::Beta::BetaCodeExecutionTool20250825 }
388
388
 
389
- # Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).
389
+ # A `tools` entry for the code execution tool, version `code_execution_20260120`. It adds REPL state persistence to version `code_execution_20250825`.
390
+ #
391
+ # REPL state persistence applies with programmatic tool calling. With it, the Python interpreter state, such as variable bindings, persists across requests that reuse the container.
392
+ #
393
+ # See the [code execution tool guide](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool#tool-versions) to learn what each tool version adds.
390
394
  variant -> { Anthropic::Beta::BetaCodeExecutionTool20260120 }
391
395
 
392
396
  # Code execution tool with REPL state persistence.
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ module Organization
7
+ class BetaClaudeTagDefaultSettingSource < Anthropic::Internal::Type::BaseModel
8
+ # @!attribute type
9
+ #
10
+ # @return [Symbol, :default]
11
+ required :type, const: :default
12
+
13
+ # @!method initialize(type: :default)
14
+ # No settings level sets a value, and the built-in default applies.
15
+ #
16
+ # @param type [Symbol, :default]
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,63 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ module Organization
7
+ # What Claude does in a channel while a Slack guest is in it, for everyone in the
8
+ # channel. It changes nothing in a channel without Slack guests. More types can be
9
+ # added.
10
+ module BetaClaudeTagGuestPolicy
11
+ extend Anthropic::Internal::Type::Union
12
+
13
+ discriminator :type
14
+
15
+ # Claude answers in the channel.
16
+ variant :allow, -> { Anthropic::Beta::Organization::BetaClaudeTagGuestPolicyAllow }
17
+
18
+ # Claude does not answer in the channel.
19
+ variant :restrict, -> { Anthropic::Beta::Organization::BetaClaudeTagGuestPolicyRestrict }
20
+
21
+ # Claude answers with only the Bundles attached to the channel itself.
22
+ variant :channel_only, -> { Anthropic::Beta::Organization::BetaClaudeTagGuestPolicyChannelOnly }
23
+
24
+ module Type
25
+ extend Anthropic::Internal::Type::Enum
26
+
27
+ ALLOW = :allow
28
+ RESTRICT = :restrict
29
+ CHANNEL_ONLY = :channel_only
30
+
31
+ # @!method self.values
32
+ # @return [Array<Symbol>]
33
+ end
34
+
35
+ # @!method self.variants
36
+ # @return [Array(Anthropic::Models::Beta::Organization::BetaClaudeTagGuestPolicyAllow, Anthropic::Models::Beta::Organization::BetaClaudeTagGuestPolicyRestrict, Anthropic::Models::Beta::Organization::BetaClaudeTagGuestPolicyChannelOnly)]
37
+
38
+ # Creates a new instance of the variant class whose `type` matches the given
39
+ # value, passing the remaining arguments to its constructor.
40
+ #
41
+ # @param type [Symbol, Anthropic::Models::Beta::Organization::BetaClaudeTagGuestPolicy::Type, String]
42
+ #
43
+ # @param args [Hash{Symbol=>Object}] Attributes for the chosen variant.
44
+ #
45
+ # @raise [ArgumentError]
46
+ # @return [Anthropic::Models::Beta::Organization::BetaClaudeTagGuestPolicyAllow, Anthropic::Models::Beta::Organization::BetaClaudeTagGuestPolicyRestrict, Anthropic::Models::Beta::Organization::BetaClaudeTagGuestPolicyChannelOnly]
47
+ def self.new(type:, **args)
48
+ case type.to_sym
49
+ when :allow
50
+ Anthropic::Beta::Organization::BetaClaudeTagGuestPolicyAllow.new(**args)
51
+ when :restrict
52
+ Anthropic::Beta::Organization::BetaClaudeTagGuestPolicyRestrict.new(**args)
53
+ when :channel_only
54
+ Anthropic::Beta::Organization::BetaClaudeTagGuestPolicyChannelOnly.new(**args)
55
+ else
56
+ raise ArgumentError, "unknown type: #{type}"
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end