Open Agent Loops
API Reference

contentToText

@open-agent-loops/core


function contentToText(content): string;

Defined in: types/content-part.ts:173

Flatten a string | ContentPart[] to a single display string: text parts verbatim, non-text parts as a compact placeholder ([image], [audio], [file: report.pdf]).

Parameters

ParameterTypeDescription
contentstring | ContentPart[]A bare text string or a multimodal part array.

Returns

string

A display string.

Remarks

For logging / tracing / any spot that needs the human-readable gist of a turn without rendering binary parts. A plain string passes through unchanged.

On this page