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.audio_data(data : String, mime_type : String = "audio/wav") : AudioContentBlock #

@deprecated Use .audio(data, mime_type) instead.


[View source]
def self.audio_url(url : String, mime_type : String | Nil = nil) : AudioContentBlock #

@deprecated Use .audio(data, mime_type) instead.


[View source]
def self.file(path : String, mime_type : String | Nil = nil) : ResourceLinkContentBlock #

Creates a resource link from a file path. @deprecated Use .resource_link instead.


[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.image_data(data : String, mime_type : String = "image/png") : ImageContentBlock #

@deprecated Use .image(data, mime_type) instead.


[View source]
def self.image_url(url : String, mime_type : String | Nil = nil) : ImageContentBlock #

@deprecated Use .image(data, mime_type) instead.


[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]