Skip to main content

Interface: UseConversation<T>

Defined in: react/src/conversation.ts:7

Extends​

  • ConversationState

Type Parameters​

T​

T = unknown

Properties​

conversation​

conversation: Conversation<T>

Defined in: react/src/conversation.ts:8


error?​

optional error?: Error

Defined in: client/dist/index.d.ts:465

Inherited from​

ConversationState.error


messages​

messages: Message[]

Defined in: client/dist/index.d.ts:463

Inherited from​

ConversationState.messages


pendingInputs​

pendingInputs: PendingInput[]

Defined in: client/dist/index.d.ts:473

Tool calls waiting for submitToolResult.

Inherited from​

ConversationState.pendingInputs


provider?​

optional provider?: ProviderInfo

Defined in: client/dist/index.d.ts:467

Provider of the current or last turn.

Inherited from​

ConversationState.provider


queued​

queued: number

Defined in: client/dist/index.d.ts:471

Turns waiting behind the running one.

Inherited from​

ConversationState.queued


rejectToolCall​

rejectToolCall: (callId, error?) => void

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

Refuse a tool call that has no execute.

Parameters​

callId​

string

error?​

string

Returns​

void


reset​

reset: (messages?) => void

Defined in: react/src/conversation.ts:14

Clear the history and end the provider session.

Parameters​

messages?​

MessageInput[]

Returns​

void


send​

send: (input, options?) => ChatRun<T>

Defined in: react/src/conversation.ts:10

Send a user message; queued behind the running turn, if any.

Parameters​

input​

MessageInput

options?​

SendOptions

Returns​

ChatRun<T>


session​

session: "ready" | "none" | "starting"

Defined in: client/dist/index.d.ts:469

Provider session: starting while an agent boots, ready once it can answer at once.

Inherited from​

ConversationState.session


status​

status: ConversationStatus

Defined in: client/dist/index.d.ts:464

Inherited from​

ConversationState.status


stop​

stop: () => void

Defined in: react/src/conversation.ts:12

Cancel the running turn and every queued one.

Returns​

void


submitToolResult​

submitToolResult: (callId, result) => void

Defined in: react/src/conversation.ts:18

Answer a tool call that has no execute (see pendingInputs).

Parameters​

callId​

string

result​

unknown

Returns​

void


warm​

warm: () => Promise<boolean>

Defined in: react/src/conversation.ts:16

Start the visitor's AI ahead of the first message.

Returns​

Promise<boolean>