anthropic 2.1.0 → 2.2.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +23 -0
- data/README.md +1 -1
- data/lib/anthropic/client.rb +8 -0
- data/lib/anthropic/helpers/bedrock/client.rb +5 -0
- data/lib/anthropic/helpers/bedrock/mantle_client.rb +5 -0
- data/lib/anthropic/helpers/stainless_helper_header.rb +1 -0
- data/lib/anthropic/helpers/threads/beta_message_thread.rb +635 -0
- data/lib/anthropic/helpers/tools/runner.rb +79 -11
- data/lib/anthropic/helpers/vertex/client.rb +5 -0
- data/lib/anthropic/internal/report_page_cursor.rb +2 -2
- data/lib/anthropic/internal/tracing.rb +2 -0
- data/lib/anthropic/models/anthropic_beta.rb +6 -0
- data/lib/anthropic/models/beta/beta_message_thread_param.rb +61 -0
- data/lib/anthropic/models/beta/beta_thread_continue_params.rb +29 -0
- data/lib/anthropic/models/beta/beta_thread_create_params.rb +21 -0
- data/lib/anthropic/models/beta/message_create_params.rb +13 -1
- data/lib/anthropic/models/beta/messages/batch_create_params.rb +13 -1
- data/lib/anthropic/models/beta/organization/analytics/beta_analytics_cost_group.rb +271 -0
- data/lib/anthropic/models/beta/organization/analytics/beta_analytics_cost_group_by.rb +40 -0
- data/lib/anthropic/models/beta/organization/analytics/beta_analytics_cost_item.rb +57 -0
- data/lib/anthropic/models/beta/organization/analytics/beta_analytics_cost_metrics.rb +57 -0
- data/lib/anthropic/models/beta/organization/analytics/beta_analytics_cost_order_by.rb +22 -0
- data/lib/anthropic/models/beta/organization/analytics/beta_analytics_usage_group.rb +247 -0
- data/lib/anthropic/models/beta/organization/analytics/beta_analytics_usage_group_by.rb +38 -0
- data/lib/anthropic/models/beta/organization/analytics/beta_analytics_usage_item.rb +57 -0
- data/lib/anthropic/models/beta/organization/analytics/beta_analytics_usage_metrics.rb +79 -0
- data/lib/anthropic/models/beta/organization/analytics/beta_analytics_usage_order_by.rb +24 -0
- data/lib/anthropic/models/beta/organization/analytics/cost_list_params.rb +360 -0
- data/lib/anthropic/models/beta/organization/analytics/usage_list_params.rb +353 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_actor.rb +81 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_actor_type.rb +22 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_api_actor.rb +27 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_federated_actor.rb +42 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_federated_actor_aws_provider.rb +35 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_federated_actor_azure_provider.rb +27 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_federated_actor_gcp_provider.rb +27 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_federated_actor_oidc_provider.rb +27 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_federated_actor_provider.rb +72 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_grouped_cost_type.rb +21 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_report_user_actor.rb +65 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_service_account_actor.rb +27 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_service_tier.rb +23 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_speed.rb +19 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_time_bucket_width.rb +20 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_usage_cost_inference_geo.rb +19 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_usage_cost_product_filter.rb +34 -0
- data/lib/anthropic/models/beta/organization/beta_analytics_usage_cost_sort_order.rb +19 -0
- data/lib/anthropic/models/beta/organization/beta_organization_rate_limit.rb +2 -1
- data/lib/anthropic/models/beta/organization/beta_plugin.rb +12 -6
- data/lib/anthropic/models/beta/organization/beta_plugin_content_scan.rb +11 -5
- data/lib/anthropic/models/beta/organization/workspaces/beta_workspace_rate_limit.rb +2 -1
- data/lib/anthropic/models/organization/organization_rate_limit.rb +2 -1
- data/lib/anthropic/models/organization/workspaces/workspace_rate_limit.rb +2 -1
- data/lib/anthropic/resources/beta/messages.rb +78 -4
- data/lib/anthropic/resources/beta/organization/analytics/cost.rb +175 -0
- data/lib/anthropic/resources/beta/organization/analytics/cost_report.rb +13 -6
- data/lib/anthropic/resources/beta/organization/analytics/usage.rb +176 -0
- data/lib/anthropic/resources/beta/organization/analytics/usage_report.rb +9 -2
- data/lib/anthropic/resources/beta/organization/analytics/user_cost_report.rb +12 -5
- data/lib/anthropic/resources/beta/organization/analytics/user_usage_report.rb +15 -8
- data/lib/anthropic/resources/beta/organization/analytics.rb +8 -0
- data/lib/anthropic/resources/beta/organization/plugin_marketplaces.rb +6 -6
- data/lib/anthropic/resources/beta/organization/plugins.rb +12 -9
- data/lib/anthropic/version.rb +1 -1
- data/lib/anthropic.rb +36 -0
- data/rbi/anthropic/client.rbi +5 -0
- data/rbi/anthropic/helpers/bedrock/client.rbi +5 -0
- data/rbi/anthropic/helpers/bedrock/mantle_client.rbi +5 -0
- data/rbi/anthropic/helpers/threads/beta_message_thread.rbi +100 -0
- data/rbi/anthropic/helpers/vertex/client.rbi +5 -0
- data/rbi/anthropic/internal/tracing.rbi +4 -0
- data/rbi/anthropic/models/anthropic_beta.rbi +10 -0
- data/rbi/anthropic/models/beta/beta_message_thread_param.rbi +80 -0
- data/rbi/anthropic/models/beta/beta_thread_continue_params.rbi +43 -0
- data/rbi/anthropic/models/beta/beta_thread_create_params.rbi +31 -0
- data/rbi/anthropic/models/beta/message_create_params.rbi +37 -0
- data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +37 -0
- data/rbi/anthropic/models/beta/organization/analytics/beta_analytics_cost_group.rbi +439 -0
- data/rbi/anthropic/models/beta/organization/analytics/beta_analytics_cost_group_by.rbi +140 -0
- data/rbi/anthropic/models/beta/organization/analytics/beta_analytics_cost_item.rbi +110 -0
- data/rbi/anthropic/models/beta/organization/analytics/beta_analytics_cost_metrics.rbi +79 -0
- data/rbi/anthropic/models/beta/organization/analytics/beta_analytics_cost_order_by.rbi +50 -0
- data/rbi/anthropic/models/beta/organization/analytics/beta_analytics_usage_group.rbi +399 -0
- data/rbi/anthropic/models/beta/organization/analytics/beta_analytics_usage_group_by.rbi +130 -0
- data/rbi/anthropic/models/beta/organization/analytics/beta_analytics_usage_item.rbi +110 -0
- data/rbi/anthropic/models/beta/organization/analytics/beta_analytics_usage_metrics.rbi +120 -0
- data/rbi/anthropic/models/beta/organization/analytics/beta_analytics_usage_order_by.rbi +60 -0
- data/rbi/anthropic/models/beta/organization/analytics/cost_list_params.rbi +624 -0
- data/rbi/anthropic/models/beta/organization/analytics/usage_list_params.rbi +612 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_actor.rbi +134 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_actor_type.rbi +54 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_api_actor.rbi +40 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_federated_actor.rbi +75 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_federated_actor_aws_provider.rbi +54 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_federated_actor_azure_provider.rbi +42 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_federated_actor_gcp_provider.rbi +42 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_federated_actor_oidc_provider.rbi +42 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_federated_actor_provider.rbi +107 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_grouped_cost_type.rbi +53 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_report_user_actor.rbi +94 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_service_account_actor.rbi +42 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_service_tier.rbi +63 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_speed.rbi +40 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_time_bucket_width.rbi +48 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_usage_cost_inference_geo.rbi +43 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_usage_cost_product_filter.rbi +98 -0
- data/rbi/anthropic/models/beta/organization/beta_analytics_usage_cost_sort_order.rbi +43 -0
- data/rbi/anthropic/models/beta/organization/beta_organization_rate_limit.rbi +4 -2
- data/rbi/anthropic/models/beta/organization/beta_plugin.rbi +20 -8
- data/rbi/anthropic/models/beta/organization/beta_plugin_content_scan.rbi +15 -6
- data/rbi/anthropic/models/beta/organization/workspaces/beta_workspace_rate_limit.rbi +4 -2
- data/rbi/anthropic/models/organization/organization_rate_limit.rbi +4 -2
- data/rbi/anthropic/models/organization/workspaces/workspace_rate_limit.rbi +4 -2
- data/rbi/anthropic/resources/beta/messages.rbi +191 -0
- data/rbi/anthropic/resources/beta/organization/analytics/cost.rbi +245 -0
- data/rbi/anthropic/resources/beta/organization/analytics/cost_report.rbi +12 -5
- data/rbi/anthropic/resources/beta/organization/analytics/usage.rbi +240 -0
- data/rbi/anthropic/resources/beta/organization/analytics/usage_report.rbi +9 -2
- data/rbi/anthropic/resources/beta/organization/analytics/user_cost_report.rbi +12 -5
- data/rbi/anthropic/resources/beta/organization/analytics/user_usage_report.rbi +14 -7
- data/rbi/anthropic/resources/beta/organization/analytics.rbi +10 -0
- data/rbi/anthropic/resources/beta/organization/plugin_marketplaces.rbi +6 -6
- data/rbi/anthropic/resources/beta/organization/plugins.rbi +12 -9
- data/rbi/lib/anthropic/helpers/stainless_helper_header.rbi +2 -0
- data/sig/anthropic/client.rbs +2 -0
- data/sig/anthropic/helpers/bedrock/client.rbs +2 -0
- data/sig/anthropic/helpers/threads/beta_message_thread.rbs +40 -0
- data/sig/anthropic/helpers/tools/runner.rbs +40 -0
- data/sig/anthropic/helpers/vertex/client.rbs +2 -0
- data/sig/anthropic/internal/tracing.rbs +2 -0
- data/sig/anthropic/models/anthropic_beta.rbs +4 -0
- data/sig/anthropic/models/beta/beta_message_thread_param.rbs +40 -0
- data/sig/anthropic/models/beta/beta_thread_continue_params.rbs +20 -0
- data/sig/anthropic/models/beta/beta_thread_create_params.rbs +17 -0
- data/sig/anthropic/models/beta/message_create_params.rbs +5 -0
- data/sig/anthropic/models/beta/messages/batch_create_params.rbs +5 -0
- data/sig/anthropic/models/beta/organization/analytics/beta_analytics_cost_group.rbs +126 -0
- data/sig/anthropic/models/beta/organization/analytics/beta_analytics_cost_group_by.rbs +60 -0
- data/sig/anthropic/models/beta/organization/analytics/beta_analytics_cost_item.rbs +41 -0
- data/sig/anthropic/models/beta/organization/analytics/beta_analytics_cost_metrics.rbs +41 -0
- data/sig/anthropic/models/beta/organization/analytics/beta_analytics_cost_order_by.rbs +21 -0
- data/sig/anthropic/models/beta/organization/analytics/beta_analytics_usage_group.rbs +116 -0
- data/sig/anthropic/models/beta/organization/analytics/beta_analytics_usage_group_by.rbs +56 -0
- data/sig/anthropic/models/beta/organization/analytics/beta_analytics_usage_item.rbs +41 -0
- data/sig/anthropic/models/beta/organization/analytics/beta_analytics_usage_metrics.rbs +56 -0
- data/sig/anthropic/models/beta/organization/analytics/beta_analytics_usage_order_by.rbs +28 -0
- data/sig/anthropic/models/beta/organization/analytics/cost_list_params.rbs +188 -0
- data/sig/anthropic/models/beta/organization/analytics/usage_list_params.rbs +188 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_actor.rbs +67 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_actor_type.rbs +21 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_api_actor.rbs +19 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_federated_actor.rbs +34 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_federated_actor_aws_provider.rbs +30 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_federated_actor_azure_provider.rbs +20 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_federated_actor_gcp_provider.rbs +20 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_federated_actor_oidc_provider.rbs +20 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_federated_actor_provider.rbs +60 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_grouped_cost_type.rbs +21 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_report_user_actor.rbs +44 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_service_account_actor.rbs +26 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_service_tier.rbs +28 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_speed.rbs +18 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_time_bucket_width.rbs +19 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_usage_cost_inference_geo.rbs +18 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_usage_cost_product_filter.rbs +40 -0
- data/sig/anthropic/models/beta/organization/beta_analytics_usage_cost_sort_order.rbs +18 -0
- data/sig/anthropic/resources/beta/messages.rbs +33 -0
- data/sig/anthropic/resources/beta/organization/analytics/cost.rbs +46 -0
- data/sig/anthropic/resources/beta/organization/analytics/usage.rbs +46 -0
- data/sig/anthropic/resources/beta/organization/analytics.rbs +4 -0
- metadata +111 -2
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
module Organization
|
|
7
|
+
module BetaAnalyticsFederatedActorProvider
|
|
8
|
+
extend Anthropic::Internal::Type::Union
|
|
9
|
+
|
|
10
|
+
discriminator :type
|
|
11
|
+
|
|
12
|
+
variant :aws, -> { Anthropic::Beta::Organization::BetaAnalyticsFederatedActorAWSProvider }
|
|
13
|
+
|
|
14
|
+
variant :azure, -> { Anthropic::Beta::Organization::BetaAnalyticsFederatedActorAzureProvider }
|
|
15
|
+
|
|
16
|
+
variant :gcp, -> { Anthropic::Beta::Organization::BetaAnalyticsFederatedActorGCPProvider }
|
|
17
|
+
|
|
18
|
+
variant :oidc, -> { Anthropic::Beta::Organization::BetaAnalyticsFederatedActorOIDCProvider }
|
|
19
|
+
|
|
20
|
+
module Type
|
|
21
|
+
extend Anthropic::Internal::Type::Enum
|
|
22
|
+
|
|
23
|
+
AWS = :aws
|
|
24
|
+
AZURE = :azure
|
|
25
|
+
GCP = :gcp
|
|
26
|
+
OIDC = :oidc
|
|
27
|
+
|
|
28
|
+
# @!method self.values
|
|
29
|
+
# @return [Array<Symbol>]
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# @!method self.variants
|
|
33
|
+
# @return [Array(Anthropic::Models::Beta::Organization::BetaAnalyticsFederatedActorAWSProvider, Anthropic::Models::Beta::Organization::BetaAnalyticsFederatedActorAzureProvider, Anthropic::Models::Beta::Organization::BetaAnalyticsFederatedActorGCPProvider, Anthropic::Models::Beta::Organization::BetaAnalyticsFederatedActorOIDCProvider)]
|
|
34
|
+
|
|
35
|
+
# Creates a new instance of the variant class whose `type` matches the given
|
|
36
|
+
# value, passing the remaining arguments to its constructor.
|
|
37
|
+
#
|
|
38
|
+
# @param type [Symbol, Anthropic::Models::Beta::Organization::BetaAnalyticsFederatedActorProvider::Type, String]
|
|
39
|
+
#
|
|
40
|
+
# @param args [Hash{Symbol=>Object}] Attributes for the chosen variant.
|
|
41
|
+
#
|
|
42
|
+
# @option args [String] :account_id The AWS account the organization is bound to.
|
|
43
|
+
#
|
|
44
|
+
# @option args [String] :signed_principal The AWS-signed ARN of the IAM principal that made the requests.
|
|
45
|
+
#
|
|
46
|
+
# @option args [String] :subscription_id The Azure subscription the organization is bound to.
|
|
47
|
+
#
|
|
48
|
+
# @option args [String] :project_number The Google Cloud project the organization is bound to.
|
|
49
|
+
#
|
|
50
|
+
# @option args [String, nil] :issuer The federation issuer's URL.
|
|
51
|
+
#
|
|
52
|
+
# @raise [ArgumentError]
|
|
53
|
+
# @return [Anthropic::Models::Beta::Organization::BetaAnalyticsFederatedActorAWSProvider, Anthropic::Models::Beta::Organization::BetaAnalyticsFederatedActorAzureProvider, Anthropic::Models::Beta::Organization::BetaAnalyticsFederatedActorGCPProvider, Anthropic::Models::Beta::Organization::BetaAnalyticsFederatedActorOIDCProvider]
|
|
54
|
+
def self.new(type:, **args)
|
|
55
|
+
case type.to_sym
|
|
56
|
+
when :aws
|
|
57
|
+
Anthropic::Beta::Organization::BetaAnalyticsFederatedActorAWSProvider.new(**args)
|
|
58
|
+
when :azure
|
|
59
|
+
Anthropic::Beta::Organization::BetaAnalyticsFederatedActorAzureProvider.new(**args)
|
|
60
|
+
when :gcp
|
|
61
|
+
Anthropic::Beta::Organization::BetaAnalyticsFederatedActorGCPProvider.new(**args)
|
|
62
|
+
when :oidc
|
|
63
|
+
Anthropic::Beta::Organization::BetaAnalyticsFederatedActorOIDCProvider.new(**args)
|
|
64
|
+
else
|
|
65
|
+
raise ArgumentError, "unknown type: #{type}"
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
module Organization
|
|
7
|
+
module BetaAnalyticsGroupedCostType
|
|
8
|
+
extend Anthropic::Internal::Type::Enum
|
|
9
|
+
|
|
10
|
+
CODE_EXECUTION = :code_execution
|
|
11
|
+
SESSION_USAGE = :session_usage
|
|
12
|
+
TOKENS = :tokens
|
|
13
|
+
WEB_SEARCH = :web_search
|
|
14
|
+
|
|
15
|
+
# @!method self.values
|
|
16
|
+
# @return [Array<Symbol>]
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
module Organization
|
|
7
|
+
class BetaAnalyticsReportUserActor < Anthropic::Internal::Type::BaseModel
|
|
8
|
+
# @!attribute deleted
|
|
9
|
+
# True when the account has been deleted, or when the user is no longer a member
|
|
10
|
+
# of the organization or its associated organizations (for example, their
|
|
11
|
+
# membership was removed or they were deprovisioned via your identity provider).
|
|
12
|
+
# `email_address` stays populated for removed users and is null when the account
|
|
13
|
+
# has been deleted. `name` follows the rules described on that field. The
|
|
14
|
+
# `user_id` is still populated for reconciliation.
|
|
15
|
+
#
|
|
16
|
+
# @return [Boolean]
|
|
17
|
+
required :deleted, Anthropic::Internal::Type::Boolean
|
|
18
|
+
|
|
19
|
+
# @!attribute email_address
|
|
20
|
+
# The user's current email address, including for users who are no longer members
|
|
21
|
+
# of the organization. Null when the account has been deleted and for
|
|
22
|
+
# system-minted service accounts.
|
|
23
|
+
#
|
|
24
|
+
# @return [String, nil]
|
|
25
|
+
required :email_address, String, nil?: true
|
|
26
|
+
|
|
27
|
+
# @!attribute name
|
|
28
|
+
# The user's current full name. Null when the user has not set one.
|
|
29
|
+
# `"Deleted User"` when the account has been deleted, or when the user is no
|
|
30
|
+
# longer a member and the organization hides removed users' names.
|
|
31
|
+
#
|
|
32
|
+
# @return [String, nil]
|
|
33
|
+
required :name, String, nil?: true
|
|
34
|
+
|
|
35
|
+
# @!attribute type
|
|
36
|
+
# Actor type. Always `"user_actor"`.
|
|
37
|
+
#
|
|
38
|
+
# @return [Symbol, :user_actor]
|
|
39
|
+
required :type, const: :user_actor
|
|
40
|
+
|
|
41
|
+
# @!attribute user_id
|
|
42
|
+
# Tagged user ID.
|
|
43
|
+
#
|
|
44
|
+
# @return [String]
|
|
45
|
+
required :user_id, String
|
|
46
|
+
|
|
47
|
+
# @!method initialize(deleted:, email_address:, name:, user_id:, type: :user_actor)
|
|
48
|
+
# Some parameter documentations has been truncated, see
|
|
49
|
+
# {Anthropic::Models::Beta::Organization::BetaAnalyticsReportUserActor} for more
|
|
50
|
+
# details.
|
|
51
|
+
#
|
|
52
|
+
# @param deleted [Boolean] True when the account has been deleted, or when the user is no longer a member o
|
|
53
|
+
#
|
|
54
|
+
# @param email_address [String, nil] The user's current email address, including for users who are no longer members
|
|
55
|
+
#
|
|
56
|
+
# @param name [String, nil] The user's current full name. Null when the user has not set one. `"Deleted User
|
|
57
|
+
#
|
|
58
|
+
# @param user_id [String] Tagged user ID.
|
|
59
|
+
#
|
|
60
|
+
# @param type [Symbol, :user_actor] Actor type. Always `"user_actor"`.
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
module Organization
|
|
7
|
+
class BetaAnalyticsServiceAccountActor < Anthropic::Internal::Type::BaseModel
|
|
8
|
+
# @!attribute service_account_id
|
|
9
|
+
# Tagged service account ID.
|
|
10
|
+
#
|
|
11
|
+
# @return [String]
|
|
12
|
+
required :service_account_id, String
|
|
13
|
+
|
|
14
|
+
# @!attribute type
|
|
15
|
+
#
|
|
16
|
+
# @return [Symbol, :service_account_actor]
|
|
17
|
+
required :type, const: :service_account_actor
|
|
18
|
+
|
|
19
|
+
# @!method initialize(service_account_id:, type: :service_account_actor)
|
|
20
|
+
# @param service_account_id [String] Tagged service account ID.
|
|
21
|
+
#
|
|
22
|
+
# @param type [Symbol, :service_account_actor]
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
module Organization
|
|
7
|
+
module BetaAnalyticsServiceTier
|
|
8
|
+
extend Anthropic::Internal::Type::Enum
|
|
9
|
+
|
|
10
|
+
BATCH = :batch
|
|
11
|
+
FLEX = :flex
|
|
12
|
+
FLEX_DISCOUNT = :flex_discount
|
|
13
|
+
PRIORITY = :priority
|
|
14
|
+
PRIORITY_ON_DEMAND = :priority_on_demand
|
|
15
|
+
STANDARD = :standard
|
|
16
|
+
|
|
17
|
+
# @!method self.values
|
|
18
|
+
# @return [Array<Symbol>]
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
module Organization
|
|
7
|
+
module BetaAnalyticsSpeed
|
|
8
|
+
extend Anthropic::Internal::Type::Enum
|
|
9
|
+
|
|
10
|
+
FAST = :fast
|
|
11
|
+
STANDARD = :standard
|
|
12
|
+
|
|
13
|
+
# @!method self.values
|
|
14
|
+
# @return [Array<Symbol>]
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
module Organization
|
|
7
|
+
module BetaAnalyticsTimeBucketWidth
|
|
8
|
+
extend Anthropic::Internal::Type::Enum
|
|
9
|
+
|
|
10
|
+
DAY = :"1d"
|
|
11
|
+
HOUR = :"1h"
|
|
12
|
+
MINUTE = :"1m"
|
|
13
|
+
|
|
14
|
+
# @!method self.values
|
|
15
|
+
# @return [Array<Symbol>]
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
module Organization
|
|
7
|
+
module BetaAnalyticsUsageCostInferenceGeo
|
|
8
|
+
extend Anthropic::Internal::Type::Enum
|
|
9
|
+
|
|
10
|
+
GLOBAL = :global
|
|
11
|
+
US = :us
|
|
12
|
+
|
|
13
|
+
# @!method self.values
|
|
14
|
+
# @return [Array<Symbol>]
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
module Organization
|
|
7
|
+
# Publicly documented product surfaces. `claude_tag` is Claude Tag, the Claude
|
|
8
|
+
# product in Slack. `chat_cowork_unified` is Chat and Cowork unified, Cowork's
|
|
9
|
+
# features inside claude.ai chat: chat and Cowork usage by a member who has it
|
|
10
|
+
# turned on is reported under this value instead of `chat` or `cowork`. It is
|
|
11
|
+
# accepted as a filter only on deployments that offer Chat and Cowork unified.
|
|
12
|
+
module BetaAnalyticsUsageCostProductFilter
|
|
13
|
+
extend Anthropic::Internal::Type::Enum
|
|
14
|
+
|
|
15
|
+
CHAT = :chat
|
|
16
|
+
CHAT_COWORK_UNIFIED = :chat_cowork_unified
|
|
17
|
+
CLAUDE_CODE = :claude_code
|
|
18
|
+
CLAUDE_CONSOLE = :claude_console
|
|
19
|
+
CLAUDE_DESIGN = :claude_design
|
|
20
|
+
CLAUDE_IN_CHROME = :claude_in_chrome
|
|
21
|
+
CLAUDE_TAG = :claude_tag
|
|
22
|
+
COWORK = :cowork
|
|
23
|
+
MANAGED_AGENTS_API = :managed_agents_api
|
|
24
|
+
MESSAGE_BATCHES_API = :message_batches_api
|
|
25
|
+
MESSAGES_API = :messages_api
|
|
26
|
+
OFFICE_AGENT = :office_agent
|
|
27
|
+
|
|
28
|
+
# @!method self.values
|
|
29
|
+
# @return [Array<Symbol>]
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Anthropic
|
|
4
|
+
module Models
|
|
5
|
+
module Beta
|
|
6
|
+
module Organization
|
|
7
|
+
module BetaAnalyticsUsageCostSortOrder
|
|
8
|
+
extend Anthropic::Internal::Type::Enum
|
|
9
|
+
|
|
10
|
+
ASC = :asc
|
|
11
|
+
DESC = :desc
|
|
12
|
+
|
|
13
|
+
# @!method self.values
|
|
14
|
+
# @return [Array<Symbol>]
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -29,7 +29,8 @@ module Anthropic
|
|
|
29
29
|
|
|
30
30
|
# @!attribute models
|
|
31
31
|
# Model names this entry's limits apply to, including aliases. `null` when
|
|
32
|
-
# `group.type` is not `"model_group"`.
|
|
32
|
+
# `group.type` is not `"model_group"`. The list covers the models your
|
|
33
|
+
# organization has access to, so it can differ between organizations.
|
|
33
34
|
#
|
|
34
35
|
# @return [Array<String>, nil]
|
|
35
36
|
required :models, Anthropic::Internal::Type::ArrayOf[String], nil?: true
|
|
@@ -135,8 +135,11 @@ module Anthropic
|
|
|
135
135
|
required :served_version_id, String
|
|
136
136
|
|
|
137
137
|
# @!attribute served_version_pinned
|
|
138
|
-
#
|
|
139
|
-
#
|
|
138
|
+
# True once the served version has been pinned, through Update Plugin or in
|
|
139
|
+
# claude.ai. While false, a new version normally becomes the served version when
|
|
140
|
+
# it is stored. While the newest version is not the served version, as when a
|
|
141
|
+
# version saved in claude.ai is waiting for its content scan, `served_version_id`
|
|
142
|
+
# differs from `latest_version_id`.
|
|
140
143
|
#
|
|
141
144
|
# @return [Boolean]
|
|
142
145
|
required :served_version_pinned, Anthropic::Internal::Type::Boolean
|
|
@@ -148,8 +151,11 @@ module Anthropic
|
|
|
148
151
|
required :type, const: :plugin
|
|
149
152
|
|
|
150
153
|
# @!attribute updated_at
|
|
151
|
-
# RFC 3339. Moves on a
|
|
152
|
-
#
|
|
154
|
+
# RFC 3339. Moves on a served-version change (including pinning an unpinned Plugin
|
|
155
|
+
# to the version it already serves) and, normally, on a new version. A version
|
|
156
|
+
# saved in claude.ai that waits for its content scan moves it when it becomes the
|
|
157
|
+
# served version, and not necessarily when it is stored. A change to the Plugin's
|
|
158
|
+
# installation settings or shares does not move it.
|
|
153
159
|
#
|
|
154
160
|
# @return [Time]
|
|
155
161
|
required :updated_at, Time
|
|
@@ -190,9 +196,9 @@ module Anthropic
|
|
|
190
196
|
#
|
|
191
197
|
# @param served_version_id [String] The version claude.ai serves to members.
|
|
192
198
|
#
|
|
193
|
-
# @param served_version_pinned [Boolean]
|
|
199
|
+
# @param served_version_pinned [Boolean] True once the served version has been pinned, through Update Plugin or in claude
|
|
194
200
|
#
|
|
195
|
-
# @param updated_at [Time] RFC 3339. Moves on a
|
|
201
|
+
# @param updated_at [Time] RFC 3339. Moves on a served-version change (including pinning an unpinned Plugin
|
|
196
202
|
#
|
|
197
203
|
# @param type [Symbol, :plugin] Always `plugin`.
|
|
198
204
|
|
|
@@ -6,7 +6,8 @@ module Anthropic
|
|
|
6
6
|
module Organization
|
|
7
7
|
class BetaPluginContentScan < Anthropic::Internal::Type::BaseModel
|
|
8
8
|
# @!attribute assessment
|
|
9
|
-
# The scan's verdict; set only when `status` is `completed`.
|
|
9
|
+
# The scan's verdict; set only when `status` is `completed`. A `warn` can mean a
|
|
10
|
+
# `fail` that was allowed in claude.ai.
|
|
10
11
|
#
|
|
11
12
|
# @return [Symbol, Anthropic::Models::Beta::Organization::BetaPluginContentScan::Assessment, nil]
|
|
12
13
|
required :assessment,
|
|
@@ -24,7 +25,9 @@ module Anthropic
|
|
|
24
25
|
|
|
25
26
|
# @!attribute status
|
|
26
27
|
# `processing` while a scan runs, `completed` when it ran to completion, `errored`
|
|
27
|
-
# when it could not run
|
|
28
|
+
# when it could not run. Once a scan of the version has completed, `content_scan`
|
|
29
|
+
# describes the newest completed scan, even while a later scan runs. While the
|
|
30
|
+
# scan outcome cannot be read, `status` is `errored` instead.
|
|
28
31
|
#
|
|
29
32
|
# @return [Symbol, Anthropic::Models::Beta::Organization::BetaPluginContentScan::Status]
|
|
30
33
|
required :status, enum: -> { Anthropic::Beta::Organization::BetaPluginContentScan::Status }
|
|
@@ -33,13 +36,14 @@ module Anthropic
|
|
|
33
36
|
# Some parameter documentations has been truncated, see
|
|
34
37
|
# {Anthropic::Models::Beta::Organization::BetaPluginContentScan} for more details.
|
|
35
38
|
#
|
|
36
|
-
# @param assessment [Symbol, Anthropic::Models::Beta::Organization::BetaPluginContentScan::Assessment, nil] The scan's verdict; set only when `status` is `completed`.
|
|
39
|
+
# @param assessment [Symbol, Anthropic::Models::Beta::Organization::BetaPluginContentScan::Assessment, nil] The scan's verdict; set only when `status` is `completed`. A `warn` can mean a `
|
|
37
40
|
#
|
|
38
41
|
# @param reason [String, nil] The primary mechanism behind a `warn` or `fail`, such as `credential-exposure` o
|
|
39
42
|
#
|
|
40
43
|
# @param status [Symbol, Anthropic::Models::Beta::Organization::BetaPluginContentScan::Status] `processing` while a scan runs, `completed` when it ran to completion, `errored`
|
|
41
44
|
|
|
42
|
-
# The scan's verdict; set only when `status` is `completed`.
|
|
45
|
+
# The scan's verdict; set only when `status` is `completed`. A `warn` can mean a
|
|
46
|
+
# `fail` that was allowed in claude.ai.
|
|
43
47
|
#
|
|
44
48
|
# @see Anthropic::Models::Beta::Organization::BetaPluginContentScan#assessment
|
|
45
49
|
module Assessment
|
|
@@ -55,7 +59,9 @@ module Anthropic
|
|
|
55
59
|
end
|
|
56
60
|
|
|
57
61
|
# `processing` while a scan runs, `completed` when it ran to completion, `errored`
|
|
58
|
-
# when it could not run
|
|
62
|
+
# when it could not run. Once a scan of the version has completed, `content_scan`
|
|
63
|
+
# describes the newest completed scan, even while a later scan runs. While the
|
|
64
|
+
# scan outcome cannot be read, `status` is `errored` instead.
|
|
59
65
|
#
|
|
60
66
|
# @see Anthropic::Models::Beta::Organization::BetaPluginContentScan#status
|
|
61
67
|
module Status
|
|
@@ -25,7 +25,8 @@ module Anthropic
|
|
|
25
25
|
|
|
26
26
|
# @!attribute models
|
|
27
27
|
# Model names this entry's limits apply to, including aliases. `null` when
|
|
28
|
-
# `group.type` is not `"model_group"`.
|
|
28
|
+
# `group.type` is not `"model_group"`. The list covers the models this workspace
|
|
29
|
+
# has access to, so it can differ between workspaces.
|
|
29
30
|
#
|
|
30
31
|
# @return [Array<String>, nil]
|
|
31
32
|
required :models, Anthropic::Internal::Type::ArrayOf[String], nil?: true
|
|
@@ -28,7 +28,8 @@ module Anthropic
|
|
|
28
28
|
|
|
29
29
|
# @!attribute models
|
|
30
30
|
# Model names this entry's limits apply to, including aliases. `null` when
|
|
31
|
-
# `group.type` is not `"model_group"`.
|
|
31
|
+
# `group.type` is not `"model_group"`. The list covers the models your
|
|
32
|
+
# organization has access to, so it can differ between organizations.
|
|
32
33
|
#
|
|
33
34
|
# @return [Array<String>, nil]
|
|
34
35
|
required :models, Anthropic::Internal::Type::ArrayOf[String], nil?: true
|
|
@@ -24,7 +24,8 @@ module Anthropic
|
|
|
24
24
|
|
|
25
25
|
# @!attribute models
|
|
26
26
|
# Model names this entry's limits apply to, including aliases. `null` when
|
|
27
|
-
# `group.type` is not `"model_group"`.
|
|
27
|
+
# `group.type` is not `"model_group"`. The list covers the models this workspace
|
|
28
|
+
# has access to, so it can differ between workspaces.
|
|
28
29
|
#
|
|
29
30
|
# @return [Array<String>, nil]
|
|
30
31
|
required :models, Anthropic::Internal::Type::ArrayOf[String], nil?: true
|
|
@@ -7,14 +7,59 @@ module Anthropic
|
|
|
7
7
|
# @return [Anthropic::Resources::Beta::Messages::Batches]
|
|
8
8
|
attr_reader :batches
|
|
9
9
|
|
|
10
|
+
# Runs the tool calls of a conversation until the model gives its final reply.
|
|
11
|
+
#
|
|
12
|
+
# The runner sends its requests on a message thread, so that each request after the first
|
|
13
|
+
# carries only the messages that are new. Pass `thread: false` to send the whole history
|
|
14
|
+
# with every request instead.
|
|
15
|
+
#
|
|
10
16
|
# @param params [Anthropic::Models::Beta::MessageCreateParams]
|
|
11
17
|
#
|
|
18
|
+
# @option params [false, nil] :thread `false` turns the message thread off; `nil` leaves it on.
|
|
19
|
+
#
|
|
20
|
+
# @raise [ArgumentError] if `thread` is anything else
|
|
21
|
+
#
|
|
12
22
|
# @return [Anthropic::Helpers::Tools::Runner]
|
|
13
23
|
def tool_runner(params)
|
|
14
24
|
params = params.to_h.transform_keys(&:to_sym)
|
|
15
25
|
warn_thinking_enabled(params)
|
|
16
26
|
max_iterations = params.delete(:max_iterations)
|
|
17
|
-
|
|
27
|
+
thread = runner_thread(params)
|
|
28
|
+
Anthropic::Helpers::Tools::Runner.new(@client, params:, max_iterations:, thread:)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Creates a message thread: a conversation that the API keeps between requests, so that
|
|
32
|
+
# each turn sends only the messages that are new. It sends no request.
|
|
33
|
+
#
|
|
34
|
+
# Takes the keywords of {#create} except `thread` and `stream`. `messages` is optional and
|
|
35
|
+
# seeds the history, which the first turn sends.
|
|
36
|
+
#
|
|
37
|
+
# @param params [Hash{Symbol=>Object}]
|
|
38
|
+
#
|
|
39
|
+
# @option params [Symbol] :unsupported_request_behavior What a turn does when the API cannot
|
|
40
|
+
# serve the request on a thread: `:error` (the default) raises the error, and
|
|
41
|
+
# `:continue_unthreaded` sends the turn again, and every later turn, with the whole
|
|
42
|
+
# history and no thread.
|
|
43
|
+
#
|
|
44
|
+
# @raise [ArgumentError] if `thread` or `stream` is given
|
|
45
|
+
#
|
|
46
|
+
# @raise [NotImplementedError] if the client's platform has no message threads
|
|
47
|
+
#
|
|
48
|
+
# @return [Anthropic::Helpers::Threads::BetaMessageThread]
|
|
49
|
+
def thread(params)
|
|
50
|
+
unless @client.message_threads?
|
|
51
|
+
raise NotImplementedError.new(
|
|
52
|
+
"Message threads are not available on this client. Use `#create` with the whole history instead."
|
|
53
|
+
)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
params = params.to_h.transform_keys(&:to_sym)
|
|
57
|
+
unsupported_request_behavior = params.delete(:unsupported_request_behavior) || :error
|
|
58
|
+
Anthropic::Helpers::Threads::BetaMessageThread.new(
|
|
59
|
+
@client,
|
|
60
|
+
params:,
|
|
61
|
+
unsupported_request_behavior:
|
|
62
|
+
)
|
|
18
63
|
end
|
|
19
64
|
|
|
20
65
|
# See {Anthropic::Resources::Beta::Messages#stream_raw} for streaming counterpart.
|
|
@@ -31,7 +76,7 @@ module Anthropic
|
|
|
31
76
|
# Some parameter documentations has been truncated, see
|
|
32
77
|
# {Anthropic::Models::Beta::MessageCreateParams} for more details.
|
|
33
78
|
#
|
|
34
|
-
# @overload create(max_tokens:, messages:, model:, cache_control: nil, compaction: nil, container: nil, context_management: nil, diagnostics: nil, fallback_credit_token: nil, fallbacks: nil, inference_geo: nil, mcp_servers: nil, metadata: nil, output_config: nil, output_format: nil, service_tier: nil, speed: nil, stop_sequences: nil, system_: nil, thinking: nil, tool_choice: nil, tools: nil, betas: nil, user_profile_id: nil, workspace_id: nil, request_options: {})
|
|
79
|
+
# @overload create(max_tokens:, messages:, model:, cache_control: nil, compaction: nil, container: nil, context_management: nil, diagnostics: nil, fallback_credit_token: nil, fallbacks: nil, inference_geo: nil, mcp_servers: nil, metadata: nil, output_config: nil, output_format: nil, service_tier: nil, speed: nil, stop_sequences: nil, system_: nil, thinking: nil, thread: nil, tool_choice: nil, tools: nil, betas: nil, user_profile_id: nil, workspace_id: nil, request_options: {})
|
|
35
80
|
#
|
|
36
81
|
# @param max_tokens [Integer] Body param: The maximum number of tokens to generate before stopping.
|
|
37
82
|
#
|
|
@@ -73,6 +118,8 @@ module Anthropic
|
|
|
73
118
|
#
|
|
74
119
|
# @param thinking [Anthropic::Models::Beta::BetaThinkingConfigEnabled, Anthropic::Models::Beta::BetaThinkingConfigDisabled, Anthropic::Models::Beta::BetaThinkingConfigBetweenTools, Anthropic::Models::Beta::BetaThinkingConfigAdaptive] Body param: Configuration for Claude's thinking.
|
|
75
120
|
#
|
|
121
|
+
# @param thread [Anthropic::Models::Beta::BetaThreadCreateParams, Anthropic::Models::Beta::BetaThreadContinueParams, nil] Body param: Server-held conversation state (a Thread). `{"type": "create"}` asks
|
|
122
|
+
#
|
|
76
123
|
# @param tool_choice [Anthropic::Models::Beta::BetaToolChoiceAuto, Anthropic::Models::Beta::BetaToolChoiceAny, Anthropic::Models::Beta::BetaToolChoiceTool, Anthropic::Models::Beta::BetaToolChoiceNone] Body param: How the model should use the provided tools. The model can use a spe
|
|
77
124
|
#
|
|
78
125
|
# @param tools [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, Anthropic::Models::Beta::BetaCodeExecutionTool20250825, Anthropic::Models::Beta::BetaCodeExecutionTool20260120, Anthropic::Models::Beta::BetaCodeExecutionTool20260521, Anthropic::Models::Beta::BetaBrowserToolset20260801, Anthropic::Models::Beta::BetaToolComputerUse20241022, Anthropic::Models::Beta::BetaMemoryTool20250818, Anthropic::Models::Beta::BetaToolComputerUse20250124, Anthropic::Models::Beta::BetaToolTextEditor20241022, Anthropic::Models::Beta::BetaToolComputerUse20251124, Anthropic::Models::Beta::BetaComputerToolset20260801, Anthropic::Models::Beta::BetaToolTextEditor20250124, Anthropic::Models::Beta::BetaToolTextEditor20250429, Anthropic::Models::Beta::BetaToolTextEditor20250728, Anthropic::Models::Beta::BetaWebSearchTool20250305, Anthropic::Models::Beta::BetaWebFetchTool20250910, Anthropic::Models::Beta::BetaWebSearchTool20260209, Anthropic::Models::Beta::BetaWebFetchTool20260209, Anthropic::Models::Beta::BetaWebFetchTool20260309, Anthropic::Models::Beta::BetaWebSearchTool20260318, Anthropic::Models::Beta::BetaWebFetchTool20260318, Anthropic::Models::Beta::BetaAdvisorTool20260301, Anthropic::Models::Beta::BetaToolSearchToolBm25_20251119, Anthropic::Models::Beta::BetaToolSearchToolRegex20251119, Anthropic::Models::Beta::BetaMCPToolset>] Body param: Definitions of tools that the model may use.
|
|
@@ -148,7 +195,7 @@ module Anthropic
|
|
|
148
195
|
# Some parameter documentations has been truncated, see
|
|
149
196
|
# {Anthropic::Models::Beta::MessageCreateParams} for more details.
|
|
150
197
|
#
|
|
151
|
-
# @overload stream_raw(max_tokens:, messages:, model:, cache_control: nil, compaction: nil, container: nil, context_management: nil, diagnostics: nil, fallback_credit_token: nil, fallbacks: nil, inference_geo: nil, mcp_servers: nil, metadata: nil, output_config: nil, output_format: nil, service_tier: nil, speed: nil, stop_sequences: nil, system_: nil, thinking: nil, tool_choice: nil, tools: nil, betas: nil, user_profile_id: nil, workspace_id: nil, request_options: {})
|
|
198
|
+
# @overload stream_raw(max_tokens:, messages:, model:, cache_control: nil, compaction: nil, container: nil, context_management: nil, diagnostics: nil, fallback_credit_token: nil, fallbacks: nil, inference_geo: nil, mcp_servers: nil, metadata: nil, output_config: nil, output_format: nil, service_tier: nil, speed: nil, stop_sequences: nil, system_: nil, thinking: nil, thread: nil, tool_choice: nil, tools: nil, betas: nil, user_profile_id: nil, workspace_id: nil, request_options: {})
|
|
152
199
|
#
|
|
153
200
|
# @param max_tokens [Integer] Body param: The maximum number of tokens to generate before stopping.
|
|
154
201
|
#
|
|
@@ -190,6 +237,8 @@ module Anthropic
|
|
|
190
237
|
#
|
|
191
238
|
# @param thinking [Anthropic::Models::Beta::BetaThinkingConfigEnabled, Anthropic::Models::Beta::BetaThinkingConfigDisabled, Anthropic::Models::Beta::BetaThinkingConfigBetweenTools, Anthropic::Models::Beta::BetaThinkingConfigAdaptive] Body param: Configuration for Claude's thinking.
|
|
192
239
|
#
|
|
240
|
+
# @param thread [Anthropic::Models::Beta::BetaThreadCreateParams, Anthropic::Models::Beta::BetaThreadContinueParams, nil] Body param: Server-held conversation state (a Thread). `{"type": "create"}` asks
|
|
241
|
+
#
|
|
193
242
|
# @param tool_choice [Anthropic::Models::Beta::BetaToolChoiceAuto, Anthropic::Models::Beta::BetaToolChoiceAny, Anthropic::Models::Beta::BetaToolChoiceTool, Anthropic::Models::Beta::BetaToolChoiceNone] Body param: How the model should use the provided tools. The model can use a spe
|
|
194
243
|
#
|
|
195
244
|
# @param tools [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, Anthropic::Models::Beta::BetaCodeExecutionTool20250825, Anthropic::Models::Beta::BetaCodeExecutionTool20260120, Anthropic::Models::Beta::BetaCodeExecutionTool20260521, Anthropic::Models::Beta::BetaBrowserToolset20260801, Anthropic::Models::Beta::BetaToolComputerUse20241022, Anthropic::Models::Beta::BetaMemoryTool20250818, Anthropic::Models::Beta::BetaToolComputerUse20250124, Anthropic::Models::Beta::BetaToolTextEditor20241022, Anthropic::Models::Beta::BetaToolComputerUse20251124, Anthropic::Models::Beta::BetaComputerToolset20260801, Anthropic::Models::Beta::BetaToolTextEditor20250124, Anthropic::Models::Beta::BetaToolTextEditor20250429, Anthropic::Models::Beta::BetaToolTextEditor20250728, Anthropic::Models::Beta::BetaWebSearchTool20250305, Anthropic::Models::Beta::BetaWebFetchTool20250910, Anthropic::Models::Beta::BetaWebSearchTool20260209, Anthropic::Models::Beta::BetaWebFetchTool20260209, Anthropic::Models::Beta::BetaWebFetchTool20260309, Anthropic::Models::Beta::BetaWebSearchTool20260318, Anthropic::Models::Beta::BetaWebFetchTool20260318, Anthropic::Models::Beta::BetaAdvisorTool20260301, Anthropic::Models::Beta::BetaToolSearchToolBm25_20251119, Anthropic::Models::Beta::BetaToolSearchToolRegex20251119, Anthropic::Models::Beta::BetaMCPToolset>] Body param: Definitions of tools that the model may use.
|
|
@@ -318,7 +367,7 @@ module Anthropic
|
|
|
318
367
|
# Some parameter documentations has been truncated, see
|
|
319
368
|
# {Anthropic::Models::Beta::MessageCreateParams} for more details.
|
|
320
369
|
#
|
|
321
|
-
# @overload stream(max_tokens:, messages:, model:, cache_control: nil, compaction: nil, container: nil, context_management: nil, diagnostics: nil, fallback_credit_token: nil, fallbacks: nil, inference_geo: nil, mcp_servers: nil, metadata: nil, output_config: nil, output_format: nil, service_tier: nil, speed: nil, stop_sequences: nil, system_: nil, thinking: nil, tool_choice: nil, tools: nil, betas: nil, user_profile_id: nil, workspace_id: nil, request_options: {})
|
|
370
|
+
# @overload stream(max_tokens:, messages:, model:, cache_control: nil, compaction: nil, container: nil, context_management: nil, diagnostics: nil, fallback_credit_token: nil, fallbacks: nil, inference_geo: nil, mcp_servers: nil, metadata: nil, output_config: nil, output_format: nil, service_tier: nil, speed: nil, stop_sequences: nil, system_: nil, thinking: nil, thread: nil, tool_choice: nil, tools: nil, betas: nil, user_profile_id: nil, workspace_id: nil, request_options: {})
|
|
322
371
|
#
|
|
323
372
|
# @param max_tokens [Integer] Body param: The maximum number of tokens to generate before stopping.
|
|
324
373
|
#
|
|
@@ -360,6 +409,8 @@ module Anthropic
|
|
|
360
409
|
#
|
|
361
410
|
# @param thinking [Anthropic::Models::Beta::BetaThinkingConfigEnabled, Anthropic::Models::Beta::BetaThinkingConfigDisabled, Anthropic::Models::Beta::BetaThinkingConfigBetweenTools, Anthropic::Models::Beta::BetaThinkingConfigAdaptive] Body param: Configuration for Claude's thinking.
|
|
362
411
|
#
|
|
412
|
+
# @param thread [Anthropic::Models::Beta::BetaThreadCreateParams, Anthropic::Models::Beta::BetaThreadContinueParams, nil] Body param: Server-held conversation state (a Thread). `{"type": "create"}` asks
|
|
413
|
+
#
|
|
363
414
|
# @param tool_choice [Anthropic::Models::Beta::BetaToolChoiceAuto, Anthropic::Models::Beta::BetaToolChoiceAny, Anthropic::Models::Beta::BetaToolChoiceTool, Anthropic::Models::Beta::BetaToolChoiceNone] Body param: How the model should use the provided tools. The model can use a spe
|
|
364
415
|
#
|
|
365
416
|
# @param tools [Array<Anthropic::Models::Beta::BetaTool, Anthropic::Models::Beta::BetaToolBash20241022, Anthropic::Models::Beta::BetaToolBash20250124, Anthropic::Models::Beta::BetaCodeExecutionTool20250522, Anthropic::Models::Beta::BetaCodeExecutionTool20250825, Anthropic::Models::Beta::BetaCodeExecutionTool20260120, Anthropic::Models::Beta::BetaCodeExecutionTool20260521, Anthropic::Models::Beta::BetaBrowserToolset20260801, Anthropic::Models::Beta::BetaToolComputerUse20241022, Anthropic::Models::Beta::BetaMemoryTool20250818, Anthropic::Models::Beta::BetaToolComputerUse20250124, Anthropic::Models::Beta::BetaToolTextEditor20241022, Anthropic::Models::Beta::BetaToolComputerUse20251124, Anthropic::Models::Beta::BetaComputerToolset20260801, Anthropic::Models::Beta::BetaToolTextEditor20250124, Anthropic::Models::Beta::BetaToolTextEditor20250429, Anthropic::Models::Beta::BetaToolTextEditor20250728, Anthropic::Models::Beta::BetaWebSearchTool20250305, Anthropic::Models::Beta::BetaWebFetchTool20250910, Anthropic::Models::Beta::BetaWebSearchTool20260209, Anthropic::Models::Beta::BetaWebFetchTool20260209, Anthropic::Models::Beta::BetaWebFetchTool20260309, Anthropic::Models::Beta::BetaWebSearchTool20260318, Anthropic::Models::Beta::BetaWebFetchTool20260318, Anthropic::Models::Beta::BetaAdvisorTool20260301, Anthropic::Models::Beta::BetaToolSearchToolBm25_20251119, Anthropic::Models::Beta::BetaToolSearchToolRegex20251119, Anthropic::Models::Beta::BetaMCPToolset>] Body param: Definitions of tools that the model may use.
|
|
@@ -381,6 +432,29 @@ module Anthropic
|
|
|
381
432
|
|
|
382
433
|
private
|
|
383
434
|
|
|
435
|
+
# The message thread of a tool runner, `nil` when the runner sends the whole history with
|
|
436
|
+
# every request. Removes `thread` from `params`.
|
|
437
|
+
#
|
|
438
|
+
# @param params [Hash{Symbol=>Object}]
|
|
439
|
+
#
|
|
440
|
+
# @return [Anthropic::Helpers::Threads::BetaMessageThread, nil]
|
|
441
|
+
def runner_thread(params)
|
|
442
|
+
thread = params.delete(:thread)
|
|
443
|
+
unless thread.nil? || thread == false
|
|
444
|
+
raise ArgumentError.new(
|
|
445
|
+
"`thread` on a tool runner can only be `false`, got #{thread.inspect}. " \
|
|
446
|
+
"The runner sets `thread` for each request itself."
|
|
447
|
+
)
|
|
448
|
+
end
|
|
449
|
+
return nil if thread == false || !@client.message_threads?
|
|
450
|
+
|
|
451
|
+
Anthropic::Helpers::Threads::BetaMessageThread.new(
|
|
452
|
+
@client,
|
|
453
|
+
params: {},
|
|
454
|
+
unsupported_request_behavior: :continue_unthreaded
|
|
455
|
+
)
|
|
456
|
+
end
|
|
457
|
+
|
|
384
458
|
def warn_thinking_enabled(parsed)
|
|
385
459
|
if Anthropic::Resources::Messages::MODELS_TO_WARN_WITH_THINKING_ENABLED.include?(parsed[:model]) &&
|
|
386
460
|
parsed[:thinking] &&
|