struct Gemini::GenerateContentResponse::Candidate

Overview

A response candidate generated from the model.

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 content : Gemini::Content #

Generated content returned from the model. (Output only)


def content? : Gemini::Content | Nil #

Generated content returned from the model. (Output only)


def finish_reason : FinishReason | Nil #

The reason why the model stopped generating tokens. (Optional, Output only) If empty, the model has not stopped generating tokens.


def index : Int32 #

Index of the candidate in the list of response candidates. (Output only)


def safety_ratings : Array(SafetyRating) #

List of ratings for the safety of a response candidate. There is at most one rating per category.


def token_count : Int32 #

Token count for this candidate. (Output only)