( content: string | DeepImmutable<Array<ContentBlockParam>>, )
| 2901 | } |
| 2902 | |
| 2903 | export function getContentText( |
| 2904 | content: string | DeepImmutable<Array<ContentBlockParam>>, |
| 2905 | ): string | null { |
| 2906 | if (typeof content === 'string') { |
| 2907 | return content |
| 2908 | } |
| 2909 | if (Array.isArray(content)) { |
| 2910 | return extractTextContent(content, '\n').trim() || null |
| 2911 | } |
| 2912 | return null |
| 2913 | } |
| 2914 | |
| 2915 | export type StreamingToolUse = { |
| 2916 | index: number |
no test coverage detected