struct Gemini::GenerateContentResponse

Overview

Response from the model supporting multiple candidate responses.

API Reference

Included Modules

Defined in:

gemini/response.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(pull : JSON::PullParser) #

Instance Method Detail

def after_initialize #

def candidates : Array(Candidate) #

Candidate responses from the model.


def model_version : String | Nil #

def parts #

A quick accessor equivalent to #candidates.first.content!.parts


def prompt_feedback : PromptFeedback #

Returns the prompt's feedback related to the content filters.


def text #

A quick accessor equivalent to #candidates.first.content!.parts.first.text


def to_s #

Alias for #text


def usage_metadata : UsageMetadata #

Metadata on the generation requests' token usage. (Output only)