OpenAI.Responses.Prompt (OpenAI.Responses v0.8.4)
View SourceHelpers for composing and normalizing the input
option for Responses.
These helpers are pure and return a new options map. They do not enforce any domain policy or deduplicate messages; they only help safely compose inputs and execute function outputs.
All helpers normalize :input
to a list of message maps. When strings are
provided (either as the whole input or individual items), they are converted
to %{role: :user, content: string}
messages. The :input
option is never
set to a single map — even a single message is wrapped in a list.
Summary
Functions
Shorthand to append a developer message.
Execute function_calls
using provided functions
and append the outputs.
Shorthand to append a system message.
Shorthand to append a user message.
Append message(s) to opts.input
.
Prepend message(s) to opts.input
.
Types
Functions
Shorthand to append a developer message.
Execute function_calls
using provided functions
and append the outputs.
The produced messages follow the OpenAI Responses format:
%{type: "function_call_output", call_id: id, output: result}
Shorthand to append a system message.
Shorthand to append a user message.
Append message(s) to opts.input
.
Accepts a binary, a %{role, content}
map, or a list of such values.
Returns a new options map with :input
normalized to a list of message maps.
Prepend message(s) to opts.input
.
Same accepted inputs and return shape as append/2
.