module ACP::Protocol::ContentBlocks

Overview

Helper module for building content blocks ergonomically.

Defined in:

acp/protocol/content_block.cr

Class Method Summary

Class Method Detail

def self.audio(data : String, mime_type : String = "audio/wav") : AudioContentBlock #

Creates an audio content block from base64 data.


[View source]
def self.image(data : String, mime_type : String, uri : String) : ImageContentBlock #

Creates an image content block with an optional URI reference.


[View source]
def self.image(data : String, mime_type : String = "image/png") : ImageContentBlock #

Creates an image content block from base64 data.


[View source]
def self.resource(uri : String, text : String, mime_type : String | Nil = nil) : ResourceContentBlock #

Creates an embedded resource content block with text content.


[View source]
def self.resource_link(uri : String, name : String, mime_type : String | Nil = nil) : ResourceLinkContentBlock #

Creates a resource link content block.


[View source]
def self.text(content : String) : TextContentBlock #

Creates a text content block.


[View source]