struct Gemini::Part
- Gemini::Part
- Struct
- Value
- Object
Overview
A datatype containing media that is part of a multi-part Content
message.
Union field #data
. #data
can be only one of the following:
- text: string - Inline text.
- inlineData: object (Blob) - Inline media bytes.
- functionCall: object (FunctionCall) - A predicted FunctionCall returned from the model that contains a string
representing the
FunctionDeclaration#name
with the arguments and their values. - functionResponse: object (FunctionResponse) - The result output of a
FunctionCall
that contains a string representing theFunctionDeclaration#name
and a structured JSON object containing any output from the function is used as context to the model. - fileData: object (FileData) - URI based data.
- executableCode: object (ExecutableCode) - Code generated by the model that is meant to be executed.
- codeExecutionResult: object (CodeExecutionResult) - Result of executing the ExecutableCode.
Defined in:
gemini/types.crConstructors
-
.new(pull : JSON::PullParser)
Custom JSON deserializable
- .new(data : Gemini::Blob | Gemini::FunctionCall | Gemini::FunctionResponse | String)
Instance Method Summary
- #data : Text | FunctionCall | FunctionResponse | InlineData
- #data=(data : Text | FunctionCall | FunctionResponse | InlineData)
-
#function_call
Same as
#function_call?
but raise error if nil -
#function_call?
if
#data
type isFunctionCall
will return value, or nil if not -
#function_call?(&)
Do not yield if
#data
is a diferent type -
#function_response
Same as
#function_response?
but raise error if nil -
#function_response?
if
#data
type isFunctionResponse
will return value, or nil if not -
#function_response?(&)
Do not yield if
#data
is a diferent type -
#inline_data
Same as
#inline_data?
but raise error if nil -
#inline_data?
if
#data
type isInlineData
will return value, or nil if not -
#inline_data?(&)
Do not yield if
#data
is a diferent type -
#text
Same as
#text?
but raise error if nil - #text?
-
#text?(&)
Do not yield if
#data
is a diferent type -
#to_json(json : JSON::Builder)
Custom JSON serializable