Skip to content
providerkit
GitHub

ChatState

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

Everything a view of the conversation draws. A new object only when something in it moved.

canReconnect: boolean;

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

The connection is lost and the transport can observe, so reconnect can work.


canRetry: boolean;

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

retry can send a message whose delivery is unknown now. False while a run is going (unless allowSendWhileRunning), even when steering keeps canSend true: sending it again into a running one could ask for the same work twice. Also false until the host has said where its run stands since the delivery became unknown, because the message may have started a run nobody reported yet. Show Retry on a message only when this is true and messageErrors has it.


canSend: boolean;

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


canStop: boolean;

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

A stop can reach the run: the transport has stop, or the client can abort its pending command or reply stream, or keep a message whose copy is still being saved from going out.


connection: ConnectionStatus;

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


optional error?: DisplayError;

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

What went wrong that is not about one message or one request: the connection, or a stop that did not go through.


inputs: readonly InputView[];

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

User input delivery, never completed assistant output.


messageErrors: Readonly<Record<string, DisplayError>>;

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

By message id: why a message this client sent shows as failed. unconfirmed means it may not have arrived, and retry sends it again.


messages: readonly DisplayMessage[];

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

The host’s messages and this client’s own, in order. A message this client sent shows as sending while its call is out, settled once the host took it, and failed when that is unknown (see messageErrors), until the host’s own copy takes its place.


requests: readonly RequestView[];

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

Every request that is waiting, in reading order.


run: RunInfo;

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


status: ChatStatus;

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