Documentation Index
Fetch the complete documentation index at: https://docs.qoder.com/llms.txt
Use this file to discover all available pages before exploring further.
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.
Enable
Set includePartialMessages: true in options:
import { qodercliAuth, query } from '@qoder-ai/qoder-agent-sdk';
const q = query({
prompt: 'Write a short analysis report',
options: {
auth: qodercliAuth(),
includePartialMessages: true,
},
});
Typewriter effect
The model’s text reply arrives as a sequence of incremental chunks; printing each chunk as it lands gives a typewriter effect:
for await (const msg of q) {
if (msg.type === 'stream_event') {
const delta = msg.event.delta;
if (delta?.type === 'text_delta') {
process.stdout.write(delta.text);
}
}
}
Reasoning
Reasoning-capable models emit “thinking” chunks before their final reply:
if (delta?.type === 'thinking_delta') {
process.stdout.write(delta.thinking);
}
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:
if (delta?.type === 'input_json_delta') {
process.stdout.write(delta.partial_json);
}
For the full event structure, see SDK References.