adk_llm_compatible_request (erlang_adk v0.8.0)

View Source

Bounded OpenAI-compatible Chat Completions request/response codec.

Transport, endpoint selection, authentication, and retries intentionally live elsewhere. The runtime config is never merged into the wire payload; only explicitly validated generation options are copied.

Summary

Functions

Sanitize a compatible API error. Remote messages and parameter values are deliberately discarded because providers may quote request content.

Functions

build(Config, Memory, Tools)

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

build(Config, Memory, Tools, Stream)

-spec build(map(), term(), term(), boolean()) -> {ok, map()} | {error, term()}.

decode_error(Body)

-spec decode_error(binary() | map()) -> {error, term()}.

Sanitize a compatible API error. Remote messages and parameter values are deliberately discarded because providers may quote request content.

decode_response(Body, ConfigOrLimits)

-spec decode_response(binary() | map(), map()) -> {ok, adk_provider_result:result()} | {error, term()}.

max_request_bytes()

-spec max_request_bytes() -> pos_integer().