AsyncIterable of Event objects from runner.runAsync()
AsyncGenerator yielding only text deltas as strings
import { textStreamFrom } from '@iqai/adk/utils';
const events = runner.runAsync({
userId: 'user-123',
sessionId: 'session-456',
newMessage: { role: 'user', parts: [{ text: 'Tell me a story' }] }
});
// Simple text-only streaming
for await (const text of textStreamFrom(events)) {
process.stdout.write(text);
}
Utility function to extract text-only deltas from an event stream.
This is a convenience helper for simple use cases where you only need the streaming text output without full Event objects. For more complex use cases requiring tool calls, metadata, or usage tracking, use the full Event stream from
runAsync()directly.