Stream() with conversation history — demonstrates event handling so you do not print the same assistant text twice (deltas vs final body).
Source: examples/agent_with_stream_conversation/
What it demonstrates
StreamwithConversationOptions- Distinguishing
TEXT_MESSAGE_CONTENTdeltas fromRUN_FINISHEDaggregate content - Pattern for chat UIs that stream then finalize
Key code
TEXT_MESSAGE_CONTENT and do not reprint RUN_FINISHED.Result.Content — it duplicates the streamed text.
Run
Fromexamples/:
Expected output
RUN_FINISHED. Run again with a follow-up — in-memory history carries context within the same process (use Redis + conversation.mdx for cross-process persistence).
Learn more
Stream
Base streaming example
Conversation
Session history