Module: Anthropic::Models::RawContentBlockStartEvent::ContentBlock
- Extended by:
- Internal::Type::Union
- Defined in:
- lib/anthropic/models/raw_content_block_start_event.rb,
sig/anthropic/models/raw_content_block_start_event.rbs
Overview
Defined Under Namespace
Modules: Type
Class Method Summary collapse
-
.new(type:, **args) ⇒ Anthropic::Models::TextBlock, ...
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::TextBlock, Anthropic::Models::ThinkingBlock, Anthropic::Models::RedactedThinkingBlock, Anthropic::Models::ToolUseBlock, Anthropic::Models::ServerToolUseBlock, Anthropic::Models::WebSearchToolResultBlock, Anthropic::Models::WebFetchToolResultBlock, Anthropic::Models::CodeExecutionToolResultBlock, Anthropic::Models::BashCodeExecutionToolResultBlock, Anthropic::Models::TextEditorCodeExecutionToolResultBlock, Anthropic::Models::ToolSearchToolResultBlock, Anthropic::Models::ContainerUploadBlock)
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::TextBlock, ...
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::RawContentBlockStartEvent::ContentBlock for more details.
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 |
# File 'lib/anthropic/models/raw_content_block_start_event.rb', line 118 def self.new(type:, **args) case type.to_sym when :text Anthropic::TextBlock.new(**args) when :thinking Anthropic::ThinkingBlock.new(**args) when :redacted_thinking Anthropic::RedactedThinkingBlock.new(**args) when :tool_use Anthropic::ToolUseBlock.new(**args) when :server_tool_use Anthropic::ServerToolUseBlock.new(**args) when :web_search_tool_result Anthropic::WebSearchToolResultBlock.new(**args) when :web_fetch_tool_result Anthropic::WebFetchToolResultBlock.new(**args) when :code_execution_tool_result Anthropic::CodeExecutionToolResultBlock.new(**args) when :bash_code_execution_tool_result Anthropic::BashCodeExecutionToolResultBlock.new(**args) when :text_editor_code_execution_tool_result Anthropic::TextEditorCodeExecutionToolResultBlock.new(**args) when :tool_search_tool_result Anthropic::ToolSearchToolResultBlock.new(**args) when :container_upload Anthropic::ContainerUploadBlock.new(**args) else raise ArgumentError, "unknown type: #{type}" end end |
.values ⇒ Array<Symbol>
|
|
# File 'lib/anthropic/models/raw_content_block_start_event.rb', line 73
|
.variants ⇒ Array(Anthropic::Models::TextBlock, Anthropic::Models::ThinkingBlock, Anthropic::Models::RedactedThinkingBlock, Anthropic::Models::ToolUseBlock, Anthropic::Models::ServerToolUseBlock, Anthropic::Models::WebSearchToolResultBlock, Anthropic::Models::WebFetchToolResultBlock, Anthropic::Models::CodeExecutionToolResultBlock, Anthropic::Models::BashCodeExecutionToolResultBlock, Anthropic::Models::TextEditorCodeExecutionToolResultBlock, Anthropic::Models::ToolSearchToolResultBlock, Anthropic::Models::ContainerUploadBlock)
|
|
# File 'lib/anthropic/models/raw_content_block_start_event.rb', line 77
|
Instance Method Details
#self?.variants ⇒ ::Array[Anthropic::Models::RawContentBlockStartEvent::content_block]
79 |
# File 'sig/anthropic/models/raw_content_block_start_event.rbs', line 79 def self?.variants: -> ::Array[Anthropic::Models::RawContentBlockStartEvent::content_block] |