> ## 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.

# Streaming Output

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.

<div id="enable" />

## Enable

Set `includePartialMessages: true` in `options`:

```typescript theme={null}
import { qodercliAuth, query } from '@qoder-ai/qoder-agent-sdk';

const q = query({
  prompt: 'Write a short analysis report',
  options: {
    auth: qodercliAuth(),
    includePartialMessages: true,
  },
});
```

<div id="typewriter-effect" />

## Typewriter effect

The model's text reply arrives as a sequence of incremental chunks; printing each chunk as it lands gives a typewriter effect:

```typescript theme={null}
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);
    }
  }
}
```

<div id="reasoning" />

## Reasoning

Reasoning-capable models emit "thinking" chunks before their final reply:

```typescript theme={null}
if (delta?.type === 'thinking_delta') {
  process.stdout.write(delta.thinking);
}
```

<div id="tool-invocation-arguments" />

## Tool invocation arguments

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:

```typescript theme={null}
if (delta?.type === 'input_json_delta') {
  process.stdout.write(delta.partial_json);
}
```

For the full event structure, see [SDK References](/en/cli/sdk/references).
