( blocks: ContentBlock[], destination: ChunkDestination, text: string, )
| 38 | } |
| 39 | |
| 40 | export const processTextChunk = ( |
| 41 | blocks: ContentBlock[], |
| 42 | destination: ChunkDestination, |
| 43 | text: string, |
| 44 | ): ContentBlock[] => { |
| 45 | if (!text) { |
| 46 | return blocks |
| 47 | } |
| 48 | |
| 49 | if (destination.type === 'agent') { |
| 50 | return appendTextToAgentBlock(blocks, destination.agentId, text, destination.textType) |
| 51 | } |
| 52 | |
| 53 | return appendTextToRootStream(blocks, { |
| 54 | type: destination.textType, |
| 55 | text, |
| 56 | }) |
| 57 | } |
no test coverage detected