struct Gemini::Content
- Gemini::Content
- Struct
- Value
- Object
Overview
The base structured datatype containing multi-part content of a message.
Included Modules
- JSON::Serializable
Defined in:
gemini/types.crConstructors
- .new(pull : JSON::PullParser)
-
.new(parts : Array(Part), role : Gemini::Content::Role | Nil = nil)
Create using existing parts or new empty array
-
.new(*parts : Part, role : Gemini::Content::Role | Nil = nil)
Create content with one or more
Part
-
.new(*data, role : Gemini::Content::Role | Nil = nil)
Create content with one or more data of
Part
Instance Method Summary
-
#after_initialize
Remove empty texts
Part
from JSON to fix: "Unable to submit request because it has an empty text parameter." -
#parts : Array(Part)
Ordered Parts that constitute a single message.
-
#parts=(parts : Array(Part))
Ordered Parts that constitute a single message.
-
#role : Role | Nil
The producer of the content.
-
#role=(role : Role | Nil)
The producer of the content.
Constructor Detail
Create using existing parts or new empty array
Instance Method Detail
Remove empty texts Part
from JSON to fix: "Unable to submit request because it has an empty text parameter."
Ordered Parts that constitute a single message. Parts may have different MIME types.
Ordered Parts that constitute a single message. Parts may have different MIME types.