adk_llm_gemini (erlang_adk v0.9.0)

View Source

Summary

Functions

Decode a complete GenerateContent response without any Gemini context cache lifecycle. Callers which expose a different provider identity must re-tag the checked provider-result envelope at their own boundary.

Decode one JSON value from streamGenerateContent. Accounting-only frames are represented as none and never synthesize an empty content delta. SSE framing remains the responsibility of the transport adapter.

Pure GenerateContent wire encoder shared by Google's public Gemini API and the native Vertex request adapter. It owns no URL or credential policy.

Secret- and handle-free projection for diagnostics.

Stream one canonical versioned content value per decoded Gemini SSE frame. stream/4 remains the backwards-compatible text-delta API.

Functions

cache_prefix(Config, Memory, Tools)

-spec cache_prefix(map(), list(), list()) -> {ok, map()} | {error, term()}.

cache_provider()

-spec cache_provider() -> module().

capabilities()

decode_generate_content(Body, Config)

-spec decode_generate_content(binary(), map()) -> term().

Decode a complete GenerateContent response without any Gemini context cache lifecycle. Callers which expose a different provider identity must re-tag the checked provider-result envelope at their own boundary.

decode_stream_generate_content(Data, Config)

-spec decode_stream_generate_content(binary(), map()) ->
                                        {ok, none | adk_content:content()} | {error, term()}.

Decode one JSON value from streamGenerateContent. Accounting-only frames are represented as none and never synthesize an empty content delta. SSE framing remains the responsibility of the transport adapter.

encode_generate_content(Config, Memory, Tools)

-spec encode_generate_content(map(), list(), list()) -> {ok, map()} | {error, term()}.

Pure GenerateContent wire encoder shared by Google's public Gemini API and the native Vertex request adapter. It owns no URL or credential policy.

generate(Config, Memory, Tools)

public_config(Config)

-spec public_config(map()) -> map().

Secret- and handle-free projection for diagnostics.

stream(Config, Memory, Tools, Callback)

stream_content(Config, Memory, Tools, Callback)

Stream one canonical versioned content value per decoded Gemini SSE frame. stream/4 remains the backwards-compatible text-delta API.

validate_config(Config)