(content: ToolResultContent)
| 21 | * text-extraction behavior used elsewhere for `string | Array<ContentPart>`. |
| 22 | */ |
| 23 | export 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 | } |
no outgoing calls
no test coverage detected