Gemini.Utils.ResourceNames (GeminiEx v0.10.0)

Copy Markdown View Source

Utilities for normalizing Google Cloud resource names for Gemini/Vertex AI.

Summary

Functions

Build the base cachedContents collection path for the active auth strategy.

Normalize a cache model name for the active auth strategy.

Normalize cached content names for the active auth strategy.

Functions

cached_contents_path(opts \\ [])

@spec cached_contents_path(keyword()) :: String.t()

Build the base cachedContents collection path for the active auth strategy.

normalize_cache_model_name(model, opts \\ [])

@spec normalize_cache_model_name(
  String.t(),
  keyword()
) :: String.t()

Normalize a cache model name for the active auth strategy.

  • Gemini: ensures models/ prefix.
  • Vertex: expands to projects/{project}/locations/{location}/publishers/google/models/{model}.

normalize_cached_content_name(name, opts \\ [])

@spec normalize_cached_content_name(
  String.t(),
  keyword()
) :: String.t()

Normalize cached content names for the active auth strategy.

  • Gemini: ensures cachedContents/ prefix.
  • Vertex: expands short names to projects/{project}/locations/{location}/cachedContents/{id}.