API Reference
contentToText
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
| Parameter | Type | Description |
|---|---|---|
content | string | 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.