adk_context_cache_gemini (erlang_adk v0.7.0)
View SourceGemini GenerateContent explicit cached-content adapter.
The adapter stores provider request prefixes, never model responses. It is deliberately usable only with the stable gemini-3.1-flash-lite model. The opaque binary returned from create/2 is a local private descriptor; callers must use cached_content_name/2 immediately before a Gemini request. Neither that descriptor nor Google's cachedContents/* name is suitable for events, logs, diagnostics, or persisted configuration.
Transport configuration is read from the erlang_adk application environment key gemini_context_cache. The value is a strict map with optional base_url, api_key, and request_timeout_ms keys. api_key falls back to GEMINI_API_KEY. Validation errors never echo credentials.
Google's current model page declares caching support for 3.1 Flash-Lite, but the current caching guide does not publish an explicit-cache minimum for this model. We therefore use a conservative 4096 estimated-token local floor and still treat the service response as authoritative.
Summary
Functions
Resolve a registry-private descriptor for one immediate model call.
Validate transport options without returning the compiled secret.
Functions
Resolve a registry-private descriptor for one immediate model call.
-spec capabilities() -> map().
-spec minimum_prefix_tokens(binary()) -> {ok, pos_integer()} | {error, unsupported_context_cache_model}.
-spec update(binary(), pos_integer(), map()) -> {ok, map()} | {error, term()}.
Validate transport options without returning the compiled secret.