struct

Gemini::Content

Inherits JSON::Serializable < Struct < Value < Object

The base structured datatype containing multi-part content of a message.

API Reference

Constructors

new(parts : Array(Part), role : Gemini::Content::Role | Nil = nil)

Create using existing parts or new empty array

Source
new(part : Part, role : Gemini::Content::Role | Nil = nil)

Create content with a single part

Source
new(text : String, role : Gemini::Content::Role | Nil = nil)

Create content with a text part already

Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

after_initialize

Remove empty texts Part from JSON to fix: "Unable to submit request because it has an empty text parameter."

Source
parts

Ordered Parts that constitute a single message. Parts may have different MIME types.

Source
parts=(parts : Array(Part))

Ordered Parts that constitute a single message. Parts may have different MIME types.

Source
role

The producer of the content. (Optional)

Source
role=(role : Role | Nil)

The producer of the content. (Optional)

Source

Nested types