Module: Anthropic::Models::ContentBlockParam
- Extended by:
- Internal::Type::Union
- Defined in:
- lib/anthropic/models/content_block_param.rb,
sig/anthropic/models/content_block_param.rbs
Overview
Regular text content.
Class Method Summary collapse
-
.new(type:, **args) ⇒ Anthropic::Models::TextBlockParam, ...
Creates a new instance of the variant class whose
typematches the given value, passing the remaining arguments to its constructor. - .variants ⇒ Array(Anthropic::Models::TextBlockParam, Anthropic::Models::ImageBlockParam, Anthropic::Models::DocumentBlockParam, Anthropic::Models::SearchResultBlockParam, Anthropic::Models::ThinkingBlockParam, Anthropic::Models::RedactedThinkingBlockParam, Anthropic::Models::ToolUseBlockParam, Anthropic::Models::ToolResultBlockParam, Anthropic::Models::ServerToolUseBlockParam, Anthropic::Models::WebSearchToolResultBlockParam, Anthropic::Models::WebFetchToolResultBlockParam, Anthropic::Models::CodeExecutionToolResultBlockParam, Anthropic::Models::BashCodeExecutionToolResultBlockParam, Anthropic::Models::TextEditorCodeExecutionToolResultBlockParam, Anthropic::Models::ToolSearchToolResultBlockParam, Anthropic::Models::ContainerUploadBlockParam, Anthropic::Models::MidConversationSystemBlockParam)
Instance Method Summary collapse
Methods included from Internal::Type::Union
==, ===, coerce, derefed_variants, dump, hash, inspect, to_sorbet_type, variants
Methods included from Internal::Util::SorbetRuntimeSupport
#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type
Methods included from Internal::Type::Converter
#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info
Class Method Details
.new(type:, **args) ⇒ Anthropic::Models::TextBlockParam, ...
Creates a new instance of the variant class whose type matches the given
value, passing the remaining arguments to its constructor.
Some parameter documentations has been truncated, see Anthropic::Models::ContentBlockParam for more details.
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
# File 'lib/anthropic/models/content_block_param.rb', line 109 def self.new(type:, **args) case type.to_sym when :text Anthropic::TextBlockParam.new(**args) when :image Anthropic::ImageBlockParam.new(**args) when :document Anthropic::DocumentBlockParam.new(**args) when :search_result Anthropic::SearchResultBlockParam.new(**args) when :thinking Anthropic::ThinkingBlockParam.new(**args) when :redacted_thinking Anthropic::RedactedThinkingBlockParam.new(**args) when :tool_use Anthropic::ToolUseBlockParam.new(**args) when :tool_result Anthropic::ToolResultBlockParam.new(**args) when :server_tool_use Anthropic::ServerToolUseBlockParam.new(**args) when :web_search_tool_result Anthropic::WebSearchToolResultBlockParam.new(**args) when :web_fetch_tool_result Anthropic::WebFetchToolResultBlockParam.new(**args) when :code_execution_tool_result Anthropic::CodeExecutionToolResultBlockParam.new(**args) when :bash_code_execution_tool_result Anthropic::BashCodeExecutionToolResultBlockParam.new(**args) when :text_editor_code_execution_tool_result Anthropic::TextEditorCodeExecutionToolResultBlockParam.new(**args) when :tool_search_tool_result Anthropic::ToolSearchToolResultBlockParam.new(**args) when :container_upload Anthropic::ContainerUploadBlockParam.new(**args) when :mid_conv_system Anthropic::MidConversationSystemBlockParam.new(**args) else raise ArgumentError, "unknown type: #{type}" end end |
.variants ⇒ Array(Anthropic::Models::TextBlockParam, Anthropic::Models::ImageBlockParam, Anthropic::Models::DocumentBlockParam, Anthropic::Models::SearchResultBlockParam, Anthropic::Models::ThinkingBlockParam, Anthropic::Models::RedactedThinkingBlockParam, Anthropic::Models::ToolUseBlockParam, Anthropic::Models::ToolResultBlockParam, Anthropic::Models::ServerToolUseBlockParam, Anthropic::Models::WebSearchToolResultBlockParam, Anthropic::Models::WebFetchToolResultBlockParam, Anthropic::Models::CodeExecutionToolResultBlockParam, Anthropic::Models::BashCodeExecutionToolResultBlockParam, Anthropic::Models::TextEditorCodeExecutionToolResultBlockParam, Anthropic::Models::ToolSearchToolResultBlockParam, Anthropic::Models::ContainerUploadBlockParam, Anthropic::Models::MidConversationSystemBlockParam)
|
|
# File 'lib/anthropic/models/content_block_param.rb', line 60
|
Instance Method Details
#self?.variants ⇒ ::Array[Anthropic::Models::content_block_param]
25 |
# File 'sig/anthropic/models/content_block_param.rbs', line 25
def self?.variants: -> ::Array[Anthropic::Models::content_block_param]
|