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.
-
#build : Array(Protocol::ContentBlock)
Returns the assembled array of content blocks.
-
#empty? : Bool
Returns true if no blocks have been added.
-
#image(data : String, mime_type : String = "image/png") : self
Adds an image content block from base64 data.
-
#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 with explicit URI and name.
-
#resource_link(path : String, mime_type : String | Nil = nil) : self
Adds a resource link content block from a file path.
-
#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 image content block from base64 data.
Adds an embedded resource content block with text content.
Adds a resource link content block with explicit URI and name.
Adds a resource link content block from a file path.