Gemini.Types.Response.GenerateContentResponse (GeminiEx v0.2.0)

View Source

Response from content generation.

Summary

Functions

Extract text content from the response.

Get the finish reason from the first candidate.

Get token usage information from the response.

Types

t()

@type t() :: %Gemini.Types.Response.GenerateContentResponse{
  candidates: [Gemini.Types.Response.Candidate.t()],
  prompt_feedback: Gemini.Types.Response.PromptFeedback.t() | nil,
  usage_metadata: Gemini.Types.Response.UsageMetadata.t() | nil
}

Functions

extract_text(arg1)

@spec extract_text(t()) :: {:ok, String.t()} | {:error, String.t()}

Extract text content from the response.

finish_reason(arg1)

@spec finish_reason(t()) :: String.t() | nil

Get the finish reason from the first candidate.

token_usage(arg1)

@spec token_usage(t()) :: map() | nil

Get token usage information from the response.