anthropic 1.45.0 → 1.47.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 +16 -0
- data/README.md +1 -1
- data/lib/anthropic/helpers/streaming/message_stream.rb +4 -0
- data/lib/anthropic/models/anthropic_beta.rb +6 -0
- data/lib/anthropic/models/beta/agent_create_params.rb +8 -8
- data/lib/anthropic/models/beta/agent_update_params.rb +7 -10
- data/lib/anthropic/models/beta/beta_advisor_tool_20260301.rb +15 -1
- data/lib/anthropic/models/beta/beta_advisor_tool_result_error.rb +1 -0
- data/lib/anthropic/models/beta/beta_advisor_tool_result_error_param.rb +1 -0
- data/lib/anthropic/models/beta/beta_content_block.rb +14 -1
- data/lib/anthropic/models/beta/beta_content_block_param.rb +18 -1
- data/lib/anthropic/models/beta/beta_fallback_block.rb +54 -0
- data/lib/anthropic/models/beta/beta_fallback_block_param.rb +51 -0
- data/lib/anthropic/models/beta/beta_fallback_info.rb +28 -0
- data/lib/anthropic/models/beta/beta_fallback_info_param.rb +28 -0
- data/lib/anthropic/models/beta/beta_fallback_message_iteration_usage.rb +81 -0
- data/lib/anthropic/models/beta/beta_fallback_param.rb +88 -0
- data/lib/anthropic/models/beta/beta_iterations_usage.rb +9 -1
- data/lib/anthropic/models/beta/beta_managed_agents_custom_tool_input_schema.rb +10 -27
- data/lib/anthropic/models/beta/beta_managed_agents_model.rb +5 -0
- data/lib/anthropic/models/beta/beta_message.rb +2 -2
- data/lib/anthropic/models/beta/beta_message_delta_usage.rb +2 -2
- data/lib/anthropic/models/beta/beta_message_iteration_usage.rb +15 -1
- data/lib/anthropic/models/beta/beta_message_param.rb +3 -3
- data/lib/anthropic/models/beta/beta_model_info.rb +11 -1
- data/lib/anthropic/models/beta/beta_raw_content_block_start_event.rb +16 -3
- data/lib/anthropic/models/beta/beta_refusal_stop_details.rb +64 -1
- data/lib/anthropic/models/beta/beta_tool_search_tool_result_error_param.rb +7 -1
- data/lib/anthropic/models/beta/beta_usage.rb +2 -2
- data/lib/anthropic/models/beta/beta_webhook_session_archived_event_data.rb +2 -2
- data/lib/anthropic/models/beta/beta_webhook_session_created_event_data.rb +2 -2
- data/lib/anthropic/models/beta/beta_webhook_session_deleted_event_data.rb +2 -2
- data/lib/anthropic/models/beta/beta_webhook_session_idled_event_data.rb +2 -2
- data/lib/anthropic/models/beta/beta_webhook_session_outcome_evaluation_ended_event_data.rb +2 -2
- data/lib/anthropic/models/beta/beta_webhook_session_pending_event_data.rb +2 -2
- data/lib/anthropic/models/beta/beta_webhook_session_requires_action_event_data.rb +2 -2
- data/lib/anthropic/models/beta/beta_webhook_session_running_event_data.rb +2 -2
- data/lib/anthropic/models/beta/beta_webhook_session_status_idled_event_data.rb +2 -2
- data/lib/anthropic/models/beta/beta_webhook_session_status_rescheduled_event_data.rb +2 -2
- data/lib/anthropic/models/beta/beta_webhook_session_status_run_started_event_data.rb +2 -2
- data/lib/anthropic/models/beta/beta_webhook_session_status_terminated_event_data.rb +2 -2
- data/lib/anthropic/models/beta/beta_webhook_session_thread_created_event_data.rb +2 -2
- data/lib/anthropic/models/beta/beta_webhook_session_thread_idled_event_data.rb +2 -2
- data/lib/anthropic/models/beta/beta_webhook_session_thread_terminated_event_data.rb +2 -2
- data/lib/anthropic/models/beta/beta_webhook_vault_archived_event_data.rb +2 -2
- data/lib/anthropic/models/beta/beta_webhook_vault_created_event_data.rb +2 -2
- data/lib/anthropic/models/beta/beta_webhook_vault_credential_archived_event_data.rb +2 -2
- data/lib/anthropic/models/beta/beta_webhook_vault_credential_created_event_data.rb +2 -2
- data/lib/anthropic/models/beta/beta_webhook_vault_credential_deleted_event_data.rb +2 -2
- data/lib/anthropic/models/beta/beta_webhook_vault_credential_refresh_failed_event_data.rb +2 -2
- data/lib/anthropic/models/beta/beta_webhook_vault_deleted_event_data.rb +2 -2
- data/lib/anthropic/models/beta/message_create_params.rb +39 -1
- data/lib/anthropic/models/beta/messages/batch_create_params.rb +39 -1
- data/lib/anthropic/models/beta/session_list_params.rb +2 -2
- data/lib/anthropic/models/model.rb +13 -0
- data/lib/anthropic/models/refusal_stop_details.rb +1 -0
- data/lib/anthropic/models/tool_search_tool_result_error_param.rb +7 -1
- data/lib/anthropic/resources/beta/agents.rb +7 -7
- data/lib/anthropic/resources/beta/messages.rb +10 -2
- data/lib/anthropic/resources/beta/sessions.rb +1 -1
- data/lib/anthropic/version.rb +1 -1
- data/lib/anthropic.rb +6 -0
- data/rbi/anthropic/models/anthropic_beta.rbi +10 -0
- data/rbi/anthropic/models/beta/agent_create_params.rbi +8 -8
- data/rbi/anthropic/models/beta/agent_update_params.rbi +6 -12
- data/rbi/anthropic/models/beta/beta_advisor_tool_20260301.rbi +20 -0
- data/rbi/anthropic/models/beta/beta_advisor_tool_result_error.rbi +5 -0
- data/rbi/anthropic/models/beta/beta_advisor_tool_result_error_param.rbi +5 -0
- data/rbi/anthropic/models/beta/beta_content_block.rbi +2 -1
- data/rbi/anthropic/models/beta/beta_content_block_param.rbi +2 -1
- data/rbi/anthropic/models/beta/beta_fallback_block.rbi +83 -0
- data/rbi/anthropic/models/beta/beta_fallback_block_param.rbi +81 -0
- data/rbi/anthropic/models/beta/beta_fallback_info.rbi +45 -0
- data/rbi/anthropic/models/beta/beta_fallback_info_param.rbi +47 -0
- data/rbi/anthropic/models/beta/beta_fallback_message_iteration_usage.rbi +113 -0
- data/rbi/anthropic/models/beta/beta_fallback_param.rbi +167 -0
- data/rbi/anthropic/models/beta/beta_iterations_usage.rbi +2 -1
- data/rbi/anthropic/models/beta/beta_managed_agents_custom_tool_input_schema.rbi +9 -68
- data/rbi/anthropic/models/beta/beta_managed_agents_model.rbi +7 -0
- data/rbi/anthropic/models/beta/beta_message.rbi +2 -1
- data/rbi/anthropic/models/beta/beta_message_delta_usage.rbi +2 -1
- data/rbi/anthropic/models/beta/beta_message_iteration_usage.rbi +14 -0
- data/rbi/anthropic/models/beta/beta_model_info.rbi +12 -0
- data/rbi/anthropic/models/beta/beta_raw_content_block_start_event.rbi +4 -2
- data/rbi/anthropic/models/beta/beta_refusal_stop_details.rbi +105 -0
- data/rbi/anthropic/models/beta/beta_tool_search_tool_result_error_param.rbi +11 -2
- data/rbi/anthropic/models/beta/beta_usage.rbi +2 -1
- data/rbi/anthropic/models/beta/beta_webhook_session_archived_event_data.rbi +2 -2
- data/rbi/anthropic/models/beta/beta_webhook_session_created_event_data.rbi +2 -2
- data/rbi/anthropic/models/beta/beta_webhook_session_deleted_event_data.rbi +2 -2
- data/rbi/anthropic/models/beta/beta_webhook_session_idled_event_data.rbi +2 -2
- data/rbi/anthropic/models/beta/beta_webhook_session_outcome_evaluation_ended_event_data.rbi +2 -2
- data/rbi/anthropic/models/beta/beta_webhook_session_pending_event_data.rbi +2 -2
- data/rbi/anthropic/models/beta/beta_webhook_session_requires_action_event_data.rbi +2 -2
- data/rbi/anthropic/models/beta/beta_webhook_session_running_event_data.rbi +2 -2
- data/rbi/anthropic/models/beta/beta_webhook_session_status_idled_event_data.rbi +2 -2
- data/rbi/anthropic/models/beta/beta_webhook_session_status_rescheduled_event_data.rbi +2 -2
- data/rbi/anthropic/models/beta/beta_webhook_session_status_run_started_event_data.rbi +2 -2
- data/rbi/anthropic/models/beta/beta_webhook_session_status_terminated_event_data.rbi +2 -2
- data/rbi/anthropic/models/beta/beta_webhook_session_thread_created_event_data.rbi +2 -2
- data/rbi/anthropic/models/beta/beta_webhook_session_thread_idled_event_data.rbi +2 -2
- data/rbi/anthropic/models/beta/beta_webhook_session_thread_terminated_event_data.rbi +2 -2
- data/rbi/anthropic/models/beta/beta_webhook_vault_archived_event_data.rbi +2 -2
- data/rbi/anthropic/models/beta/beta_webhook_vault_created_event_data.rbi +2 -2
- data/rbi/anthropic/models/beta/beta_webhook_vault_credential_archived_event_data.rbi +2 -2
- data/rbi/anthropic/models/beta/beta_webhook_vault_credential_created_event_data.rbi +2 -2
- data/rbi/anthropic/models/beta/beta_webhook_vault_credential_deleted_event_data.rbi +2 -2
- data/rbi/anthropic/models/beta/beta_webhook_vault_credential_refresh_failed_event_data.rbi +2 -2
- data/rbi/anthropic/models/beta/beta_webhook_vault_deleted_event_data.rbi +2 -2
- data/rbi/anthropic/models/beta/message_create_params.rbi +58 -0
- data/rbi/anthropic/models/beta/messages/batch_create_params.rbi +62 -0
- data/rbi/anthropic/models/beta/session_list_params.rbi +2 -2
- data/rbi/anthropic/models/model.rbi +7 -0
- data/rbi/anthropic/models/refusal_stop_details.rbi +5 -0
- data/rbi/anthropic/models/tool_search_tool_result_error_param.rbi +11 -2
- data/rbi/anthropic/resources/beta/agents.rbi +8 -10
- data/rbi/anthropic/resources/beta/messages.rbi +54 -0
- data/rbi/anthropic/resources/beta/sessions.rbi +1 -1
- data/sig/anthropic/models/anthropic_beta.rbs +4 -0
- data/sig/anthropic/models/beta/beta_advisor_tool_20260301.rbs +5 -0
- data/sig/anthropic/models/beta/beta_advisor_tool_result_error.rbs +2 -0
- data/sig/anthropic/models/beta/beta_advisor_tool_result_error_param.rbs +2 -0
- data/sig/anthropic/models/beta/beta_content_block.rbs +1 -0
- data/sig/anthropic/models/beta/beta_content_block_param.rbs +1 -0
- data/sig/anthropic/models/beta/beta_fallback_block.rbs +34 -0
- data/sig/anthropic/models/beta/beta_fallback_block_param.rbs +34 -0
- data/sig/anthropic/models/beta/beta_fallback_info.rbs +17 -0
- data/sig/anthropic/models/beta/beta_fallback_info_param.rbs +17 -0
- data/sig/anthropic/models/beta/beta_fallback_message_iteration_usage.rbs +54 -0
- data/sig/anthropic/models/beta/beta_fallback_param.rbs +66 -0
- data/sig/anthropic/models/beta/beta_iterations_usage.rbs +1 -0
- data/sig/anthropic/models/beta/beta_managed_agents_custom_tool_input_schema.rbs +9 -25
- data/sig/anthropic/models/beta/beta_managed_agents_model.rbs +5 -1
- data/sig/anthropic/models/beta/beta_message_iteration_usage.rbs +5 -0
- data/sig/anthropic/models/beta/beta_model_info.rbs +5 -0
- data/sig/anthropic/models/beta/beta_raw_content_block_start_event.rbs +1 -0
- data/sig/anthropic/models/beta/beta_refusal_stop_details.rbs +17 -1
- data/sig/anthropic/models/beta/beta_tool_search_tool_result_error_param.rbs +7 -2
- data/sig/anthropic/models/beta/message_create_params.rbs +10 -0
- data/sig/anthropic/models/beta/messages/batch_create_params.rbs +10 -0
- data/sig/anthropic/models/model.rbs +9 -1
- data/sig/anthropic/models/refusal_stop_details.rbs +2 -1
- data/sig/anthropic/models/tool_search_tool_result_error_param.rbs +7 -2
- data/sig/anthropic/resources/beta/messages.rbs +4 -0
- metadata +20 -2
|
@@ -18,8 +18,16 @@ module Anthropic
|
|
|
18
18
|
# Token usage for an advisor sub-inference iteration.
|
|
19
19
|
variant :advisor_message, -> { Anthropic::Beta::BetaAdvisorMessageIterationUsage }
|
|
20
20
|
|
|
21
|
+
# Token usage for the fallback-model attempt of a server-side fallback request.
|
|
22
|
+
#
|
|
23
|
+
# Produced in place of a `message` entry for whichever hop served the
|
|
24
|
+
# response. A declined hop produces the existing `message` entry. Whether
|
|
25
|
+
# a fallback model served the response is signalled by the presence of this
|
|
26
|
+
# entry in `usage.iterations`.
|
|
27
|
+
variant :fallback_message, -> { Anthropic::Beta::BetaFallbackMessageIterationUsage }
|
|
28
|
+
|
|
21
29
|
# @!method self.variants
|
|
22
|
-
# @return [Array(Anthropic::Models::Beta::BetaMessageIterationUsage, Anthropic::Models::Beta::BetaCompactionIterationUsage, Anthropic::Models::Beta::BetaAdvisorMessageIterationUsage)]
|
|
30
|
+
# @return [Array(Anthropic::Models::Beta::BetaMessageIterationUsage, Anthropic::Models::Beta::BetaCompactionIterationUsage, Anthropic::Models::Beta::BetaAdvisorMessageIterationUsage, Anthropic::Models::Beta::BetaFallbackMessageIterationUsage)]
|
|
23
31
|
end
|
|
24
32
|
|
|
25
33
|
# @type [Anthropic::Internal::Type::Converter]
|
|
@@ -4,8 +4,12 @@ module Anthropic
|
|
|
4
4
|
module Models
|
|
5
5
|
module Beta
|
|
6
6
|
class BetaManagedAgentsCustomToolInputSchema < Anthropic::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute type
|
|
8
|
+
#
|
|
9
|
+
# @return [Symbol, :object]
|
|
10
|
+
required :type, const: :object
|
|
11
|
+
|
|
7
12
|
# @!attribute properties
|
|
8
|
-
# JSON Schema properties defining the tool's input parameters.
|
|
9
13
|
#
|
|
10
14
|
# @return [Hash{Symbol=>Object}, nil]
|
|
11
15
|
optional :properties,
|
|
@@ -13,37 +17,16 @@ module Anthropic
|
|
|
13
17
|
nil?: true
|
|
14
18
|
|
|
15
19
|
# @!attribute required
|
|
16
|
-
# List of required property names.
|
|
17
20
|
#
|
|
18
21
|
# @return [Array<String>, nil]
|
|
19
|
-
optional :required, Anthropic::Internal::Type::ArrayOf[String]
|
|
20
|
-
|
|
21
|
-
# @!attribute type
|
|
22
|
-
# Must be 'object' for tool input schemas.
|
|
23
|
-
#
|
|
24
|
-
# @return [Symbol, Anthropic::Models::Beta::BetaManagedAgentsCustomToolInputSchema::Type, nil]
|
|
25
|
-
optional :type, enum: -> { Anthropic::Beta::BetaManagedAgentsCustomToolInputSchema::Type }
|
|
22
|
+
optional :required, Anthropic::Internal::Type::ArrayOf[String], nil?: true
|
|
26
23
|
|
|
27
|
-
# @!method initialize(properties: nil, required: nil, type:
|
|
24
|
+
# @!method initialize(properties: nil, required: nil, type: :object)
|
|
28
25
|
# JSON Schema for custom tool input parameters.
|
|
29
26
|
#
|
|
30
|
-
# @param properties [Hash{Symbol=>Object}, nil]
|
|
31
|
-
#
|
|
32
|
-
# @param
|
|
33
|
-
#
|
|
34
|
-
# @param type [Symbol, Anthropic::Models::Beta::BetaManagedAgentsCustomToolInputSchema::Type] Must be 'object' for tool input schemas.
|
|
35
|
-
|
|
36
|
-
# Must be 'object' for tool input schemas.
|
|
37
|
-
#
|
|
38
|
-
# @see Anthropic::Models::Beta::BetaManagedAgentsCustomToolInputSchema#type
|
|
39
|
-
module Type
|
|
40
|
-
extend Anthropic::Internal::Type::Enum
|
|
41
|
-
|
|
42
|
-
OBJECT = :object
|
|
43
|
-
|
|
44
|
-
# @!method self.values
|
|
45
|
-
# @return [Array<Symbol>]
|
|
46
|
-
end
|
|
27
|
+
# @param properties [Hash{Symbol=>Object}, nil]
|
|
28
|
+
# @param required [Array<String>, nil]
|
|
29
|
+
# @param type [Symbol, :object]
|
|
47
30
|
end
|
|
48
31
|
end
|
|
49
32
|
|
|
@@ -10,6 +10,8 @@ module Anthropic
|
|
|
10
10
|
module BetaManagedAgentsModel
|
|
11
11
|
extend Anthropic::Internal::Type::Union
|
|
12
12
|
|
|
13
|
+
variant const: -> { Anthropic::Models::Beta::BetaManagedAgentsModel::CLAUDE_FABLE_5 }
|
|
14
|
+
|
|
13
15
|
variant const: -> { Anthropic::Models::Beta::BetaManagedAgentsModel::CLAUDE_OPUS_4_8 }
|
|
14
16
|
|
|
15
17
|
variant const: -> { Anthropic::Models::Beta::BetaManagedAgentsModel::CLAUDE_OPUS_4_7 }
|
|
@@ -41,6 +43,9 @@ module Anthropic
|
|
|
41
43
|
|
|
42
44
|
# @!group
|
|
43
45
|
|
|
46
|
+
# Next generation of intelligence for the hardest knowledge work and coding problems
|
|
47
|
+
CLAUDE_FABLE_5 = :"claude-fable-5"
|
|
48
|
+
|
|
44
49
|
# Frontier intelligence for long-running agents and coding
|
|
45
50
|
CLAUDE_OPUS_4_8 = :"claude-opus-4-8"
|
|
46
51
|
|
|
@@ -56,7 +56,7 @@ module Anthropic
|
|
|
56
56
|
# [{ "type": "text", "text": "B)" }]
|
|
57
57
|
# ```
|
|
58
58
|
#
|
|
59
|
-
# @return [Array<Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaWebFetchToolResultBlock, Anthropic::Models::Beta::BetaAdvisorToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaToolSearchToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock, Anthropic::Models::Beta::BetaCompactionBlock>]
|
|
59
|
+
# @return [Array<Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaWebFetchToolResultBlock, Anthropic::Models::Beta::BetaAdvisorToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaToolSearchToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock, Anthropic::Models::Beta::BetaCompactionBlock, Anthropic::Models::Beta::BetaFallbackBlock>]
|
|
60
60
|
required :content, -> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::Beta::BetaContentBlock] }
|
|
61
61
|
|
|
62
62
|
# parsed value of response when a JSON output schema object has been specified via :output_format
|
|
@@ -174,7 +174,7 @@ module Anthropic
|
|
|
174
174
|
#
|
|
175
175
|
# @param container [Anthropic::Models::Beta::BetaContainer, nil] Information about the container used in the request (for the code execution tool
|
|
176
176
|
#
|
|
177
|
-
# @param content [Array<Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaWebFetchToolResultBlock, Anthropic::Models::Beta::BetaAdvisorToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaToolSearchToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock, Anthropic::Models::Beta::BetaCompactionBlock>] Content generated by the model.
|
|
177
|
+
# @param content [Array<Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaWebFetchToolResultBlock, Anthropic::Models::Beta::BetaAdvisorToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaToolSearchToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock, Anthropic::Models::Beta::BetaCompactionBlock, Anthropic::Models::Beta::BetaFallbackBlock>] Content generated by the model.
|
|
178
178
|
#
|
|
179
179
|
# @param context_management [Anthropic::Models::Beta::BetaContextManagementResponse, nil] Context management response.
|
|
180
180
|
#
|
|
@@ -32,7 +32,7 @@ module Anthropic
|
|
|
32
32
|
# - Calculate the true context window size from the last iteration
|
|
33
33
|
# - Understand token accumulation across server-side tool use loops
|
|
34
34
|
#
|
|
35
|
-
# @return [Array<Anthropic::Models::Beta::BetaMessageIterationUsage, Anthropic::Models::Beta::BetaCompactionIterationUsage, Anthropic::Models::Beta::BetaAdvisorMessageIterationUsage>, nil]
|
|
35
|
+
# @return [Array<Anthropic::Models::Beta::BetaMessageIterationUsage, Anthropic::Models::Beta::BetaCompactionIterationUsage, Anthropic::Models::Beta::BetaAdvisorMessageIterationUsage, Anthropic::Models::Beta::BetaFallbackMessageIterationUsage>, nil]
|
|
36
36
|
required :iterations,
|
|
37
37
|
-> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::Beta::BetaIterationsUsageItem] },
|
|
38
38
|
nil?: true
|
|
@@ -70,7 +70,7 @@ module Anthropic
|
|
|
70
70
|
#
|
|
71
71
|
# @param input_tokens [Integer, nil] The cumulative number of input tokens which were used.
|
|
72
72
|
#
|
|
73
|
-
# @param iterations [Array<Anthropic::Models::Beta::BetaMessageIterationUsage, Anthropic::Models::Beta::BetaCompactionIterationUsage, Anthropic::Models::Beta::BetaAdvisorMessageIterationUsage>, nil] Per-iteration token usage breakdown.
|
|
73
|
+
# @param iterations [Array<Anthropic::Models::Beta::BetaMessageIterationUsage, Anthropic::Models::Beta::BetaCompactionIterationUsage, Anthropic::Models::Beta::BetaAdvisorMessageIterationUsage, Anthropic::Models::Beta::BetaFallbackMessageIterationUsage>, nil] Per-iteration token usage breakdown.
|
|
74
74
|
#
|
|
75
75
|
# @param output_tokens [Integer] The cumulative number of output tokens which were used.
|
|
76
76
|
#
|
|
@@ -28,6 +28,15 @@ module Anthropic
|
|
|
28
28
|
# @return [Integer]
|
|
29
29
|
required :input_tokens, Integer
|
|
30
30
|
|
|
31
|
+
# @!attribute model
|
|
32
|
+
# The model that will complete your prompt.
|
|
33
|
+
#
|
|
34
|
+
# See [models](https://docs.anthropic.com/en/docs/models-overview) for additional
|
|
35
|
+
# details and options.
|
|
36
|
+
#
|
|
37
|
+
# @return [Symbol, String, Anthropic::Models::Model]
|
|
38
|
+
required :model, union: -> { Anthropic::Model }
|
|
39
|
+
|
|
31
40
|
# @!attribute output_tokens
|
|
32
41
|
# The number of output tokens which were used.
|
|
33
42
|
#
|
|
@@ -40,7 +49,10 @@ module Anthropic
|
|
|
40
49
|
# @return [Symbol, :message]
|
|
41
50
|
required :type, const: :message
|
|
42
51
|
|
|
43
|
-
# @!method initialize(cache_creation:, cache_creation_input_tokens:, cache_read_input_tokens:, input_tokens:, output_tokens:, type: :message)
|
|
52
|
+
# @!method initialize(cache_creation:, cache_creation_input_tokens:, cache_read_input_tokens:, input_tokens:, model:, output_tokens:, type: :message)
|
|
53
|
+
# Some parameter documentations has been truncated, see
|
|
54
|
+
# {Anthropic::Models::Beta::BetaMessageIterationUsage} for more details.
|
|
55
|
+
#
|
|
44
56
|
# Token usage for a sampling iteration.
|
|
45
57
|
#
|
|
46
58
|
# @param cache_creation [Anthropic::Models::Beta::BetaCacheCreation, nil] Breakdown of cached tokens by TTL
|
|
@@ -51,6 +63,8 @@ module Anthropic
|
|
|
51
63
|
#
|
|
52
64
|
# @param input_tokens [Integer] The number of input tokens which were used.
|
|
53
65
|
#
|
|
66
|
+
# @param model [Symbol, String, Anthropic::Models::Model] The model that will complete your prompt.
|
|
67
|
+
#
|
|
54
68
|
# @param output_tokens [Integer] The number of output tokens which were used.
|
|
55
69
|
#
|
|
56
70
|
# @param type [Symbol, :message] Usage for a sampling iteration
|
|
@@ -6,7 +6,7 @@ module Anthropic
|
|
|
6
6
|
class BetaMessageParam < Anthropic::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute content
|
|
8
8
|
#
|
|
9
|
-
# @return [String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaWebFetchToolResultBlockParam, Anthropic::Models::Beta::BetaAdvisorToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaToolSearchToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam, Anthropic::Models::Beta::BetaCompactionBlockParam, Anthropic::Models::Beta::BetaMidConversationSystemBlockParam>]
|
|
9
|
+
# @return [String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaWebFetchToolResultBlockParam, Anthropic::Models::Beta::BetaAdvisorToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaToolSearchToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam, Anthropic::Models::Beta::BetaCompactionBlockParam, Anthropic::Models::Beta::BetaMidConversationSystemBlockParam, Anthropic::Models::Beta::BetaFallbackBlockParam>]
|
|
10
10
|
required :content, union: -> { Anthropic::Beta::BetaMessageParam::Content }
|
|
11
11
|
|
|
12
12
|
# @!attribute role
|
|
@@ -15,7 +15,7 @@ module Anthropic
|
|
|
15
15
|
required :role, enum: -> { Anthropic::Beta::BetaMessageParam::Role }
|
|
16
16
|
|
|
17
17
|
# @!method initialize(content:, role:)
|
|
18
|
-
# @param content [String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaWebFetchToolResultBlockParam, Anthropic::Models::Beta::BetaAdvisorToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaToolSearchToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam, Anthropic::Models::Beta::BetaCompactionBlockParam, Anthropic::Models::Beta::BetaMidConversationSystemBlockParam>]
|
|
18
|
+
# @param content [String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaWebFetchToolResultBlockParam, Anthropic::Models::Beta::BetaAdvisorToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaToolSearchToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam, Anthropic::Models::Beta::BetaCompactionBlockParam, Anthropic::Models::Beta::BetaMidConversationSystemBlockParam, Anthropic::Models::Beta::BetaFallbackBlockParam>]
|
|
19
19
|
# @param role [Symbol, Anthropic::Models::Beta::BetaMessageParam::Role]
|
|
20
20
|
|
|
21
21
|
# @see Anthropic::Models::Beta::BetaMessageParam#content
|
|
@@ -27,7 +27,7 @@ module Anthropic
|
|
|
27
27
|
variant -> { Anthropic::Models::Beta::BetaMessageParam::Content::BetaContentBlockParamArray }
|
|
28
28
|
|
|
29
29
|
# @!method self.variants
|
|
30
|
-
# @return [Array(String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaWebFetchToolResultBlockParam, Anthropic::Models::Beta::BetaAdvisorToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaToolSearchToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam, Anthropic::Models::Beta::BetaCompactionBlockParam, Anthropic::Models::Beta::BetaMidConversationSystemBlockParam>)]
|
|
30
|
+
# @return [Array(String, Array<Anthropic::Models::Beta::BetaTextBlockParam, Anthropic::Models::Beta::BetaImageBlockParam, Anthropic::Models::Beta::BetaRequestDocumentBlock, Anthropic::Models::Beta::BetaSearchResultBlockParam, Anthropic::Models::Beta::BetaThinkingBlockParam, Anthropic::Models::Beta::BetaRedactedThinkingBlockParam, Anthropic::Models::Beta::BetaToolUseBlockParam, Anthropic::Models::Beta::BetaToolResultBlockParam, Anthropic::Models::Beta::BetaServerToolUseBlockParam, Anthropic::Models::Beta::BetaWebSearchToolResultBlockParam, Anthropic::Models::Beta::BetaWebFetchToolResultBlockParam, Anthropic::Models::Beta::BetaAdvisorToolResultBlockParam, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlockParam, Anthropic::Models::Beta::BetaToolSearchToolResultBlockParam, Anthropic::Models::Beta::BetaMCPToolUseBlockParam, Anthropic::Models::Beta::BetaRequestMCPToolResultBlockParam, Anthropic::Models::Beta::BetaContainerUploadBlockParam, Anthropic::Models::Beta::BetaCompactionBlockParam, Anthropic::Models::Beta::BetaMidConversationSystemBlockParam, Anthropic::Models::Beta::BetaFallbackBlockParam>)]
|
|
31
31
|
|
|
32
32
|
# @type [Anthropic::Internal::Type::Converter]
|
|
33
33
|
BetaContentBlockParamArray =
|
|
@@ -11,6 +11,14 @@ module Anthropic
|
|
|
11
11
|
# @return [String]
|
|
12
12
|
required :id, String
|
|
13
13
|
|
|
14
|
+
# @!attribute allowed_fallback_models
|
|
15
|
+
# Model IDs this model accepts as `fallbacks[i].model` on the Messages API. An
|
|
16
|
+
# empty list means the `fallbacks` parameter is not supported for this model as
|
|
17
|
+
# primary.
|
|
18
|
+
#
|
|
19
|
+
# @return [Array<String>, nil]
|
|
20
|
+
required :allowed_fallback_models, Anthropic::Internal::Type::ArrayOf[String], nil?: true
|
|
21
|
+
|
|
14
22
|
# @!attribute capabilities
|
|
15
23
|
# Model capability information.
|
|
16
24
|
#
|
|
@@ -50,12 +58,14 @@ module Anthropic
|
|
|
50
58
|
# @return [Symbol, :model]
|
|
51
59
|
required :type, const: :model
|
|
52
60
|
|
|
53
|
-
# @!method initialize(id:, capabilities:, created_at:, display_name:, max_input_tokens:, max_tokens:, type: :model)
|
|
61
|
+
# @!method initialize(id:, allowed_fallback_models:, capabilities:, created_at:, display_name:, max_input_tokens:, max_tokens:, type: :model)
|
|
54
62
|
# Some parameter documentations has been truncated, see
|
|
55
63
|
# {Anthropic::Models::Beta::BetaModelInfo} for more details.
|
|
56
64
|
#
|
|
57
65
|
# @param id [String] Unique model identifier.
|
|
58
66
|
#
|
|
67
|
+
# @param allowed_fallback_models [Array<String>, nil] Model IDs this model accepts as `fallbacks[i].model` on the Messages API. An emp
|
|
68
|
+
#
|
|
59
69
|
# @param capabilities [Anthropic::Models::Beta::BetaModelCapabilities, nil] Model capability information.
|
|
60
70
|
#
|
|
61
71
|
# @param created_at [Time] RFC 3339 datetime string representing the time at which the model was released.
|
|
@@ -7,7 +7,7 @@ module Anthropic
|
|
|
7
7
|
# @!attribute content_block
|
|
8
8
|
# Response model for a file uploaded to the container.
|
|
9
9
|
#
|
|
10
|
-
# @return [Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaWebFetchToolResultBlock, Anthropic::Models::Beta::BetaAdvisorToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaToolSearchToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock, Anthropic::Models::Beta::BetaCompactionBlock]
|
|
10
|
+
# @return [Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaWebFetchToolResultBlock, Anthropic::Models::Beta::BetaAdvisorToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaToolSearchToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock, Anthropic::Models::Beta::BetaCompactionBlock, Anthropic::Models::Beta::BetaFallbackBlock]
|
|
11
11
|
required :content_block, union: -> { Anthropic::Beta::BetaRawContentBlockStartEvent::ContentBlock }
|
|
12
12
|
|
|
13
13
|
# @!attribute index
|
|
@@ -21,7 +21,7 @@ module Anthropic
|
|
|
21
21
|
required :type, const: :content_block_start
|
|
22
22
|
|
|
23
23
|
# @!method initialize(content_block:, index:, type: :content_block_start)
|
|
24
|
-
# @param content_block [Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaWebFetchToolResultBlock, Anthropic::Models::Beta::BetaAdvisorToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaToolSearchToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock, Anthropic::Models::Beta::BetaCompactionBlock] Response model for a file uploaded to the container.
|
|
24
|
+
# @param content_block [Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaWebFetchToolResultBlock, Anthropic::Models::Beta::BetaAdvisorToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaToolSearchToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock, Anthropic::Models::Beta::BetaCompactionBlock, Anthropic::Models::Beta::BetaFallbackBlock] Response model for a file uploaded to the container.
|
|
25
25
|
#
|
|
26
26
|
# @param index [Integer]
|
|
27
27
|
#
|
|
@@ -74,8 +74,21 @@ module Anthropic
|
|
|
74
74
|
# compaction blocks with null content; the server treats them as no-ops.
|
|
75
75
|
variant :compaction, -> { Anthropic::Beta::BetaCompactionBlock }
|
|
76
76
|
|
|
77
|
+
# Marks the point in `content` where one model's output gives way to the next.
|
|
78
|
+
#
|
|
79
|
+
# One block appears per hop where a preceding model actually ran this turn and
|
|
80
|
+
# declined. A turn routed directly by the sticky decision has no such boundary
|
|
81
|
+
# and carries no block — the signal for whether a fallback model served the
|
|
82
|
+
# response is the presence of a `fallback_message` entry in
|
|
83
|
+
# `usage.iterations`, not this block.
|
|
84
|
+
#
|
|
85
|
+
# The block is treated like a server-tool content block for streaming: it
|
|
86
|
+
# arrives via the standard `content_block_start` / `content_block_stop`
|
|
87
|
+
# pair and carries no deltas.
|
|
88
|
+
variant :fallback, -> { Anthropic::Beta::BetaFallbackBlock }
|
|
89
|
+
|
|
77
90
|
# @!method self.variants
|
|
78
|
-
# @return [Array(Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaWebFetchToolResultBlock, Anthropic::Models::Beta::BetaAdvisorToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaToolSearchToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock, Anthropic::Models::Beta::BetaCompactionBlock)]
|
|
91
|
+
# @return [Array(Anthropic::Models::Beta::BetaTextBlock, Anthropic::Models::Beta::BetaThinkingBlock, Anthropic::Models::Beta::BetaRedactedThinkingBlock, Anthropic::Models::Beta::BetaToolUseBlock, Anthropic::Models::Beta::BetaServerToolUseBlock, Anthropic::Models::Beta::BetaWebSearchToolResultBlock, Anthropic::Models::Beta::BetaWebFetchToolResultBlock, Anthropic::Models::Beta::BetaAdvisorToolResultBlock, Anthropic::Models::Beta::BetaCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaBashCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaTextEditorCodeExecutionToolResultBlock, Anthropic::Models::Beta::BetaToolSearchToolResultBlock, Anthropic::Models::Beta::BetaMCPToolUseBlock, Anthropic::Models::Beta::BetaMCPToolResultBlock, Anthropic::Models::Beta::BetaContainerUploadBlock, Anthropic::Models::Beta::BetaCompactionBlock, Anthropic::Models::Beta::BetaFallbackBlock)]
|
|
79
92
|
end
|
|
80
93
|
end
|
|
81
94
|
end
|
|
@@ -21,12 +21,68 @@ module Anthropic
|
|
|
21
21
|
# @return [String, nil]
|
|
22
22
|
required :explanation, String, nil?: true
|
|
23
23
|
|
|
24
|
+
# @!attribute fallback_credit_token
|
|
25
|
+
# Opaque code that refunds the cache-miss cost when retrying this refused request
|
|
26
|
+
# on the fallback model. Pass it as `fallback_credit_token` on the retry request.
|
|
27
|
+
# Expires 5 minutes after the refusal.
|
|
28
|
+
#
|
|
29
|
+
# The retry is sent either with the same request body (`system`, `messages`,
|
|
30
|
+
# `tools`, and other render-shaping fields), or with the same body plus one
|
|
31
|
+
# appended `assistant` message whose content is the partial text (with any
|
|
32
|
+
# trailing whitespace stripped from the final text block) and paired server-tool
|
|
33
|
+
# blocks from this refusal — which also authorizes that appended turn as an
|
|
34
|
+
# assistant-prefill continuation on models that otherwise disallow prefill. A
|
|
35
|
+
# token minted mid-server-tool-loop whose partial content was continuable may only
|
|
36
|
+
# be redeemed the second way — if a same-body retry is rejected with a 400 saying
|
|
37
|
+
# the token must be redeemed by continuing the partial response, retry the second
|
|
38
|
+
# way instead. Either way: same workspace, same platform; a mismatch is a 400.
|
|
39
|
+
# Resending a token for an already-warm prefix is permitted but yields no
|
|
40
|
+
# additional credit.
|
|
41
|
+
#
|
|
42
|
+
# `null` when the refused model isn't eligible for a fallback credit.
|
|
43
|
+
#
|
|
44
|
+
# @return [String, nil]
|
|
45
|
+
required :fallback_credit_token, String, nil?: true
|
|
46
|
+
|
|
47
|
+
# @!attribute fallback_has_prefill_claim
|
|
48
|
+
# Whether the accompanying `fallback_credit_token` may be redeemed with the
|
|
49
|
+
# appended-assistant retry form. Only set when `fallback_credit_token` is present.
|
|
50
|
+
#
|
|
51
|
+
# `true`: retry by resending the same request body plus one appended `assistant`
|
|
52
|
+
# message whose content is this response's `content` with any trailing whitespace
|
|
53
|
+
# stripped from the final text block and unpaired `tool_use` blocks omitted (the
|
|
54
|
+
# same appended-turn shape described on `fallback_credit_token`), with the token
|
|
55
|
+
# attached. `false`: retry by resending the original request body unchanged, with
|
|
56
|
+
# the token attached — the appended-assistant form is not available for this
|
|
57
|
+
# refusal (no continuable partial content, or the request uses `output_format` or
|
|
58
|
+
# a `tool_choice` that forces tool use). One exception: when the request used
|
|
59
|
+
# `output_format` or a forced `tool_choice` and the refusal arrived after server
|
|
60
|
+
# tools (including MCP connector tools) had already executed, the token may not be
|
|
61
|
+
# redeemable by either retry form; if the exact-body retry is then rejected with a
|
|
62
|
+
# 400 saying the token must be redeemed by continuing the partial response,
|
|
63
|
+
# discard the token and retry without it.
|
|
64
|
+
#
|
|
65
|
+
# Advisory: if an appended-assistant retry is rejected with a 400 despite `true`,
|
|
66
|
+
# fall back to resending the original request body with the token.
|
|
67
|
+
#
|
|
68
|
+
# @return [Boolean, nil]
|
|
69
|
+
required :fallback_has_prefill_claim, Anthropic::Internal::Type::Boolean, nil?: true
|
|
70
|
+
|
|
71
|
+
# @!attribute recommended_model
|
|
72
|
+
# The server's suggested retry target for this refusal. Populated when a fallback
|
|
73
|
+
# attempt could not be made (the fallback model's rate limit was exhausted, or it
|
|
74
|
+
# was overloaded); names the fallback model the caller can retry directly. Null
|
|
75
|
+
# otherwise.
|
|
76
|
+
#
|
|
77
|
+
# @return [String, nil]
|
|
78
|
+
required :recommended_model, String, nil?: true
|
|
79
|
+
|
|
24
80
|
# @!attribute type
|
|
25
81
|
#
|
|
26
82
|
# @return [Symbol, :refusal]
|
|
27
83
|
required :type, const: :refusal
|
|
28
84
|
|
|
29
|
-
# @!method initialize(category:, explanation:, type: :refusal)
|
|
85
|
+
# @!method initialize(category:, explanation:, fallback_credit_token:, fallback_has_prefill_claim:, recommended_model:, type: :refusal)
|
|
30
86
|
# Some parameter documentations has been truncated, see
|
|
31
87
|
# {Anthropic::Models::Beta::BetaRefusalStopDetails} for more details.
|
|
32
88
|
#
|
|
@@ -36,6 +92,12 @@ module Anthropic
|
|
|
36
92
|
#
|
|
37
93
|
# @param explanation [String, nil] Human-readable explanation of the refusal.
|
|
38
94
|
#
|
|
95
|
+
# @param fallback_credit_token [String, nil] Opaque code that refunds the cache-miss cost when retrying this refused
|
|
96
|
+
#
|
|
97
|
+
# @param fallback_has_prefill_claim [Boolean, nil] Whether the accompanying `fallback_credit_token` may be redeemed with the
|
|
98
|
+
#
|
|
99
|
+
# @param recommended_model [String, nil] The server's suggested retry target for this refusal. Populated when a fallback
|
|
100
|
+
#
|
|
39
101
|
# @param type [Symbol, :refusal]
|
|
40
102
|
|
|
41
103
|
# The policy category that triggered the refusal.
|
|
@@ -48,6 +110,7 @@ module Anthropic
|
|
|
48
110
|
|
|
49
111
|
CYBER = :cyber
|
|
50
112
|
BIO = :bio
|
|
113
|
+
REASONING_EXTRACTION = :reasoning_extraction
|
|
51
114
|
|
|
52
115
|
# @!method self.values
|
|
53
116
|
# @return [Array<Symbol>]
|
|
@@ -14,8 +14,14 @@ module Anthropic
|
|
|
14
14
|
# @return [Symbol, :tool_search_tool_result_error]
|
|
15
15
|
required :type, const: :tool_search_tool_result_error
|
|
16
16
|
|
|
17
|
-
# @!
|
|
17
|
+
# @!attribute error_message
|
|
18
|
+
#
|
|
19
|
+
# @return [String, nil]
|
|
20
|
+
optional :error_message, String, nil?: true
|
|
21
|
+
|
|
22
|
+
# @!method initialize(error_code:, error_message: nil, type: :tool_search_tool_result_error)
|
|
18
23
|
# @param error_code [Symbol, Anthropic::Models::Beta::BetaToolSearchToolResultErrorParam::ErrorCode]
|
|
24
|
+
# @param error_message [String, nil]
|
|
19
25
|
# @param type [Symbol, :tool_search_tool_result_error]
|
|
20
26
|
|
|
21
27
|
# @see Anthropic::Models::Beta::BetaToolSearchToolResultErrorParam#error_code
|
|
@@ -44,7 +44,7 @@ module Anthropic
|
|
|
44
44
|
# - Calculate the true context window size from the last iteration
|
|
45
45
|
# - Understand token accumulation across server-side tool use loops
|
|
46
46
|
#
|
|
47
|
-
# @return [Array<Anthropic::Models::Beta::BetaMessageIterationUsage, Anthropic::Models::Beta::BetaCompactionIterationUsage, Anthropic::Models::Beta::BetaAdvisorMessageIterationUsage>, nil]
|
|
47
|
+
# @return [Array<Anthropic::Models::Beta::BetaMessageIterationUsage, Anthropic::Models::Beta::BetaCompactionIterationUsage, Anthropic::Models::Beta::BetaAdvisorMessageIterationUsage, Anthropic::Models::Beta::BetaFallbackMessageIterationUsage>, nil]
|
|
48
48
|
required :iterations,
|
|
49
49
|
-> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::Beta::BetaIterationsUsageItem] },
|
|
50
50
|
nil?: true
|
|
@@ -98,7 +98,7 @@ module Anthropic
|
|
|
98
98
|
#
|
|
99
99
|
# @param input_tokens [Integer] The number of input tokens which were used.
|
|
100
100
|
#
|
|
101
|
-
# @param iterations [Array<Anthropic::Models::Beta::BetaMessageIterationUsage, Anthropic::Models::Beta::BetaCompactionIterationUsage, Anthropic::Models::Beta::BetaAdvisorMessageIterationUsage>, nil] Per-iteration token usage breakdown.
|
|
101
|
+
# @param iterations [Array<Anthropic::Models::Beta::BetaMessageIterationUsage, Anthropic::Models::Beta::BetaCompactionIterationUsage, Anthropic::Models::Beta::BetaAdvisorMessageIterationUsage, Anthropic::Models::Beta::BetaFallbackMessageIterationUsage>, nil] Per-iteration token usage breakdown.
|
|
102
102
|
#
|
|
103
103
|
# @param output_tokens [Integer] The number of output tokens which were used.
|
|
104
104
|
#
|
|
@@ -5,7 +5,7 @@ module Anthropic
|
|
|
5
5
|
module Beta
|
|
6
6
|
class BetaWebhookSessionArchivedEventData < Anthropic::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute id
|
|
8
|
-
# ID of the
|
|
8
|
+
# ID of the session that triggered the event.
|
|
9
9
|
#
|
|
10
10
|
# @return [String]
|
|
11
11
|
required :id, String
|
|
@@ -26,7 +26,7 @@ module Anthropic
|
|
|
26
26
|
required :workspace_id, String
|
|
27
27
|
|
|
28
28
|
# @!method initialize(id:, organization_id:, workspace_id:, type: :"session.archived")
|
|
29
|
-
# @param id [String] ID of the
|
|
29
|
+
# @param id [String] ID of the session that triggered the event.
|
|
30
30
|
#
|
|
31
31
|
# @param organization_id [String]
|
|
32
32
|
#
|
|
@@ -5,7 +5,7 @@ module Anthropic
|
|
|
5
5
|
module Beta
|
|
6
6
|
class BetaWebhookSessionCreatedEventData < Anthropic::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute id
|
|
8
|
-
# ID of the
|
|
8
|
+
# ID of the session that triggered the event.
|
|
9
9
|
#
|
|
10
10
|
# @return [String]
|
|
11
11
|
required :id, String
|
|
@@ -26,7 +26,7 @@ module Anthropic
|
|
|
26
26
|
required :workspace_id, String
|
|
27
27
|
|
|
28
28
|
# @!method initialize(id:, organization_id:, workspace_id:, type: :"session.created")
|
|
29
|
-
# @param id [String] ID of the
|
|
29
|
+
# @param id [String] ID of the session that triggered the event.
|
|
30
30
|
#
|
|
31
31
|
# @param organization_id [String]
|
|
32
32
|
#
|
|
@@ -5,7 +5,7 @@ module Anthropic
|
|
|
5
5
|
module Beta
|
|
6
6
|
class BetaWebhookSessionDeletedEventData < Anthropic::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute id
|
|
8
|
-
# ID of the
|
|
8
|
+
# ID of the session that triggered the event.
|
|
9
9
|
#
|
|
10
10
|
# @return [String]
|
|
11
11
|
required :id, String
|
|
@@ -26,7 +26,7 @@ module Anthropic
|
|
|
26
26
|
required :workspace_id, String
|
|
27
27
|
|
|
28
28
|
# @!method initialize(id:, organization_id:, workspace_id:, type: :"session.deleted")
|
|
29
|
-
# @param id [String] ID of the
|
|
29
|
+
# @param id [String] ID of the session that triggered the event.
|
|
30
30
|
#
|
|
31
31
|
# @param organization_id [String]
|
|
32
32
|
#
|
|
@@ -5,7 +5,7 @@ module Anthropic
|
|
|
5
5
|
module Beta
|
|
6
6
|
class BetaWebhookSessionIdledEventData < Anthropic::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute id
|
|
8
|
-
# ID of the
|
|
8
|
+
# ID of the session that triggered the event.
|
|
9
9
|
#
|
|
10
10
|
# @return [String]
|
|
11
11
|
required :id, String
|
|
@@ -26,7 +26,7 @@ module Anthropic
|
|
|
26
26
|
required :workspace_id, String
|
|
27
27
|
|
|
28
28
|
# @!method initialize(id:, organization_id:, workspace_id:, type: :"session.idled")
|
|
29
|
-
# @param id [String] ID of the
|
|
29
|
+
# @param id [String] ID of the session that triggered the event.
|
|
30
30
|
#
|
|
31
31
|
# @param organization_id [String]
|
|
32
32
|
#
|
|
@@ -5,7 +5,7 @@ module Anthropic
|
|
|
5
5
|
module Beta
|
|
6
6
|
class BetaWebhookSessionOutcomeEvaluationEndedEventData < Anthropic::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute id
|
|
8
|
-
# ID of the
|
|
8
|
+
# ID of the session that triggered the event.
|
|
9
9
|
#
|
|
10
10
|
# @return [String]
|
|
11
11
|
required :id, String
|
|
@@ -26,7 +26,7 @@ module Anthropic
|
|
|
26
26
|
required :workspace_id, String
|
|
27
27
|
|
|
28
28
|
# @!method initialize(id:, organization_id:, workspace_id:, type: :"session.outcome_evaluation_ended")
|
|
29
|
-
# @param id [String] ID of the
|
|
29
|
+
# @param id [String] ID of the session that triggered the event.
|
|
30
30
|
#
|
|
31
31
|
# @param organization_id [String]
|
|
32
32
|
#
|
|
@@ -5,7 +5,7 @@ module Anthropic
|
|
|
5
5
|
module Beta
|
|
6
6
|
class BetaWebhookSessionPendingEventData < Anthropic::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute id
|
|
8
|
-
# ID of the
|
|
8
|
+
# ID of the session that triggered the event.
|
|
9
9
|
#
|
|
10
10
|
# @return [String]
|
|
11
11
|
required :id, String
|
|
@@ -26,7 +26,7 @@ module Anthropic
|
|
|
26
26
|
required :workspace_id, String
|
|
27
27
|
|
|
28
28
|
# @!method initialize(id:, organization_id:, workspace_id:, type: :"session.pending")
|
|
29
|
-
# @param id [String] ID of the
|
|
29
|
+
# @param id [String] ID of the session that triggered the event.
|
|
30
30
|
#
|
|
31
31
|
# @param organization_id [String]
|
|
32
32
|
#
|
|
@@ -5,7 +5,7 @@ module Anthropic
|
|
|
5
5
|
module Beta
|
|
6
6
|
class BetaWebhookSessionRequiresActionEventData < Anthropic::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute id
|
|
8
|
-
# ID of the
|
|
8
|
+
# ID of the session that triggered the event.
|
|
9
9
|
#
|
|
10
10
|
# @return [String]
|
|
11
11
|
required :id, String
|
|
@@ -26,7 +26,7 @@ module Anthropic
|
|
|
26
26
|
required :workspace_id, String
|
|
27
27
|
|
|
28
28
|
# @!method initialize(id:, organization_id:, workspace_id:, type: :"session.requires_action")
|
|
29
|
-
# @param id [String] ID of the
|
|
29
|
+
# @param id [String] ID of the session that triggered the event.
|
|
30
30
|
#
|
|
31
31
|
# @param organization_id [String]
|
|
32
32
|
#
|
|
@@ -5,7 +5,7 @@ module Anthropic
|
|
|
5
5
|
module Beta
|
|
6
6
|
class BetaWebhookSessionRunningEventData < Anthropic::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute id
|
|
8
|
-
# ID of the
|
|
8
|
+
# ID of the session that triggered the event.
|
|
9
9
|
#
|
|
10
10
|
# @return [String]
|
|
11
11
|
required :id, String
|
|
@@ -26,7 +26,7 @@ module Anthropic
|
|
|
26
26
|
required :workspace_id, String
|
|
27
27
|
|
|
28
28
|
# @!method initialize(id:, organization_id:, workspace_id:, type: :"session.running")
|
|
29
|
-
# @param id [String] ID of the
|
|
29
|
+
# @param id [String] ID of the session that triggered the event.
|
|
30
30
|
#
|
|
31
31
|
# @param organization_id [String]
|
|
32
32
|
#
|
|
@@ -5,7 +5,7 @@ module Anthropic
|
|
|
5
5
|
module Beta
|
|
6
6
|
class BetaWebhookSessionStatusIdledEventData < Anthropic::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute id
|
|
8
|
-
# ID of the
|
|
8
|
+
# ID of the session that triggered the event.
|
|
9
9
|
#
|
|
10
10
|
# @return [String]
|
|
11
11
|
required :id, String
|
|
@@ -26,7 +26,7 @@ module Anthropic
|
|
|
26
26
|
required :workspace_id, String
|
|
27
27
|
|
|
28
28
|
# @!method initialize(id:, organization_id:, workspace_id:, type: :"session.status_idled")
|
|
29
|
-
# @param id [String] ID of the
|
|
29
|
+
# @param id [String] ID of the session that triggered the event.
|
|
30
30
|
#
|
|
31
31
|
# @param organization_id [String]
|
|
32
32
|
#
|
|
@@ -5,7 +5,7 @@ module Anthropic
|
|
|
5
5
|
module Beta
|
|
6
6
|
class BetaWebhookSessionStatusRescheduledEventData < Anthropic::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute id
|
|
8
|
-
# ID of the
|
|
8
|
+
# ID of the session that triggered the event.
|
|
9
9
|
#
|
|
10
10
|
# @return [String]
|
|
11
11
|
required :id, String
|
|
@@ -26,7 +26,7 @@ module Anthropic
|
|
|
26
26
|
required :workspace_id, String
|
|
27
27
|
|
|
28
28
|
# @!method initialize(id:, organization_id:, workspace_id:, type: :"session.status_rescheduled")
|
|
29
|
-
# @param id [String] ID of the
|
|
29
|
+
# @param id [String] ID of the session that triggered the event.
|
|
30
30
|
#
|
|
31
31
|
# @param organization_id [String]
|
|
32
32
|
#
|
|
@@ -5,7 +5,7 @@ module Anthropic
|
|
|
5
5
|
module Beta
|
|
6
6
|
class BetaWebhookSessionStatusRunStartedEventData < Anthropic::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute id
|
|
8
|
-
# ID of the
|
|
8
|
+
# ID of the session that triggered the event.
|
|
9
9
|
#
|
|
10
10
|
# @return [String]
|
|
11
11
|
required :id, String
|
|
@@ -26,7 +26,7 @@ module Anthropic
|
|
|
26
26
|
required :workspace_id, String
|
|
27
27
|
|
|
28
28
|
# @!method initialize(id:, organization_id:, workspace_id:, type: :"session.status_run_started")
|
|
29
|
-
# @param id [String] ID of the
|
|
29
|
+
# @param id [String] ID of the session that triggered the event.
|
|
30
30
|
#
|
|
31
31
|
# @param organization_id [String]
|
|
32
32
|
#
|