Skip to content
providerkit
GitHub

UseChatOptions

Defined in: react/src/hooks.ts:20

optional allowSendWhileRunning?: boolean;

Defined in: react/src/client.ts:304

Permits overlapping ordinary sends and retries. Off by default. A host with enqueue can accept steering input during a run without enabling this option.

ChatClientOptions.allowSendWhileRunning


optional clientTools?: Readonly<Record<string, ClientToolHandler>>;

Defined in: react/src/client.ts:316

App-owned handlers with an explicit repeat-safety declaration or a durable host claim. All dispatch is manual. Disclosure or a browser key alone never authorizes a write.

ChatClientOptions.clientTools


optional id?: string;

Defined in: react/src/hooks.ts:24

Names the conversation and the person reading it. When it changes, the hook drops everything it holds and starts over, so nothing from the last conversation or account can show in this one, however late it arrives. Leave it out for a hook that only ever shows one.


optional initialCursor?: Cursor;

Defined in: react/src/client.ts:301

Where initialMessages stand in the host’s log: the segment and the last seq they include. The first observation then resumes after it. Without it, the first observation asks for the log from the start, which for a conversation with a past is its whole history. Read once, when the client is made. The host still answers that observation with the run’s state, as it does any other.

ChatClientOptions.initialCursor


optional initialMessages?: readonly DisplayMessage[];

Defined in: react/src/client.ts:295

What to show before the host says anything, such as a transcript rendered on the server.

ChatClientOptions.initialMessages


optional pendingSend?: PendingSendOptions;

Defined in: react/src/client.ts:313

Saves each message in the app’s storage before it goes out, and keeps it there while its delivery is unknown. After a reload the message is back in the conversation as unconfirmed, and retry sends it again with the same clientId, only when the person asks. One message at a time: while one is unconfirmed, a new send is refused until the person sends it again or removes it with discard, because two could not both be sent again safely. A send whose copy cannot be saved is refused before it goes out. Off by default. Steering input (enqueue) is not kept.

ChatClientOptions.pendingSend


optional reconnect?: ReconnectOptions;

Defined in: react/src/client.ts:305

ChatClientOptions.reconnect


transport: ChatTransport;

Defined in: react/src/client.ts:293

ChatClientOptions.transport