struct ACP::Protocol::ResourceLinkContentBlock

Overview

References to resources that the Agent can access. All Agents MUST support resource links in prompts.

See: https://agentclientprotocol.com/protocol/content#resource-link

Included Modules

Defined in:

acp/protocol/content_block.cr

Constructors

Instance Method Summary

Instance methods inherited from struct ACP::Protocol::ContentBlock

type : String type

Constructor methods inherited from struct ACP::Protocol::ContentBlock

new(pull : JSON::PullParser) new

Constructor Detail

def self.from_path(path : String, mime_type : String | Nil = nil) : ResourceLinkContentBlock #

Creates a resource link from an absolute file path.


[View source]
def self.new(uri : String, name : String, mime_type : String | Nil = nil, title : String | Nil = nil, description : String | Nil = nil, size : Int64 | Nil = nil, annotations : Annotations | Nil = nil, meta : Hash(String, JSON::Any) | Nil = nil) #

[View source]
def self.new(pull : JSON::PullParser) #

References to resources that the Agent can access. All Agents MUST support resource links in prompts.

See: https://agentclientprotocol.com/protocol/content#resource-link


[View source]

Instance Method Detail

def annotations : Annotations | Nil #

Optional metadata about how the content should be used or displayed.


[View source]
def annotations=(annotations : Annotations | Nil) #

Optional metadata about how the content should be used or displayed.


[View source]
def description : String | Nil #

Optional description of the resource contents.


[View source]
def description=(description : String | Nil) #

Optional description of the resource contents.


[View source]
def meta : Hash(String, JSON::Any) | Nil #

Extension metadata.


[View source]
def meta=(meta : Hash(String, JSON::Any) | Nil) #

Extension metadata.


[View source]
def mime_type : String | Nil #

The MIME type of the resource.


[View source]
def mime_type=(mime_type : String | Nil) #

The MIME type of the resource.


[View source]
def name : String #

A human-readable name for the resource (required).


[View source]
def name=(name : String) #

A human-readable name for the resource (required).


[View source]
def path : String | Nil #

Helper to extract the file path from a file:// URI.


[View source]
def size : Int64 | Nil #

Optional size of the resource in bytes.


[View source]
def size=(size : Int64 | Nil) #

Optional size of the resource in bytes.


[View source]
def title : String | Nil #

Optional display title for the resource.


[View source]
def title=(title : String | Nil) #

Optional display title for the resource.


[View source]
def type : String #

Always "resource_link" for this block type.


[View source]
def uri : String #

The URI of the resource (required).


[View source]
def uri=(uri : String) #

The URI of the resource (required).


[View source]