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.
Defined Under Namespace
Modules: Type
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. - .values ⇒ Array<Symbol>
- .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)
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.
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
# File 'lib/anthropic/models/content_block_param.rb', line 131 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) else raise ArgumentError, "unknown type: #{type}" end end |
.values ⇒ Array<Symbol>
|
|
# File 'lib/anthropic/models/content_block_param.rb', line 74
|
.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)
|
|
# File 'lib/anthropic/models/content_block_param.rb', line 78
|
Instance Method Details
#self?.variants ⇒ ::Array[Anthropic::Models::content_block_param]
65 |
# File 'sig/anthropic/models/content_block_param.rbs', line 65
def self?.variants: -> ::Array[Anthropic::Models::content_block_param]
|