MCPcopy Create free account
hub / github.com/TanStack/ai / toolResultContentToString

Function toolResultContentToString

packages/ai-react-ui/src/tool-result-content.ts:23–32  ·  view source on GitHub ↗
(content: ToolResultContent)

Source from the content-addressed store, hash-verified

21 * text-extraction behavior used elsewhere for `string | Array<ContentPart>`.
22 */
23export function toolResultContentToString(content: ToolResultContent): string {
24 if (typeof content === 'string') return content
25 return content
26 .filter(
27 (part): part is Extract<ContentPartItem, { type: 'text' }> =>
28 part.type === 'text',
29 )
30 .map((part) => part.content)
31 .join('')
32}

Callers 2

MessagePartFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected