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.
-
.audio_data(data : String, mime_type : String = "audio/wav") : AudioContentBlock
@deprecated Use
.audio(data, mime_type)instead. -
.audio_url(url : String, mime_type : String | Nil = nil) : AudioContentBlock
@deprecated Use
.audio(data, mime_type)instead. -
.file(path : String, mime_type : String | Nil = nil) : ResourceLinkContentBlock
Creates a resource link from a file path.
-
.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.
-
.image_data(data : String, mime_type : String = "image/png") : ImageContentBlock
@deprecated Use
.image(data, mime_type)instead. -
.image_url(url : String, mime_type : String | Nil = nil) : ImageContentBlock
@deprecated Use
.image(data, mime_type)instead. -
.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.
@deprecated Use .audio(data, mime_type) instead.
@deprecated Use .audio(data, mime_type) instead.
Creates a resource link from a file path.
@deprecated Use .resource_link instead.
Creates an image content block with an optional URI reference.
Creates an image content block from base64 data.
@deprecated Use .image(data, mime_type) instead.
@deprecated Use .image(data, mime_type) instead.
Creates an embedded resource content block with text content.
Creates a resource link content block.