adk_openai_responses_content (erlang_adk v0.8.0)

View Source

Checked translation between ADK's provider-neutral content/history representation and OpenAI Responses API input/output items.

This module is deliberately a JSON boundary: emitted maps use binary keys, provider output is treated as untrusted, and error terms never retain model text, tool arguments, tool results, or other request content.

Summary

Functions

Decode a complete Responses output array. The returned content is canonical adk_content; calls preserve the OpenAI call_id in the fourth ADK tuple element and have no provider thought signature.

Functions

decode_output(Output, LimitOverrides)

-spec decode_output(term(), map()) -> {ok, adk_content:content(), list()} | {error, term()}.

Decode a complete Responses output array. The returned content is canonical adk_content; calls preserve the OpenAI call_id in the fourth ADK tuple element and have no provider thought signature.

encode_history(History, LimitOverrides)

-spec encode_history(term(), map()) -> {ok, binary(), [map()]} | {error, term()}.

encode_tools(Tools)

-spec encode_tools(term()) -> {ok, [map()]} | {error, term()}.

text_parts(Content)

-spec text_parts(adk_content:content()) -> [binary()].

tool_calls(Content)

-spec tool_calls(adk_content:content()) -> list().