(chunk, controller)
| 34 | |
| 35 | const transformStream = new TransformStream({ |
| 36 | transform(chunk, controller) { |
| 37 | const processedChunk = decoder |
| 38 | .decode(chunk) |
| 39 | .split('\n') |
| 40 | .filter((line) => line !== '') |
| 41 | .map(parseStreamPart) |
| 42 | .map((part) => part.value) |
| 43 | .join(''); |
| 44 | |
| 45 | controller.enqueue(encoder.encode(processedChunk)); |
| 46 | }, |
| 47 | }); |
| 48 | |
| 49 | const transformedStream = result.toAIStream().pipeThrough(transformStream); |
nothing calls this directly
no outgoing calls
no test coverage detected