openai.internal.prompt_metadata

Per-message provider directives (`ai.PromptMessage.metadata`, authored as `${ai.Role { name: "user", metadata: { … } }}`), in prompt order and aligned one-to-one with the items `lower_prompt` produced — the prompt items are always the FIRST items of `input`, the journal's are appended after.

Reference version

Signature

function openai.internal.prompt_metadata(prompt: ai.Prompt) -> map<string, baml.json.json>[]

Per-message provider directives (ai.PromptMessage.metadata, authored as ${ai.Role { name: "user", metadata: { … } }}), in prompt order and aligned one-to-one with the items lower_prompt produced — the prompt items are always the FIRST items of input, the journal's are appended after.

The Responses API has no per-message directive slot, so PLAN §5's accepted placement for this provider is the CONTENT PART: the keys are forwarded verbatim onto the LAST content item of the message they were authored on (the same "everything up to and including this block" rule the engine used). Applied to the SERIALIZED body, after the null-prune, because a directive is a provider shape: an explicit null in it is the caller's, not an unset field.

Source:<builtin>/openai/ns_internal/responses.bamlbytes 1763417858