By default, a model’s reply is delivered as a single complete message at the end of each turn. With streaming output enabled, the SDK pushes fine-grained incremental chunks as the model generates them — useful for typewriter effects, or for rendering reasoning and tool-invocation progress separately.
Set include_partial_messages=True in QoderAgentOptions:
from qoder_agent_sdk import QoderAgentOptions, access_token_from_env, queryoptions = QoderAgentOptions( auth=access_token_from_env(), include_partial_messages=True,)async for msg in query(prompt="Write a short analysis report", options=options): ...
The model’s text reply arrives as a sequence of incremental chunks; printing each chunk as it lands gives a typewriter effect:
import sysfrom qoder_agent_sdk import StreamEventasync for msg in query(prompt="...", options=options): if isinstance(msg, StreamEvent): delta = msg.event.get("delta") if delta and delta.get("type") == "text_delta": sys.stdout.write(delta["text"]) sys.stdout.flush()
Reasoning-capable models emit “thinking” chunks before their final reply:
if isinstance(msg, StreamEvent): delta = msg.event.get("delta") if delta and delta.get("type") == "thinking_delta": sys.stdout.write(delta["thinking"]) sys.stdout.flush()
Tool-call arguments are also generated incrementally — for example, you can use this to render the file content the model is writing in real time in your UI:
if isinstance(msg, StreamEvent): delta = msg.event.get("delta") if delta and delta.get("type") == "input_json_delta": sys.stdout.write(delta["partial_json"]) sys.stdout.flush()