Gemini.Live.Models (GeminiEx v0.9.0)

Copy Markdown View Source

Live API model selection helpers.

Live API model availability can vary by rollout. This module provides a consistent way to choose a suitable model, preferring newer models when available while falling back to stable defaults.

Summary

Functions

Returns the candidate Live API models for a modality in preference order.

Returns the default Live API model for a modality.

Select the first candidate present in an available model list.

Resolve the most appropriate Live API model for a modality.

Types

modality()

@type modality() :: :text | :audio | :image

Functions

candidates(modality)

@spec candidates(modality()) :: [String.t()]

Returns the candidate Live API models for a modality in preference order.

default(modality)

@spec default(modality()) :: String.t()

Returns the default Live API model for a modality.

pick_from_available(candidates, available_models)

@spec pick_from_available([String.t()], [String.t()]) :: {:ok, String.t()} | :none

Select the first candidate present in an available model list.

Returns {:ok, model} or :none if no candidates match.

resolve(modality, opts \\ [])

@spec resolve(
  modality(),
  keyword()
) :: String.t()

Resolve the most appropriate Live API model for a modality.

Uses the Gemini API list_models response when available, then falls back to the default model if no candidates are listed.

Options

  • :auth - Auth strategy passed to Coordinator.list_models/1 (default: :gemini)
  • :available_models - Explicit list of available models (bypass API call)
  • :candidates - Override candidate list (strings)
  • :require_method - Supported generation method to filter on (default: "bidiGenerateContent")