Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Implements LLM text streaming in Output workflow steps with onChunk progress, streamText, and Agent stream APIs.
55% 100%+45 ptsof test cases passed
Passed 22 of 22 test cases with the skill, and 12 of 22 without it.
When using `Agent.stream()`, under what condition does the wrapped `onEnd` callback skip saving conversation messages to the store?
States that message persistence is skipped when finishReason is 'error'.
This test ran on v2. v3 is the current version and hasn’t been tested on gemini-3.6-flash yet.
3 of 3 safety checks passed
onChunk, or onEnd / onError on streamText() / Agent.stream()| Need | Use |
|---|---|
| Complete single-shot result | generateText() |
Complete result plus onChunk progress | generateTextWithStreaming() |
Direct access to textStream or stream | streamText() |
Complete Agent result plus onChunk progress | Agent.generateWithStreaming() |
| Direct access to the Agent stream | Agent.stream() |
In workflow steps, prefer generateTextWithStreaming() or Agent.generateWithStreaming() when onChunk progress is sufficient. They consume the stream internally, return complete results like generateText() or Agent.generate(), and reject on provider, transport, or abort errors. Rejection allows Temporal to record the failed activity attempt and apply the step retry policy.
streamText() and Agent.stream() remain supported for code that needs direct control over stream consumption.
import { generateTextWithStreaming } from '@outputai/core/llm';
const result = await generateTextWithStreaming( {
prompt: 'draft@v1',
variables: { topic },
onChunk( { chunk } ) {
if ( chunk.type === 'text-delta' ) {
process.stdout.write( chunk.text );
}
}
} );
return result.result;
Next to this one in the catalogue, plus more from the same author.