openai.internal.lower_prompt

Role-less content uses the ordinary user role; `tool` is not a valid free-standing Responses message role, so authored tool context is user content (actual tool outputs come from the journal path below).

Reference version

Signature

function openai.internal.lower_prompt(
prompt: ai.Prompt,
default_cache_args: baml.json.json = …,
preview: bool = …
) -> openai.internal.OaInputItem[] throws baml.errors.InvalidArgument | baml.errors.Timeout | ai.errors.Failure

Role-less content uses the ordinary user role; tool is not a valid free-standing Responses message role, so authored tool context is user content (actual tool outputs come from the journal path below).

A ${cache(args)} in a message becomes a cache breakpoint on the content part before it: the Responses API places a breakpoint ON a part, while the delimiter sits BETWEEN parts, so everything up to and including that part is the cached prefix. The typed parts have no slot for it and args is sent as written, so the position is recorded in breakpoints and _apply_cache_breakpoints writes the key onto the serialized body. The text on either side is trimmed where it faces the delimiter (ai.wire.prompt_parts). A ${cache()} carries default_cache_args. Nothing is recorded when no part precedes the delimiter in its message, or when the delimiter has no args and there is no default.

Source:<builtin>/openai/ns_internal/responses.bamlbytes 17474–19142