Class: Aws::BedrockRuntime::Types::ContentBlock

Inherits:
Struct
  • Object
show all
Includes:
Structure, Structure::Union
Defined in:
lib/aws-sdk-bedrockruntime/types.rb

Overview

Note:

ContentBlock is a union - when making an API calls you must set exactly one of the members.

Note:

ContentBlock is a union - when returned from an API call exactly one value will be set and the returned type will be a subclass of ContentBlock corresponding to the set member.

A block of content for a message that you pass to, or receive from, a model with the Converse API (Converse and ConverseStream).

Direct Known Subclasses

GuardContent, Image, Text, ToolResult, ToolUse, Unknown

Defined Under Namespace

Classes: GuardContent, Image, Text, ToolResult, ToolUse, Unknown

Constant Summary collapse

SENSITIVE =
[]

Instance Attribute Summary collapse

Instance Attribute Details

#guard_contentTypes::GuardrailConverseContentBlock

Contains the content to assess with the guardrail. If you don’t specify ‘guardContent` in a call to the Converse API, the guardrail (if passed in the Converse API) assesses the entire message.

For more information, see *Use a guardrail with the Converse API* in the *Amazon Bedrock User Guide*. </p>



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/aws-sdk-bedrockruntime/types.rb', line 82

class ContentBlock < Struct.new(
  :text,
  :image,
  :tool_use,
  :tool_result,
  :guard_content,
  :unknown)
  SENSITIVE = []
  include Aws::Structure
  include Aws::Structure::Union

  class Text < ContentBlock; end
  class Image < ContentBlock; end
  class ToolUse < ContentBlock; end
  class ToolResult < ContentBlock; end
  class GuardContent < ContentBlock; end
  class Unknown < ContentBlock; end
end

#imageTypes::ImageBlock

Image to include in the message.

<note markdown=“1”> This field is only supported by Anthropic Claude 3 models.

</note>

Returns:



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/aws-sdk-bedrockruntime/types.rb', line 82

class ContentBlock < Struct.new(
  :text,
  :image,
  :tool_use,
  :tool_result,
  :guard_content,
  :unknown)
  SENSITIVE = []
  include Aws::Structure
  include Aws::Structure::Union

  class Text < ContentBlock; end
  class Image < ContentBlock; end
  class ToolUse < ContentBlock; end
  class ToolResult < ContentBlock; end
  class GuardContent < ContentBlock; end
  class Unknown < ContentBlock; end
end

#textString

Text to include in the message.

Returns:

  • (String)


82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/aws-sdk-bedrockruntime/types.rb', line 82

class ContentBlock < Struct.new(
  :text,
  :image,
  :tool_use,
  :tool_result,
  :guard_content,
  :unknown)
  SENSITIVE = []
  include Aws::Structure
  include Aws::Structure::Union

  class Text < ContentBlock; end
  class Image < ContentBlock; end
  class ToolUse < ContentBlock; end
  class ToolResult < ContentBlock; end
  class GuardContent < ContentBlock; end
  class Unknown < ContentBlock; end
end

#tool_resultTypes::ToolResultBlock

The result for a tool request that a model makes.



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/aws-sdk-bedrockruntime/types.rb', line 82

class ContentBlock < Struct.new(
  :text,
  :image,
  :tool_use,
  :tool_result,
  :guard_content,
  :unknown)
  SENSITIVE = []
  include Aws::Structure
  include Aws::Structure::Union

  class Text < ContentBlock; end
  class Image < ContentBlock; end
  class ToolUse < ContentBlock; end
  class ToolResult < ContentBlock; end
  class GuardContent < ContentBlock; end
  class Unknown < ContentBlock; end
end

#tool_useTypes::ToolUseBlock

Information about a tool use request from a model.

Returns:



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/aws-sdk-bedrockruntime/types.rb', line 82

class ContentBlock < Struct.new(
  :text,
  :image,
  :tool_use,
  :tool_result,
  :guard_content,
  :unknown)
  SENSITIVE = []
  include Aws::Structure
  include Aws::Structure::Union

  class Text < ContentBlock; end
  class Image < ContentBlock; end
  class ToolUse < ContentBlock; end
  class ToolResult < ContentBlock; end
  class GuardContent < ContentBlock; end
  class Unknown < ContentBlock; end
end

#unknownObject

Returns the value of attribute unknown

Returns:

  • (Object)

    the current value of unknown



82
83
84
# File 'lib/aws-sdk-bedrockruntime/types.rb', line 82

def unknown
  @unknown
end