Module: Anthropic::Models::Beta::BetaContentBlock
- Extended by:
- Internal::Type::Union
- Defined in:
- lib/anthropic/models/beta/beta_content_block.rb
Defined Under Namespace
Modules: Type
Class Method Summary collapse
-
.new(type:, **args) ⇒ Anthropic::Models::Beta::BetaTextBlock, ...
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::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, Anthropic::Models::Beta::BetaMCPToolListingBlock)
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::Beta::BetaTextBlock, ...
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::Beta::BetaContentBlock for more details.
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 |
# File 'lib/anthropic/models/beta/beta_content_block.rb', line 154 def self.new(type:, **args) case type.to_sym when :text Anthropic::Beta::BetaTextBlock.new(**args) when :thinking Anthropic::Beta::BetaThinkingBlock.new(**args) when :redacted_thinking Anthropic::Beta::BetaRedactedThinkingBlock.new(**args) when :tool_use Anthropic::Beta::BetaToolUseBlock.new(**args) when :server_tool_use Anthropic::Beta::BetaServerToolUseBlock.new(**args) when :web_search_tool_result Anthropic::Beta::BetaWebSearchToolResultBlock.new(**args) when :web_fetch_tool_result Anthropic::Beta::BetaWebFetchToolResultBlock.new(**args) when :advisor_tool_result Anthropic::Beta::BetaAdvisorToolResultBlock.new(**args) when :code_execution_tool_result Anthropic::Beta::BetaCodeExecutionToolResultBlock.new(**args) when :bash_code_execution_tool_result Anthropic::Beta::BetaBashCodeExecutionToolResultBlock.new(**args) when :text_editor_code_execution_tool_result Anthropic::Beta::BetaTextEditorCodeExecutionToolResultBlock.new(**args) when :tool_search_tool_result Anthropic::Beta::BetaToolSearchToolResultBlock.new(**args) when :mcp_tool_use Anthropic::Beta::BetaMCPToolUseBlock.new(**args) when :mcp_tool_result Anthropic::Beta::BetaMCPToolResultBlock.new(**args) when :container_upload Anthropic::Beta::BetaContainerUploadBlock.new(**args) when :compaction Anthropic::Beta::BetaCompactionBlock.new(**args) when :fallback Anthropic::Beta::BetaFallbackBlock.new(**args) when :mcp_tool_listing Anthropic::Beta::BetaMCPToolListingBlock.new(**args) else raise ArgumentError, "unknown type: #{type}" end end |
.values ⇒ Array<Symbol>
|
|
# File 'lib/anthropic/models/beta/beta_content_block.rb', line 91
|
.variants ⇒ 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, Anthropic::Models::Beta::BetaMCPToolListingBlock)
|
|
# File 'lib/anthropic/models/beta/beta_content_block.rb', line 95
|