> ## Documentation Index
> Fetch the complete documentation index at: https://botmesh.afaya.com.co/llms.txt
> Use this file to discover all available pages before exploring further.

# StreamOptions

> Interface exported by @botmesh/core.

Defined in: [streaming/types.ts:43](https://github.com/andresayac/botmesh/blob/main/packages/core/src/streaming/types.ts#L43)

Options of `ctx.stream()` / [streamText](https://botmesh.afaya.com.co/api/core/functions/streamText.md).

## Properties

### strategy?

```ts theme={null}
strategy?: "auto" | StreamStrategy;
```

Defined in: [streaming/types.ts:45](https://github.com/andresayac/botmesh/blob/main/packages/core/src/streaming/types.ts#L45)

`'auto'` (default) picks from `capabilities.streaming`; an unsupported choice degrades.

***

### throttleMs?

```ts theme={null}
throttleMs?: number;
```

Defined in: [streaming/types.ts:47](https://github.com/andresayac/botmesh/blob/main/packages/core/src/streaming/types.ts#L47)

Minimum ms between two live updates (draft/edit). Default 400 (draft), 1000 (edit).

***

### signal?

```ts theme={null}
signal?: AbortSignal;
```

Defined in: [streaming/types.ts:49](https://github.com/andresayac/botmesh/blob/main/packages/core/src/streaming/types.ts#L49)

Abort the stream: reading stops and the source's `return()` is called.

***

### onCancel?

```ts theme={null}
onCancel?: "flush" | "discard";
```

Defined in: [streaming/types.ts:57](https://github.com/andresayac/botmesh/blob/main/packages/core/src/streaming/types.ts#L57)

What to do with the text produced so far on cancellation. Default `'flush'`
(send it). `'discard'` sends nothing more and removes the live preview: a draft
simply expires and, with the edit strategy, the message being edited is deleted
(when the transport can delete; otherwise only its cursor is removed). Messages
already completed before the cancel stay.

***

### maxLength?

```ts theme={null}
maxLength?: number;
```

Defined in: [streaming/types.ts:59](https://github.com/andresayac/botmesh/blob/main/packages/core/src/streaming/types.ts#L59)

Max chars per message. Default `capabilities.maxTextLength`, else 4096 (`capabilities.maxTextBytes` also applies).

***

### minChunkChars?

```ts theme={null}
minChunkChars?: number;
```

Defined in: [streaming/types.ts:61](https://github.com/andresayac/botmesh/blob/main/packages/core/src/streaming/types.ts#L61)

`'chunk'`: minimum chars before a chunk is sent at a sentence boundary. Default 160.

***

### maxChunkChars?

```ts theme={null}
maxChunkChars?: number;
```

Defined in: [streaming/types.ts:63](https://github.com/andresayac/botmesh/blob/main/packages/core/src/streaming/types.ts#L63)

`'chunk'`: hard size of a chunk with no sentence boundary. Default min(maxLength, 1500).

***

### typing?

```ts theme={null}
typing?: boolean;
```

Defined in: [streaming/types.ts:65](https://github.com/andresayac/botmesh/blob/main/packages/core/src/streaming/types.ts#L65)

Show typing while waiting (chunk/buffer, and edit before its first message). Default true.

***

### typingIntervalMs?

```ts theme={null}
typingIntervalMs?: number;
```

Defined in: [streaming/types.ts:67](https://github.com/andresayac/botmesh/blob/main/packages/core/src/streaming/types.ts#L67)

Interval (ms) to refresh the typing indicator. Default 8000.

***

### cursor?

```ts theme={null}
cursor?: string;
```

Defined in: [streaming/types.ts:69](https://github.com/andresayac/botmesh/blob/main/packages/core/src/streaming/types.ts#L69)

Suffix shown on in-progress drafts/edits (e.g. `' ▌'`). Never in the final text. Default `''`.

***

### canStop?

```ts theme={null}
canStop?: boolean;
```

Defined in: [streaming/types.ts:71](https://github.com/andresayac/botmesh/blob/main/packages/core/src/streaming/types.ts#L71)

Draft: show a stop button (Telegram `can_stop`). Default false.

***

### keepOnStop?

```ts theme={null}
keepOnStop?: boolean;
```

Defined in: [streaming/types.ts:73](https://github.com/andresayac/botmesh/blob/main/packages/core/src/streaming/types.ts#L73)

Draft: keep the draft visible when the user stops it (Telegram `keep_on_stop`).

***

### sendOptions?

```ts theme={null}
sendOptions?: SendOptions;
```

Defined in: [streaming/types.ts:75](https://github.com/andresayac/botmesh/blob/main/packages/core/src/streaming/types.ts#L75)

Options for the FIRST message sent (e.g. `{ quoted: ctx.ref }`).

***

### draftPlatformData?

```ts theme={null}
draftPlatformData?: Record<string, unknown>;
```

Defined in: [streaming/types.ts:77](https://github.com/andresayac/botmesh/blob/main/packages/core/src/streaming/types.ts#L77)

Transport passthrough for draft calls (e.g. Telegram `message_thread_id`).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.