()
| 462 | let multimodalParts: Array<Record<string, unknown>> = [] |
| 463 | |
| 464 | const flushUserContent = () => { |
| 465 | if (multimodalParts.length > 0) { |
| 466 | if (textParts.length > 0) { |
| 467 | multimodalParts.unshift({ |
| 468 | type: 'text', |
| 469 | text: textParts.join(''), |
| 470 | }) |
| 471 | } |
| 472 | messages.push({ role: 'user', content: multimodalParts }) |
| 473 | textParts = [] |
| 474 | multimodalParts = [] |
| 475 | return |
| 476 | } |
| 477 | if (textParts.length > 0) { |
| 478 | messages.push({ role: 'user', content: textParts.join('') }) |
| 479 | textParts = [] |
| 480 | } |
| 481 | } |
| 482 | |
| 483 | for (const block of content) { |
| 484 | if (!block || typeof block !== 'object' || !('type' in block)) { |
no outgoing calls
no test coverage detected