anthropic 2.7.0 → 2.8.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 (76) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +26 -0
  3. data/README.md +1 -1
  4. data/lib/anthropic/helpers/bedrock/client.rb +17 -5
  5. data/lib/anthropic/helpers/google_cloud/client.rb +4 -1
  6. data/lib/anthropic/helpers/vertex/client.rb +26 -12
  7. data/lib/anthropic/models/beta/beta_managed_agents_model.rb +1 -1
  8. data/lib/anthropic/models/beta/organization/beta_analytics_claude_tag_metrics.rb +42 -0
  9. data/lib/anthropic/models/beta/organization/beta_analytics_single_day_activity_summary.rb +43 -1
  10. data/lib/anthropic/models/beta/organization/beta_analytics_user_activity.rb +14 -1
  11. data/lib/anthropic/models/beta/organization/beta_claude_tag_reply_mode.rb +68 -0
  12. data/lib/anthropic/models/beta/organization/beta_claude_tag_reply_mode_always_awake.rb +22 -0
  13. data/lib/anthropic/models/beta/organization/beta_claude_tag_reply_mode_automatic.rb +22 -0
  14. data/lib/anthropic/models/beta/organization/beta_claude_tag_reply_mode_mention_only.rb +21 -0
  15. data/lib/anthropic/models/beta/organization/beta_claude_tag_reply_mode_thread.rb +23 -0
  16. data/lib/anthropic/models/beta/organization/beta_claude_tag_setting_sources.rb +14 -1
  17. data/lib/anthropic/models/beta/organization/beta_claude_tag_settings.rb +20 -3
  18. data/lib/anthropic/models/beta/organization/beta_claude_tag_settings_create.rb +22 -2
  19. data/lib/anthropic/models/beta/organization/beta_claude_tag_settings_update.rb +22 -2
  20. data/lib/anthropic/models/beta/organization/beta_rbac_role.rb +4 -4
  21. data/lib/anthropic/models/beta/organization/external_key_create_params.rb +7 -5
  22. data/lib/anthropic/models/model.rb +2 -2
  23. data/lib/anthropic/models/organization/analytics_claude_tag_metrics.rb +39 -0
  24. data/lib/anthropic/models/organization/analytics_single_day_activity_summary.rb +43 -1
  25. data/lib/anthropic/models/organization/analytics_user_activity.rb +12 -1
  26. data/lib/anthropic/models/organization/external_key_create_params.rb +7 -5
  27. data/lib/anthropic/models/organization/rbac_role.rb +4 -4
  28. data/lib/anthropic/resources/beta/organization/external_keys.rb +1 -1
  29. data/lib/anthropic/resources/beta/organization/plugins/versions.rb +4 -5
  30. data/lib/anthropic/resources/beta/organization/plugins.rb +13 -12
  31. data/lib/anthropic/resources/organization/external_keys.rb +1 -1
  32. data/lib/anthropic/version.rb +1 -1
  33. data/lib/anthropic.rb +7 -0
  34. data/rbi/anthropic/models/beta/beta_managed_agents_model.rbi +1 -1
  35. data/rbi/anthropic/models/beta/organization/beta_analytics_claude_tag_metrics.rbi +69 -0
  36. data/rbi/anthropic/models/beta/organization/beta_analytics_single_day_activity_summary.rbi +60 -0
  37. data/rbi/anthropic/models/beta/organization/beta_analytics_user_activity.rbi +36 -0
  38. data/rbi/anthropic/models/beta/organization/beta_claude_tag_reply_mode.rbi +92 -0
  39. data/rbi/anthropic/models/beta/organization/beta_claude_tag_reply_mode_always_awake.rbi +32 -0
  40. data/rbi/anthropic/models/beta/organization/beta_claude_tag_reply_mode_automatic.rbi +32 -0
  41. data/rbi/anthropic/models/beta/organization/beta_claude_tag_reply_mode_mention_only.rbi +31 -0
  42. data/rbi/anthropic/models/beta/organization/beta_claude_tag_reply_mode_thread.rbi +33 -0
  43. data/rbi/anthropic/models/beta/organization/beta_claude_tag_setting_sources.rbi +30 -1
  44. data/rbi/anthropic/models/beta/organization/beta_claude_tag_settings.rbi +39 -5
  45. data/rbi/anthropic/models/beta/organization/beta_claude_tag_settings_create.rbi +56 -5
  46. data/rbi/anthropic/models/beta/organization/beta_claude_tag_settings_update.rbi +56 -5
  47. data/rbi/anthropic/models/beta/organization/beta_rbac_role.rbi +6 -6
  48. data/rbi/anthropic/models/beta/organization/external_key_create_params.rbi +12 -8
  49. data/rbi/anthropic/models/model.rbi +2 -2
  50. data/rbi/anthropic/models/organization/analytics_claude_tag_metrics.rbi +67 -0
  51. data/rbi/anthropic/models/organization/analytics_single_day_activity_summary.rbi +60 -0
  52. data/rbi/anthropic/models/organization/analytics_user_activity.rbi +30 -0
  53. data/rbi/anthropic/models/organization/external_key_create_params.rbi +12 -8
  54. data/rbi/anthropic/models/organization/rbac_role.rbi +6 -6
  55. data/rbi/anthropic/resources/beta/organization/external_keys.rbi +6 -4
  56. data/rbi/anthropic/resources/beta/organization/plugins/versions.rbi +4 -5
  57. data/rbi/anthropic/resources/beta/organization/plugins.rbi +13 -12
  58. data/rbi/anthropic/resources/organization/external_keys.rbi +6 -4
  59. data/sig/anthropic/models/beta/beta_managed_agents_model.rbs +1 -1
  60. data/sig/anthropic/models/beta/organization/beta_analytics_claude_tag_metrics.rbs +26 -0
  61. data/sig/anthropic/models/beta/organization/beta_analytics_single_day_activity_summary.rbs +15 -0
  62. data/sig/anthropic/models/beta/organization/beta_analytics_user_activity.rbs +5 -0
  63. data/sig/anthropic/models/beta/organization/beta_claude_tag_reply_mode.rbs +50 -0
  64. data/sig/anthropic/models/beta/organization/beta_claude_tag_reply_mode_always_awake.rbs +17 -0
  65. data/sig/anthropic/models/beta/organization/beta_claude_tag_reply_mode_automatic.rbs +17 -0
  66. data/sig/anthropic/models/beta/organization/beta_claude_tag_reply_mode_mention_only.rbs +17 -0
  67. data/sig/anthropic/models/beta/organization/beta_claude_tag_reply_mode_thread.rbs +17 -0
  68. data/sig/anthropic/models/beta/organization/beta_claude_tag_setting_sources.rbs +8 -3
  69. data/sig/anthropic/models/beta/organization/beta_claude_tag_settings.rbs +8 -3
  70. data/sig/anthropic/models/beta/organization/beta_claude_tag_settings_create.rbs +8 -3
  71. data/sig/anthropic/models/beta/organization/beta_claude_tag_settings_update.rbs +8 -3
  72. data/sig/anthropic/models/model.rbs +2 -2
  73. data/sig/anthropic/models/organization/analytics_claude_tag_metrics.rbs +24 -0
  74. data/sig/anthropic/models/organization/analytics_single_day_activity_summary.rbs +15 -0
  75. data/sig/anthropic/models/organization/analytics_user_activity.rbs +5 -0
  76. metadata +23 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54ef03d29e550a2287be7f5d3d83f0a229857a843e3220e4485f97445ff813b9
4
- data.tar.gz: 2f7039bd59e9cbf3358db6d24c41a509109074a738b637b795c6558114f526aa
3
+ metadata.gz: 83c9d252df7e02ee1d255e4b2f699fc7b9504bd3c067dd489aafc2f1130516be
4
+ data.tar.gz: 46b7ab28a6ec3b7452db9de88777224f507337f44d530d2f5bc8055e98c646de
5
5
  SHA512:
6
- metadata.gz: 4cc2ec4d5b03726822d6839e90d180047677c00048e8b8b4ead51caf1a56fe022fa50cfc891501e2c6779695210e634be1fb7dc95682d32f9e04762c8151c1aa
7
- data.tar.gz: 733b18723947987a223b28de2b43ff9e6c7a2c45465716c36dca1d6951e4ed3686dfcf47b8da67ae601043cd126d768d34e0ee4e1581ae658e422bccb069d92d
6
+ metadata.gz: 84446ba2ccbec41779facc177524d757c32f61d2b61476bcdd21fe1c38d70d72e6aeeee49bb9785f7a1ec3cc1995bcd201da5b5a57e4d12824d873776ef833c5
7
+ data.tar.gz: fc6d612572bfe04080e9cff135265857ae92ffafe6fa2432d16ef9c8772c95618d0e78db364bc7f464cdae12b8c43ab80b76713a81e8e9cd8bc6e0af42433e79
data/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.8.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v2.7.0...v2.8.0) (2026-11-10)
4
+
5
+ ### Features
6
+
7
+ * **api:** add Claude Tag metrics to the analytics summaries and users reports
8
+ * **api:** add reply_mode to Claude Tag Slack channel settings
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **bedrock:** raise `ArgumentError` before sending when the model is empty, `"."` or `".."` before its `;` parameters, such as `";x"` or `"..;x"`, which some servers and proxies read as the empty or dot segment
14
+ * **bedrock:** raise `ArgumentError` before sending when the model is empty, `"."` or `".."`, which would send the request to a different URL, and send the model ID's `:` as it is in the request path rather than as `%3A`
15
+ * **google-cloud:** percent-encode the project, location and workspace ID in the derived base URL, so a `/` in one no longer adds path segments, and raise `ArgumentError` when one is empty, `"."` or `".."`
16
+ * **vertex:** percent-encode the project ID, region and model in the request path, so a `/` in one no longer adds path segments, and raise `ArgumentError` before sending when the project ID or region is `"."` or `".."`
17
+ * **vertex:** raise `ArgumentError` before sending when the model is empty, missing or only `;` parameters, such as `";x"`, rather than sending the request to `.../models/:rawPredict`, and when it is `"."` or `".."` followed by `;` parameters, such as `"..;x"`, which some servers and proxies read as the dot segment
18
+ * **vertex:** send a `;` in the model as `%3B` in the request path, so a server or proxy that drops `;` and the rest of a path segment no longer drops `:rawPredict` or `:streamRawPredict` with it
19
+
20
+
21
+ ### Chores
22
+
23
+ * **docs:** clarify display_name for RBAC Roles created by Anthropic
24
+ * **docs:** clarify plugin delete and skill name conflict descriptions
25
+ * **docs:** clarify when to omit user_profile_id on external keys
26
+ * **docs:** note that Claude Tag settings accept self-hosted runner pools
27
+ * **docs:** update model descriptions
28
+
3
29
  ## [2.7.0](https://github.com/anthropics/anthropic-sdk-ruby/compare/v2.6.0...v2.7.0) (2026-11-09)
4
30
 
5
31
  ### 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.7.0"
18
+ gem "anthropic", "~> 2.8.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
@@ -357,14 +357,26 @@ module Anthropic
357
357
 
358
358
  return req.with(body: body) unless req.method == :post && messages_route
359
359
 
360
- model = URI.encode_www_form_component(body.delete(:model).to_s)
360
+ model = Anthropic::Internal::Util.encode_path(body.delete(:model).to_s)
361
361
  stream = body.delete(:stream) || false
362
+ invoke_path = stream ? "model/#{model}/invoke-with-response-stream" : "model/#{model}/invoke"
363
+ # Servers and proxies collapse an empty segment and resolve a dot segment,
364
+ # some of them after dropping the segment's `;` parameters.
365
+ problem =
366
+ if model.empty? || model.start_with?(";")
367
+ "an empty path parameter"
368
+ elsif model == "." || model == ".." || model.start_with?(".;", "..;")
369
+ "the dot segment #{model.inspect}"
370
+ end
371
+ if problem
372
+ raise ArgumentError.new(
373
+ "The request was not sent: path #{invoke_path.inspect} has #{problem}, " \
374
+ "which would send it to a different URL"
375
+ )
376
+ end
362
377
 
363
378
  url = req.url.dup
364
- url.path = path.sub(
365
- %r{v1/messages\z},
366
- stream ? "model/#{model}/invoke-with-response-stream" : "model/#{model}/invoke"
367
- )
379
+ url.path = path.sub(%r{v1/messages\z}, invoke_path)
368
380
  url.query = nil
369
381
 
370
382
  req.with(body: body, url: url)
@@ -301,7 +301,10 @@ module Anthropic
301
301
  "application default credentials with a project."
302
302
  )
303
303
  end
304
- format(template, project: @project, location: @location, workspace_id: @workspace_id)
304
+ segments = {project: @project, location: @location, workspace_id: @workspace_id}.transform_values do
305
+ _1 && Anthropic::Internal::Util.interpolate_path(["%1$s", _1])
306
+ end
307
+ format(template, **segments)
305
308
  end
306
309
 
307
310
  # @api private
@@ -279,26 +279,40 @@ module Anthropic
279
279
  end
280
280
  end
281
281
 
282
+ models_path = -> do
283
+ Anthropic::Internal::Util.interpolate_path(
284
+ ["projects/%1$s/locations/%2$s/publishers/anthropic/models", @project_id, region]
285
+ )
286
+ end
287
+
282
288
  if req.method == :post && query_ok && path.end_with?("/v1/messages")
283
289
  unless body.is_a?(Hash)
284
290
  raise ArgumentError.new("Expected json data to be a hash for post /v1/messages")
285
291
  end
286
292
 
287
- model = body.delete(:model)
293
+ model = Anthropic::Internal::Util.encode_path(body.delete(:model).to_s)
288
294
  specifier = body[:stream] ? "streamRawPredict" : "rawPredict"
295
+ predict_path = ->(name) { "#{models_path.call}/#{name}:#{specifier}" }
296
+ # With its `:specifier` a model of `..` is not a dot segment. Some servers and proxies
297
+ # drop a segment's `;` parameters, though, and here the specifier goes with them.
298
+ problem =
299
+ if model.empty? || model.start_with?(";")
300
+ "an empty path parameter"
301
+ elsif model.start_with?(".;", "..;")
302
+ "the dot segment #{model.inspect}"
303
+ end
304
+ if problem
305
+ raise ArgumentError.new(
306
+ "The request was not sent: path #{predict_path.call(model).inspect} has #{problem}, " \
307
+ "which would send it to a different URL"
308
+ )
309
+ end
289
310
 
290
- url = rewrite_path(
291
- url,
292
- %r{v1/messages\z},
293
- "projects/#{@project_id}/locations/#{region}/publishers/anthropic/models/#{model}:#{specifier}"
294
- )
311
+ # A server that drops `;` and the rest of a segment would drop the specifier too.
312
+ url = rewrite_path(url, %r{v1/messages\z}, predict_path.call(model.gsub(";", "%3B")))
295
313
  elsif req.method == :post && query_ok && path.end_with?("/v1/messages/count_tokens")
296
- url = rewrite_path(
297
- url,
298
- %r{v1/messages/count_tokens\z},
299
- "projects/#{@project_id}/locations/#{region}/publishers/anthropic/" \
300
- "models/count-tokens:rawPredict"
301
- )
314
+ count_tokens_path = "#{models_path.call}/count-tokens:rawPredict"
315
+ url = rewrite_path(url, %r{v1/messages/count_tokens\z}, count_tokens_path)
302
316
  end
303
317
 
304
318
  return req if body.equal?(req.body) && headers.equal?(req.headers) && url.equal?(req.url)
@@ -57,7 +57,7 @@ module Anthropic
57
57
 
58
58
  # @!group
59
59
 
60
- # Frontier intelligence for ambitious work in coding, enterprise workflows, and the sciences
60
+ # Built for the most ambitious work in coding, enterprise workflows, and the sciences
61
61
  CLAUDE_FABLE_5_2 = :"claude-fable-5-2"
62
62
 
63
63
  # Fastest model for high-volume, real-time tasks
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ module Organization
7
+ class BetaAnalyticsClaudeTagMetrics < Anthropic::Internal::Type::BaseModel
8
+ # @!attribute active_day_count
9
+ # 1 on a day the user was active in Claude Tag in Slack, otherwise 0. Summed over
10
+ # the window in date-range mode, so it is the number of active days; on grouped
11
+ # rows, the total of each member's active days. Null when Claude Tag data cannot
12
+ # be read for the request. Otherwise, 0 on a row filtered by project, and null on
13
+ # any other row when no covered day was measured.
14
+ #
15
+ # @return [Integer, nil]
16
+ required :active_day_count, Integer, nil?: true
17
+
18
+ # @!attribute active_message_count
19
+ # Number of the user's Slack messages that made them active: @-mentions, direct
20
+ # messages, group direct message asks, and thread posts Claude answered. Other
21
+ # messages are not counted. Null when Claude Tag data cannot be read for the
22
+ # request. Otherwise, 0 on a row filtered by project, and null on any other row
23
+ # when no covered day was measured.
24
+ #
25
+ # @return [Integer, nil]
26
+ required :active_message_count, Integer, nil?: true
27
+
28
+ # @!method initialize(active_day_count:, active_message_count:)
29
+ # Claude Tag activity metrics for a single linked user on a given day.
30
+ #
31
+ # Some parameter documentations has been truncated, see
32
+ # {Anthropic::Models::Beta::Organization::BetaAnalyticsClaudeTagMetrics} for more
33
+ # details.
34
+ #
35
+ # @param active_day_count [Integer, nil] 1 on a day the user was active in Claude Tag in Slack, otherwise 0. Summed over
36
+ #
37
+ # @param active_message_count [Integer, nil] Number of the user's Slack messages that made them active: @-mentions, direct me
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -187,6 +187,42 @@ module Anthropic
187
187
  # @return [Integer, nil]
188
188
  optional :claude_design_weekly_active_user_count, Integer, nil?: true
189
189
 
190
+ # @!attribute claude_tag_daily_active_user_count
191
+ # Number of Slack users active in Claude Tag on the requested day. Counts distinct
192
+ # Slack users, including users who have not linked a Claude account, so it can
193
+ # exceed `daily_active_user_count` and `assigned_seat_count`. Null on a day with
194
+ # no measured value, when Claude Tag data cannot be read for the request, and when
195
+ # the response is scoped to an RBAC group, because an unlinked user belongs to no
196
+ # group. Omitted from the response on deployments that do not offer Claude Tag
197
+ # reporting.
198
+ #
199
+ # @return [Integer, nil]
200
+ optional :claude_tag_daily_active_user_count, Integer, nil?: true
201
+
202
+ # @!attribute claude_tag_monthly_active_user_count
203
+ # Number of Slack users active in Claude Tag in the 28-day rolling window. Counts
204
+ # distinct Slack users, including users who have not linked a Claude account, so
205
+ # it can exceed `daily_active_user_count` and `assigned_seat_count`. Null on a day
206
+ # with no measured value, when Claude Tag data cannot be read for the request, and
207
+ # when the response is scoped to an RBAC group, because an unlinked user belongs
208
+ # to no group. Omitted from the response on deployments that do not offer Claude
209
+ # Tag reporting.
210
+ #
211
+ # @return [Integer, nil]
212
+ optional :claude_tag_monthly_active_user_count, Integer, nil?: true
213
+
214
+ # @!attribute claude_tag_weekly_active_user_count
215
+ # Number of Slack users active in Claude Tag in the 7-day rolling window. Counts
216
+ # distinct Slack users, including users who have not linked a Claude account, so
217
+ # it can exceed `daily_active_user_count` and `assigned_seat_count`. Null on a day
218
+ # with no measured value, when Claude Tag data cannot be read for the request, and
219
+ # when the response is scoped to an RBAC group, because an unlinked user belongs
220
+ # to no group. Omitted from the response on deployments that do not offer Claude
221
+ # Tag reporting.
222
+ #
223
+ # @return [Integer, nil]
224
+ optional :claude_tag_weekly_active_user_count, Integer, nil?: true
225
+
190
226
  # @!attribute office_agent_daily_active_user_count
191
227
  # Number of users with Claude in Office activity on the requested day. Omitted
192
228
  # from the response while the per-product breakdown is not enabled for this
@@ -245,7 +281,7 @@ module Anthropic
245
281
  # @return [Integer, nil]
246
282
  optional :science_weekly_active_user_count, Integer, nil?: true
247
283
 
248
- # @!method initialize(assigned_seat_count:, cowork_daily_active_user_count:, cowork_monthly_active_user_count:, cowork_weekly_active_user_count:, daily_active_user_count:, daily_adoption_rate:, ending_at:, monthly_active_user_count:, monthly_adoption_rate:, pending_invite_count:, starting_at:, weekly_active_user_count:, weekly_adoption_rate:, chat_cowork_unified_daily_active_user_count: nil, chat_cowork_unified_monthly_active_user_count: nil, chat_cowork_unified_weekly_active_user_count: nil, chat_daily_active_user_count: nil, chat_monthly_active_user_count: nil, chat_weekly_active_user_count: nil, claude_code_daily_active_user_count: nil, claude_code_monthly_active_user_count: nil, claude_code_weekly_active_user_count: nil, claude_design_daily_active_user_count: nil, claude_design_monthly_active_user_count: nil, claude_design_weekly_active_user_count: nil, office_agent_daily_active_user_count: nil, office_agent_monthly_active_user_count: nil, office_agent_weekly_active_user_count: nil, science_daily_active_user_count: nil, science_entitled_user_count: nil, science_monthly_active_user_count: nil, science_weekly_active_user_count: nil)
284
+ # @!method initialize(assigned_seat_count:, cowork_daily_active_user_count:, cowork_monthly_active_user_count:, cowork_weekly_active_user_count:, daily_active_user_count:, daily_adoption_rate:, ending_at:, monthly_active_user_count:, monthly_adoption_rate:, pending_invite_count:, starting_at:, weekly_active_user_count:, weekly_adoption_rate:, chat_cowork_unified_daily_active_user_count: nil, chat_cowork_unified_monthly_active_user_count: nil, chat_cowork_unified_weekly_active_user_count: nil, chat_daily_active_user_count: nil, chat_monthly_active_user_count: nil, chat_weekly_active_user_count: nil, claude_code_daily_active_user_count: nil, claude_code_monthly_active_user_count: nil, claude_code_weekly_active_user_count: nil, claude_design_daily_active_user_count: nil, claude_design_monthly_active_user_count: nil, claude_design_weekly_active_user_count: nil, claude_tag_daily_active_user_count: nil, claude_tag_monthly_active_user_count: nil, claude_tag_weekly_active_user_count: nil, office_agent_daily_active_user_count: nil, office_agent_monthly_active_user_count: nil, office_agent_weekly_active_user_count: nil, science_daily_active_user_count: nil, science_entitled_user_count: nil, science_monthly_active_user_count: nil, science_weekly_active_user_count: nil)
249
285
  # Per-day entry in the /summaries response.
250
286
  #
251
287
  # Some parameter documentations has been truncated, see
@@ -302,6 +338,12 @@ module Anthropic
302
338
  #
303
339
  # @param claude_design_weekly_active_user_count [Integer, nil] Number of users with Claude Design activity in the 7-day rolling window. Omitted
304
340
  #
341
+ # @param claude_tag_daily_active_user_count [Integer, nil] Number of Slack users active in Claude Tag on the requested day. Counts distinct
342
+ #
343
+ # @param claude_tag_monthly_active_user_count [Integer, nil] Number of Slack users active in Claude Tag in the 28-day rolling window. Counts
344
+ #
345
+ # @param claude_tag_weekly_active_user_count [Integer, nil] Number of Slack users active in Claude Tag in the 7-day rolling window. Counts d
346
+ #
305
347
  # @param office_agent_daily_active_user_count [Integer, nil] Number of users with Claude in Office activity on the requested day. Omitted fro
306
348
  #
307
349
  # @param office_agent_monthly_active_user_count [Integer, nil] Number of users with Claude in Office activity in the 30-day rolling window. Omi
@@ -74,6 +74,17 @@ module Anthropic
74
74
  -> { Anthropic::Beta::Organization::BetaAnalyticsChatCoworkUnifiedMetrics },
75
75
  nil?: true
76
76
 
77
+ # @!attribute claude_tag_metrics
78
+ # Claude Tag activity in Slack by a user who has linked a Claude account. Activity
79
+ # by Slack users who have not linked an account appears only in the `/summaries`
80
+ # Claude Tag counts, so these rows do not add up to those counts. Omitted from the
81
+ # response on deployments that do not offer Claude Tag reporting.
82
+ #
83
+ # @return [Anthropic::Models::Beta::Organization::BetaAnalyticsClaudeTagMetrics, nil]
84
+ optional :claude_tag_metrics,
85
+ -> { Anthropic::Beta::Organization::BetaAnalyticsClaudeTagMetrics },
86
+ nil?: true
87
+
77
88
  # @!attribute last_activity_date
78
89
  # Most recent UTC day (YYYY-MM-DD) on which the user had any counted activity,
79
90
  # within the requested window: equal to the requested `date` in single-day mode,
@@ -104,7 +115,7 @@ module Anthropic
104
115
  # @return [String, nil]
105
116
  optional :rbac_group_name, String, nil?: true
106
117
 
107
- # @!method initialize(chat_metrics:, claude_code_metrics:, cowork_metrics:, design_metrics:, distinct_user_count:, office_metrics:, science_metrics:, user:, web_search_count:, chat_cowork_unified_metrics: nil, last_activity_date: nil, rbac_group_id: nil, rbac_group_name: nil)
118
+ # @!method initialize(chat_metrics:, claude_code_metrics:, cowork_metrics:, design_metrics:, distinct_user_count:, office_metrics:, science_metrics:, user:, web_search_count:, chat_cowork_unified_metrics: nil, claude_tag_metrics: nil, last_activity_date: nil, rbac_group_id: nil, rbac_group_name: nil)
108
119
  # Per-user activity data for a given day.
109
120
  #
110
121
  # Some parameter documentations has been truncated, see
@@ -131,6 +142,8 @@ module Anthropic
131
142
  #
132
143
  # @param chat_cowork_unified_metrics [Anthropic::Models::Beta::Organization::BetaAnalyticsChatCoworkUnifiedMetrics, nil] Activity recorded while the member had Chat and Cowork unified (Cowork's feature
133
144
  #
145
+ # @param claude_tag_metrics [Anthropic::Models::Beta::Organization::BetaAnalyticsClaudeTagMetrics, nil] Claude Tag activity in Slack by a user who has linked a Claude account. Activity
146
+ #
134
147
  # @param last_activity_date [Date, nil] Most recent UTC day (YYYY-MM-DD) on which the user had any counted activity, wit
135
148
  #
136
149
  # @param rbac_group_id [String, nil] Tagged RBAC group identifier (`rbac_group_...`), matching the spend-limits API s
@@ -0,0 +1,68 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ module Organization
7
+ # How Claude takes part in a Slack channel. A channel alone stores one. More types
8
+ # can be added.
9
+ module BetaClaudeTagReplyMode
10
+ extend Anthropic::Internal::Type::Union
11
+
12
+ discriminator :type
13
+
14
+ # Claude reads along and joins in when it can help, and pauses on its own in quiet or busy channels.
15
+ variant :automatic, -> { Anthropic::Beta::Organization::BetaClaudeTagReplyModeAutomatic }
16
+
17
+ # Claude replies only when it is @-mentioned.
18
+ variant :mention_only, -> { Anthropic::Beta::Organization::BetaClaudeTagReplyModeMentionOnly }
19
+
20
+ # Like `automatic`, but Claude never pauses on its own. Available where it is enabled for the channel.
21
+ variant :always_awake, -> { Anthropic::Beta::Organization::BetaClaudeTagReplyModeAlwaysAwake }
22
+
23
+ # Every new top-level message in the channel gets its own reply from Claude, in a thread under it. Available where it is enabled for the channel, and only once Claude has been used in the channel.
24
+ variant :thread, -> { Anthropic::Beta::Organization::BetaClaudeTagReplyModeThread }
25
+
26
+ module Type
27
+ extend Anthropic::Internal::Type::Enum
28
+
29
+ AUTOMATIC = :automatic
30
+ MENTION_ONLY = :mention_only
31
+ ALWAYS_AWAKE = :always_awake
32
+ THREAD = :thread
33
+
34
+ # @!method self.values
35
+ # @return [Array<Symbol>]
36
+ end
37
+
38
+ # @!method self.variants
39
+ # @return [Array(Anthropic::Models::Beta::Organization::BetaClaudeTagReplyModeAutomatic, Anthropic::Models::Beta::Organization::BetaClaudeTagReplyModeMentionOnly, Anthropic::Models::Beta::Organization::BetaClaudeTagReplyModeAlwaysAwake, Anthropic::Models::Beta::Organization::BetaClaudeTagReplyModeThread)]
40
+
41
+ # Creates a new instance of the variant class whose `type` matches the given
42
+ # value, passing the remaining arguments to its constructor.
43
+ #
44
+ # @param type [Symbol, Anthropic::Models::Beta::Organization::BetaClaudeTagReplyMode::Type, String]
45
+ #
46
+ # @param args [Hash{Symbol=>Object}] Attributes for the chosen variant.
47
+ #
48
+ # @raise [ArgumentError]
49
+ # @return [Anthropic::Models::Beta::Organization::BetaClaudeTagReplyModeAutomatic, Anthropic::Models::Beta::Organization::BetaClaudeTagReplyModeMentionOnly, Anthropic::Models::Beta::Organization::BetaClaudeTagReplyModeAlwaysAwake, Anthropic::Models::Beta::Organization::BetaClaudeTagReplyModeThread]
50
+ def self.new(type:, **args)
51
+ case type.to_sym
52
+ when :automatic
53
+ Anthropic::Beta::Organization::BetaClaudeTagReplyModeAutomatic.new(**args)
54
+ when :mention_only
55
+ Anthropic::Beta::Organization::BetaClaudeTagReplyModeMentionOnly.new(**args)
56
+ when :always_awake
57
+ Anthropic::Beta::Organization::BetaClaudeTagReplyModeAlwaysAwake.new(**args)
58
+ when :thread
59
+ Anthropic::Beta::Organization::BetaClaudeTagReplyModeThread.new(**args)
60
+ else
61
+ raise ArgumentError, "unknown type: #{type}"
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ module Organization
7
+ class BetaClaudeTagReplyModeAlwaysAwake < Anthropic::Internal::Type::BaseModel
8
+ # @!attribute type
9
+ #
10
+ # @return [Symbol, :always_awake]
11
+ required :type, const: :always_awake
12
+
13
+ # @!method initialize(type: :always_awake)
14
+ # Like `automatic`, but Claude never pauses on its own. Available where it is
15
+ # enabled for the channel.
16
+ #
17
+ # @param type [Symbol, :always_awake]
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ module Organization
7
+ class BetaClaudeTagReplyModeAutomatic < Anthropic::Internal::Type::BaseModel
8
+ # @!attribute type
9
+ #
10
+ # @return [Symbol, :automatic]
11
+ required :type, const: :automatic
12
+
13
+ # @!method initialize(type: :automatic)
14
+ # Claude reads along and joins in when it can help, and pauses on its own in quiet
15
+ # or busy channels.
16
+ #
17
+ # @param type [Symbol, :automatic]
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ module Organization
7
+ class BetaClaudeTagReplyModeMentionOnly < Anthropic::Internal::Type::BaseModel
8
+ # @!attribute type
9
+ #
10
+ # @return [Symbol, :mention_only]
11
+ required :type, const: :mention_only
12
+
13
+ # @!method initialize(type: :mention_only)
14
+ # Claude replies only when it is @-mentioned.
15
+ #
16
+ # @param type [Symbol, :mention_only]
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Anthropic
4
+ module Models
5
+ module Beta
6
+ module Organization
7
+ class BetaClaudeTagReplyModeThread < Anthropic::Internal::Type::BaseModel
8
+ # @!attribute type
9
+ #
10
+ # @return [Symbol, :thread]
11
+ required :type, const: :thread
12
+
13
+ # @!method initialize(type: :thread)
14
+ # Every new top-level message in the channel gets its own reply from Claude, in a
15
+ # thread under it. Available where it is enabled for the channel, and only once
16
+ # Claude has been used in the channel.
17
+ #
18
+ # @param type [Symbol, :thread]
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -45,7 +45,18 @@ module Anthropic
45
45
  # @return [Anthropic::Models::Beta::Organization::BetaClaudeTagSlackChannelSettingSource, Anthropic::Models::Beta::Organization::BetaClaudeTagSlackWorkspaceSettingSource, Anthropic::Models::Beta::Organization::BetaClaudeTagSlackParentChannelSettingSource, Anthropic::Models::Beta::Organization::BetaClaudeTagSlackDefaultSettingSource, Anthropic::Models::Beta::Organization::BetaClaudeTagDefaultSettingSource, Anthropic::Models::Beta::Organization::BetaClaudeTagSlackGridChannelSettingSource, nil]
46
46
  required :model, union: -> { Anthropic::Beta::Organization::BetaClaudeTagSettingSource }, nil?: true
47
47
 
48
- # @!method initialize(enabled:, environment_id:, guest_policy:, instructions:, model:)
48
+ # @!attribute reply_mode
49
+ # The settings level `reply_mode` comes from: the channel when it stores one. With
50
+ # `include_inherited=true` and no stored mode it is `default`.
51
+ #
52
+ # @return [Anthropic::Models::Beta::Organization::BetaClaudeTagSlackChannelSettingSource, Anthropic::Models::Beta::Organization::BetaClaudeTagSlackWorkspaceSettingSource, Anthropic::Models::Beta::Organization::BetaClaudeTagSlackParentChannelSettingSource, Anthropic::Models::Beta::Organization::BetaClaudeTagSlackDefaultSettingSource, Anthropic::Models::Beta::Organization::BetaClaudeTagDefaultSettingSource, Anthropic::Models::Beta::Organization::BetaClaudeTagSlackGridChannelSettingSource, nil]
53
+ required :reply_mode,
54
+ union: -> {
55
+ Anthropic::Beta::Organization::BetaClaudeTagSettingSource
56
+ },
57
+ nil?: true
58
+
59
+ # @!method initialize(enabled:, environment_id:, guest_policy:, instructions:, model:, reply_mode:)
49
60
  # For each setting, the settings level its value in `settings` comes from. Without
50
61
  # `include_inherited`, a setting the channel or workspace stores has a source that
51
62
  # names the channel or workspace itself, and one it does not store has null, or an
@@ -65,6 +76,8 @@ module Anthropic
65
76
  # @param instructions [Array<Anthropic::Models::Beta::Organization::BetaClaudeTagSlackChannelSettingSource, Anthropic::Models::Beta::Organization::BetaClaudeTagSlackWorkspaceSettingSource, Anthropic::Models::Beta::Organization::BetaClaudeTagSlackParentChannelSettingSource, Anthropic::Models::Beta::Organization::BetaClaudeTagSlackDefaultSettingSource, Anthropic::Models::Beta::Organization::BetaClaudeTagDefaultSettingSource, Anthropic::Models::Beta::Organization::BetaClaudeTagSlackGridChannelSettingSource>] Every settings level that contributes text to `instructions`, broadest first, in
66
77
  #
67
78
  # @param model [Anthropic::Models::Beta::Organization::BetaClaudeTagSlackChannelSettingSource, Anthropic::Models::Beta::Organization::BetaClaudeTagSlackWorkspaceSettingSource, Anthropic::Models::Beta::Organization::BetaClaudeTagSlackParentChannelSettingSource, Anthropic::Models::Beta::Organization::BetaClaudeTagSlackDefaultSettingSource, Anthropic::Models::Beta::Organization::BetaClaudeTagDefaultSettingSource, Anthropic::Models::Beta::Organization::BetaClaudeTagSlackGridChannelSettingSource, nil] The settings level `model` comes from.
79
+ #
80
+ # @param reply_mode [Anthropic::Models::Beta::Organization::BetaClaudeTagSlackChannelSettingSource, Anthropic::Models::Beta::Organization::BetaClaudeTagSlackWorkspaceSettingSource, Anthropic::Models::Beta::Organization::BetaClaudeTagSlackParentChannelSettingSource, Anthropic::Models::Beta::Organization::BetaClaudeTagSlackDefaultSettingSource, Anthropic::Models::Beta::Organization::BetaClaudeTagDefaultSettingSource, Anthropic::Models::Beta::Organization::BetaClaudeTagSlackGridChannelSettingSource, nil] The settings level `reply_mode` comes from: the channel when it stores one. With
68
81
  end
69
82
  end
70
83
  end
@@ -45,11 +45,26 @@ module Anthropic
45
45
  # @return [String, nil]
46
46
  required :model, String, nil?: true
47
47
 
48
- # @!method initialize(enabled:, environment_id:, guest_policy:, instructions:, model:)
48
+ # @!attribute reply_mode
49
+ # How Claude takes part in the channel. Only a channel stores one, and no settings
50
+ # level passes one on, so it is always null on a workspace. Null on a channel
51
+ # means the channel stores none yet: Claude then follows the reply mode chosen in
52
+ # Slack, if one was, else `automatic`. A stored reply mode can be changed but
53
+ # never cleared.
54
+ #
55
+ # @return [Anthropic::Models::Beta::Organization::BetaClaudeTagReplyModeAutomatic, Anthropic::Models::Beta::Organization::BetaClaudeTagReplyModeMentionOnly, Anthropic::Models::Beta::Organization::BetaClaudeTagReplyModeAlwaysAwake, Anthropic::Models::Beta::Organization::BetaClaudeTagReplyModeThread, nil]
56
+ required :reply_mode,
57
+ union: -> {
58
+ Anthropic::Beta::Organization::BetaClaudeTagReplyMode
59
+ },
60
+ nil?: true
61
+
62
+ # @!method initialize(enabled:, environment_id:, guest_policy:, instructions:, model:, reply_mode:)
49
63
  # Claude Tag settings. Without `include_inherited`, a setting that is null is not
50
64
  # set on the settings level and is inherited. With it, `enabled` and
51
- # `guest_policy` are never null, and `instructions`, `model` and `environment_id`
52
- # are null when no settings level sets them.
65
+ # `guest_policy` are never null, `instructions`, `model` and `environment_id` are
66
+ # null when no settings level sets them, and `reply_mode` is null unless the
67
+ # channel itself stores one.
53
68
  #
54
69
  # Some parameter documentations has been truncated, see
55
70
  # {Anthropic::Models::Beta::Organization::BetaClaudeTagSettings} for more details.
@@ -63,6 +78,8 @@ module Anthropic
63
78
  # @param instructions [String, nil] Instructions for Claude. Instructions add up: the text of every settings level t
64
79
  #
65
80
  # @param model [String, nil] The model Claude uses: a model identifier or the name of a model line. The neare
81
+ #
82
+ # @param reply_mode [Anthropic::Models::Beta::Organization::BetaClaudeTagReplyModeAutomatic, Anthropic::Models::Beta::Organization::BetaClaudeTagReplyModeMentionOnly, Anthropic::Models::Beta::Organization::BetaClaudeTagReplyModeAlwaysAwake, Anthropic::Models::Beta::Organization::BetaClaudeTagReplyModeThread, nil] How Claude takes part in the channel. Only a channel stores one, and no settings
66
83
  end
67
84
  end
68
85
  end
@@ -14,7 +14,9 @@ module Anthropic
14
14
 
15
15
  # @!attribute environment_id
16
16
  # The environment Claude's sessions run in: the identifier of an active
17
- # environment of the organization, starting with `env_`. Null clears it.
17
+ # environment of the organization, starting with `env_`, or of a self-hosted
18
+ # runner pool of the organization that every member may use, starting with
19
+ # `ccpool_`. Null clears it.
18
20
  #
19
21
  # @return [String, nil]
20
22
  optional :environment_id, String, nil?: true
@@ -43,7 +45,23 @@ module Anthropic
43
45
  # @return [String, nil]
44
46
  optional :model, String, nil?: true
45
47
 
46
- # @!method initialize(enabled: nil, environment_id: nil, guest_policy: nil, instructions: nil, model: nil)
48
+ # @!attribute reply_mode
49
+ # How Claude takes part in the channel: `automatic`, `mention_only`,
50
+ # `always_awake` or `thread`. Only a channel takes one: an update of a workspace
51
+ # that sends a value is refused, and one that sends null changes nothing. Null
52
+ # never clears it: sent to a channel that stores none it changes nothing, and sent
53
+ # to a channel that stores one it is refused, because a stored reply mode can be
54
+ # changed but never cleared; a caller that wants Claude's default behavior sends
55
+ # `automatic`.
56
+ #
57
+ # @return [Anthropic::Models::Beta::Organization::BetaClaudeTagReplyModeAutomatic, Anthropic::Models::Beta::Organization::BetaClaudeTagReplyModeMentionOnly, Anthropic::Models::Beta::Organization::BetaClaudeTagReplyModeAlwaysAwake, Anthropic::Models::Beta::Organization::BetaClaudeTagReplyModeThread, nil]
58
+ optional :reply_mode,
59
+ union: -> {
60
+ Anthropic::Beta::Organization::BetaClaudeTagReplyMode
61
+ },
62
+ nil?: true
63
+
64
+ # @!method initialize(enabled: nil, environment_id: nil, guest_policy: nil, instructions: nil, model: nil, reply_mode: nil)
47
65
  # The settings in a request that sets a Slack channel up. A setting left out is
48
66
  # not set. A setting sent as null is cleared.
49
67
  #
@@ -60,6 +78,8 @@ module Anthropic
60
78
  # @param instructions [String, nil] Instructions for Claude, up to 8,192 characters after leading and trailing white
61
79
  #
62
80
  # @param model [String, nil] The model Claude uses: the identifier of a model, or the name of a model line, t
81
+ #
82
+ # @param reply_mode [Anthropic::Models::Beta::Organization::BetaClaudeTagReplyModeAutomatic, Anthropic::Models::Beta::Organization::BetaClaudeTagReplyModeMentionOnly, Anthropic::Models::Beta::Organization::BetaClaudeTagReplyModeAlwaysAwake, Anthropic::Models::Beta::Organization::BetaClaudeTagReplyModeThread, nil] How Claude takes part in the channel: `automatic`, `mention_only`,
63
83
  end
64
84
  end
65
85
  end
@@ -14,7 +14,9 @@ module Anthropic
14
14
 
15
15
  # @!attribute environment_id
16
16
  # The environment Claude's sessions run in: the identifier of an active
17
- # environment of the organization, starting with `env_`. Null clears it.
17
+ # environment of the organization, starting with `env_`, or of a self-hosted
18
+ # runner pool of the organization that every member may use, starting with
19
+ # `ccpool_`. Null clears it.
18
20
  #
19
21
  # @return [String, nil]
20
22
  optional :environment_id, String, nil?: true
@@ -43,7 +45,23 @@ module Anthropic
43
45
  # @return [String, nil]
44
46
  optional :model, String, nil?: true
45
47
 
46
- # @!method initialize(enabled: nil, environment_id: nil, guest_policy: nil, instructions: nil, model: nil)
48
+ # @!attribute reply_mode
49
+ # How Claude takes part in the channel: `automatic`, `mention_only`,
50
+ # `always_awake` or `thread`. Only a channel takes one: an update of a workspace
51
+ # that sends a value is refused, and one that sends null changes nothing. Null
52
+ # never clears it: sent to a channel that stores none it changes nothing, and sent
53
+ # to a channel that stores one it is refused, because a stored reply mode can be
54
+ # changed but never cleared; a caller that wants Claude's default behavior sends
55
+ # `automatic`.
56
+ #
57
+ # @return [Anthropic::Models::Beta::Organization::BetaClaudeTagReplyModeAutomatic, Anthropic::Models::Beta::Organization::BetaClaudeTagReplyModeMentionOnly, Anthropic::Models::Beta::Organization::BetaClaudeTagReplyModeAlwaysAwake, Anthropic::Models::Beta::Organization::BetaClaudeTagReplyModeThread, nil]
58
+ optional :reply_mode,
59
+ union: -> {
60
+ Anthropic::Beta::Organization::BetaClaudeTagReplyMode
61
+ },
62
+ nil?: true
63
+
64
+ # @!method initialize(enabled: nil, environment_id: nil, guest_policy: nil, instructions: nil, model: nil, reply_mode: nil)
47
65
  # The settings to change. A setting left out is unchanged. A setting sent as null
48
66
  # is cleared, so it is inherited.
49
67
  #
@@ -60,6 +78,8 @@ module Anthropic
60
78
  # @param instructions [String, nil] Instructions for Claude, up to 8,192 characters after leading and trailing white
61
79
  #
62
80
  # @param model [String, nil] The model Claude uses: the identifier of a model, or the name of a model line, t
81
+ #
82
+ # @param reply_mode [Anthropic::Models::Beta::Organization::BetaClaudeTagReplyModeAutomatic, Anthropic::Models::Beta::Organization::BetaClaudeTagReplyModeMentionOnly, Anthropic::Models::Beta::Organization::BetaClaudeTagReplyModeAlwaysAwake, Anthropic::Models::Beta::Organization::BetaClaudeTagReplyModeThread, nil] How Claude takes part in the channel: `automatic`, `mention_only`,
63
83
  end
64
84
  end
65
85
  end