Function: renderOpenAIResponsesMediaBlocks()
ts
function renderOpenAIResponsesMediaBlocks(input: {
media: Media;
renderTrustedContent: (content: string, attrs: TrustedContentAttrs) => string;
renderUntrustedContent: (
content: string,
attrs: UntrustedContentAttrs,
) => string;
unsupportedMediaPolicy: UnsupportedMediaPolicy;
warn?: (msg: string) => void;
}): Promise<OpenAIResponsesInputContentBlock[]>;Defined in: src/batteries/llm/openai_responses/helpers.ts:209
Implements OpenAIResponsesHelpers.renderOpenAIResponsesMediaBlocks.
Parameters
| Parameter | Type |
|---|---|
input | { media: Media; renderTrustedContent: (content: string, attrs: TrustedContentAttrs) => string; renderUntrustedContent: (content: string, attrs: UntrustedContentAttrs) => string; unsupportedMediaPolicy: UnsupportedMediaPolicy; warn?: (msg: string) => void; } |
input.media | Media |
input.renderTrustedContent | (content: string, attrs: TrustedContentAttrs) => string |
input.renderUntrustedContent | (content: string, attrs: UntrustedContentAttrs) => string |
input.unsupportedMediaPolicy | UnsupportedMediaPolicy |
input.warn? | (msg: string) => void |
Returns
Promise<OpenAIResponsesInputContentBlock[]>
Remarks
image maps to input_image (a data URI). document maps to input_file using the NOW-CONFIRMED file_data: 'data:<mime>;base64,<b64>' shape (a live probe against the real Responses API accepted this exact shape with filename alongside it — see the battery's design notes). audio/video — and any other kind/mime this battery cannot natively express — route through unsupportedMediaPolicy, unchanged.