Gemini.Types.Response.Model (GeminiEx v0.2.1)
View SourceModel information response structure.
Represents the complete model metadata returned by the Gemini API, including capabilities, token limits, and generation parameters.
Summary
Functions
Generate a comprehensive capabilities summary.
Calculate a capability score for model comparison.
Compare two models by capability.
Get the effective base model ID.
Check if model has advanced generation parameters.
Classify model's input token capacity.
Check if this appears to be the latest version of a model.
Extract model family from the base model ID.
Classify model's output token capacity.
Determine if model is suitable for production use.
Check if model supports embeddings.
Check if model supports a specific generation method.
Check if model supports streaming content generation.
Check if model supports token counting.
Types
@type capability_level() :: :basic | :standard | :advanced | :premium
Model capability level based on features and limits
@type capacity_tier() :: :small | :medium | :large | :very_large
Token capacity classification
@type t() :: %Gemini.Types.Response.Model{ base_model_id: String.t(), description: String.t(), display_name: String.t(), input_token_limit: integer(), max_temperature: float() | nil, name: String.t(), output_token_limit: integer(), supported_generation_methods: [String.t()], temperature: float() | nil, top_k: integer() | nil, top_p: float() | nil, version: String.t() }
Functions
Generate a comprehensive capabilities summary.
Example Response
%{
supports_streaming: true,
supports_token_counting: true,
supports_embeddings: false,
has_temperature: true,
has_top_k: true,
has_top_p: false,
method_count: 3,
input_capacity: :very_large,
output_capacity: :medium
}
Calculate a capability score for model comparison.
Higher scores indicate more capable models.
Compare two models by capability.
Returns :lt, :eq, or :gt based on capability scores.
Get the effective base model ID.
Prefers the base_model_id field, but falls back to extracting from the name if base_model_id is nil.
Examples
iex> Model.effective_base_id(%Model{base_model_id: "gemini-2.0-flash-lite"})
"gemini-2.0-flash-lite"
iex> Model.effective_base_id(%Model{name: "models/gemini-2.5-pro", base_model_id: nil})
"gemini-2.5-pro"
Check if model has advanced generation parameters.
Returns true if the model supports temperature, top_p, or top_k parameters.
@spec input_capacity_tier(t()) :: capacity_tier()
Classify model's input token capacity.
Examples
iex> Model.input_capacity_tier(%Model{input_token_limit: 2_000_000})
:very_large
iex> Model.input_capacity_tier(%Model{input_token_limit: 30_000})
:medium
Check if this appears to be the latest version of a model.
Heuristic based on name patterns (no version suffix, "latest" in name).
Extract model family from the base model ID.
Examples
iex> Model.model_family(%Model{base_model_id: "gemini-2.0-flash-lite"})
"gemini"
iex> Model.model_family(%Model{base_model_id: "text-embedding-004"})
"text"
@spec output_capacity_tier(t()) :: capacity_tier()
Classify model's output token capacity.
Determine if model is suitable for production use.
Based on capability, capacity, and stability indicators.
Check if model supports embeddings.
Check if model supports a specific generation method.
Examples
iex> Model.supports_method?(model, "generateContent")
true
iex> Model.supports_method?(model, "nonexistentMethod")
false
Check if model supports streaming content generation.
Check if model supports token counting.