module
ACP::Protocol::ContentBlocks
Overview
Helper module for building content blocks ergonomically.
Defined in:
acp/protocol/content_block.crClass Method Summary
-
.audio(data : String, mime_type : String = "audio/wav") : AudioContentBlock
Creates an audio content block from base64 data.
-
.image(data : String, mime_type : String, uri : String) : ImageContentBlock
Creates an image content block with an optional URI reference.
-
.image(data : String, mime_type : String = "image/png") : ImageContentBlock
Creates an image content block from base64 data.
-
.resource(uri : String, text : String, mime_type : String | Nil = nil) : ResourceContentBlock
Creates an embedded resource content block with text content.
-
.resource_link(uri : String, name : String, mime_type : String | Nil = nil) : ResourceLinkContentBlock
Creates a resource link content block.
-
.text(content : String) : TextContentBlock
Creates a text content block.
Class Method Detail
Creates an audio content block from base64 data.
def self.image(data : String, mime_type : String, uri : String) : ImageContentBlock
#
Creates an image content block with an optional URI reference.
Creates an image content block from base64 data.
def self.resource(uri : String, text : String, mime_type : String | Nil = nil) : ResourceContentBlock
#
Creates an embedded resource content block with text content.
def self.resource_link(uri : String, name : String, mime_type : String | Nil = nil) : ResourceLinkContentBlock
#
Creates a resource link content block.