class
ACP::PromptBuilder
- ACP::PromptBuilder
- Reference
- Object
Overview
A small DSL helper for constructing arrays of content blocks in
a readable way. Used by Session#prompt(&block).
Defined in:
acp/session.crInstance Method Summary
-
#audio(data : String, mime_type : String = "audio/wav") : self
Adds an audio content block from base64 data.
-
#audio_data(data : String, mime_type : String = "audio/wav") : self
Adds an audio content block from base64 data (alias).
-
#build : Array(Protocol::ContentBlock)
Returns the assembled array of content blocks.
-
#empty? : Bool
Returns true if no blocks have been added.
-
#file(path : String, mime_type : String | Nil = nil) : self
Adds a resource link content block from a file path.
-
#image(data : String, mime_type : String = "image/png") : self
Adds an image content block from base64 data.
-
#image_data(data : String, mime_type : String = "image/png") : self
Adds an image content block from base64 data (alias).
-
#resource(uri : String, text : String, mime_type : String | Nil = nil) : self
Adds an embedded resource content block with text content.
-
#resource_link(uri : String, name : String, mime_type : String | Nil = nil) : self
Adds a resource link content block.
-
#size : Int32
Returns the number of blocks added so far.
-
#text(content : String) : self
Adds a text content block.
Instance Method Detail
Adds an audio content block from base64 data.
Adds an audio content block from base64 data (alias).
Adds a resource link content block from a file path.
Adds an image content block from base64 data.
Adds an image content block from base64 data (alias).
Adds an embedded resource content block with text content.
Adds a resource link content block.