adk_llm_compatible_content (erlang_adk v0.8.0)
View SourceChecked ADK content translation for OpenAI-compatible Chat Completions.
The module is a pure JSON boundary. Emitted wire maps have binary keys; provider input is bounded and treated as untrusted; errors never retain prompts, model text, function arguments, tool results, or schema values.
Summary
Functions
Decode one assistant message from a completed choice. Text and parallel tool calls may coexist. Every call preserves its provider id.
Encode ordinary ADK function declarations into the Chat Completions nested {type:function,function:{...}} shape.
Functions
-spec decode_message(term(), map()) -> {ok, adk_content:content(), list()} | {error, term()}.
Decode one assistant message from a completed choice. Text and parallel tool calls may coexist. Every call preserves its provider id.
Encode ordinary ADK function declarations into the Chat Completions nested {type:function,function:{...}} shape.
-spec outcome(adk_content:content()) -> {ok, binary() | adk_content:content()} | {tool_calls, list()} | {error, term()}.
-spec text_parts(adk_content:content()) -> [binary()].
-spec tool_calls(adk_content:content()) -> list().