ChatValue
Defined in: react/src/hooks.ts:29
Everything a view of the conversation draws. A new object only when something in it moved.
Extends
Section titled “Extends”Properties
Section titled “Properties”canReconnect
Section titled “canReconnect”canReconnect: boolean;Defined in: react/src/client.ts:267
The connection is lost and the transport can observe, so reconnect can work.
Inherited from
Section titled “Inherited from”canRetry
Section titled “canRetry”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.
Inherited from
Section titled “Inherited from”canSend
Section titled “canSend”canSend: boolean;Defined in: react/src/client.ts:255
Inherited from
Section titled “Inherited from”canStop
Section titled “canStop”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.
Inherited from
Section titled “Inherited from”connection
Section titled “connection”connection: ConnectionStatus;Defined in: react/src/client.ts:244
Inherited from
Section titled “Inherited from”discard
Section titled “discard”discard: (messageId) => CommandResult;Defined in: react/src/hooks.ts:34
Takes a message whose outcome is unknown out of the conversation, and out of pendingSend
storage, without sending it again: for a message the person gives up on. If it did arrive,
the host’s copy still shows once the host sends it.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
messageId |
string |
Returns
Section titled “Returns”error?
Section titled “error?”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.
Inherited from
Section titled “Inherited from”inputs
Section titled “inputs”inputs: readonly InputView[];Defined in: react/src/client.ts:251
User input delivery, never completed assistant output.
Inherited from
Section titled “Inherited from”messageErrors
Section titled “messageErrors”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.
Inherited from
Section titled “Inherited from”messages
Section titled “messages”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.
Inherited from
Section titled “Inherited from”recallInput
Section titled “recallInput”recallInput: (inputId) => Promise<CommandResult>;Defined in: react/src/hooks.ts:36
Manual recall through a host that can fence the race with input acceptance.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
inputId |
string |
Returns
Section titled “Returns”Promise<CommandResult>
reconnect
Section titled “reconnect”reconnect: () => void;Defined in: react/src/hooks.ts:39
Opens a fresh observation, with a full budget of tries, after the connection was lost.
Returns
Section titled “Returns”void
requests
Section titled “requests”requests: readonly RequestView[];Defined in: react/src/client.ts:249
Every request that is waiting, in reading order.
Inherited from
Section titled “Inherited from”respond
Section titled “respond”respond: Respond;Defined in: react/src/hooks.ts:38
retry: (messageId) => Promise<SendResult>;Defined in: react/src/hooks.ts:33
Sends a message whose outcome is unknown again, with the same clientId. Nothing else ever
sends a message twice.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
messageId |
string |
Returns
Section titled “Returns”Promise<SendResult>
run: RunInfo;Defined in: react/src/client.ts:242
Inherited from
Section titled “Inherited from”scopeKey?
Section titled “scopeKey?”optional scopeKey?: string;Defined in: react/src/hooks.ts:31
Local view identity, not sent to the host. Request cards use it to discard another scope’s drafts.
send: (input) => Promise<SendResult>;Defined in: react/src/hooks.ts:32
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
| string | MessageInput |
Returns
Section titled “Returns”Promise<SendResult>
startClientTool
Section titled “startClientTool”startClientTool: (requestId) => Promise<RespondResult>;Defined in: react/src/hooks.ts:35
Explicit user action only. Never wire this to an effect or a replay listener. After a result delivery failure, this resubmits the saved result, never reruns the handler.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
requestId |
string |
Returns
Section titled “Returns”Promise<RespondResult>
status
Section titled “status”status: ChatStatus;Defined in: react/src/client.ts:243
Inherited from
Section titled “Inherited from”stop: () => Promise<CommandResult>;Defined in: react/src/hooks.ts:37
Asks the host to stop the run, then waits for it to say so, with the observation still
open. Without transport.stop, closes the stream the run lives in and marks it stopped here.
Returns
Section titled “Returns”Promise<CommandResult>