Skip to main content

Interface: LocalChatOptions<TResponse>

Defined in: react/src/hooks/useChat.ts:77

Chat with a bot that runs in this process (its model calls go to the provider or a proxy).

Extends​

  • CommonChatOptions

Type Parameters​

TResponse​

TResponse = string

Properties​

chatBot?​

optional chatBot?: Processable<string, TResponse>

Defined in: react/src/hooks/useChat.ts:89

Your own Processable (e.g. a pipeline) as the assistant.


maxToolIterations?​

optional maxToolIterations?: number

Defined in: react/src/hooks/useChat.ts:87

Maximum tool steps per turn.


model?​

optional model?: string | ModelConfig | AISDKLanguageModel

Defined in: react/src/hooks/useChat.ts:79

Model to use (default: core's DEFAULT_MODEL). A proxyUrl goes in its config.


onApprovalRequest?​

optional onApprovalRequest?: (approval) => void

Defined in: react/src/hooks/useChat.ts:52

Called once for each tool call that waits for the user (auto-approved ones excepted).

Parameters​

approval​

PendingApproval

Returns​

void

Inherited from​

CommonChatOptions.onApprovalRequest


onError?​

optional onError?: (error) => void

Defined in: react/src/hooks/useChat.ts:50

Parameters​

error​

Error

Returns​

void

Inherited from​

CommonChatOptions.onError


onEvent?​

optional onEvent?: (event, meta) => void

Defined in: react/src/hooks/useChat.ts:96

Every raw stream event of a turn, before it becomes message parts.

Parameters​

event​

StreamEvent

meta​
agentName​

string

Returns​

void


responseSchema?​

optional responseSchema?: unknown

Defined in: react/src/hooks/useChat.ts:85

Schema for the reply (JSON Schema or Zod); send then resolves with the parsed value.


shouldAskApproval?​

optional shouldAskApproval?: (toolName) => boolean

Defined in: react/src/hooks/useChat.ts:57

Whether a gated tool asks the user. Return false to approve its calls without asking. Default: every gated tool asks.

Parameters​

toolName​

string

Returns​

boolean

Inherited from​

CommonChatOptions.shouldAskApproval


skills?​

optional skills?: Skill[]

Defined in: react/src/hooks/useChat.ts:83

Keyword-triggered instruction sheets that bundle their own tools.


storage?​

optional storage?: HistoryStorage

Defined in: react/src/hooks/useChat.ts:94

Where the conversation is kept (default: in memory). It must be a stable reference; the chat shows what it holds when it loads.


systemPrompt?​

optional systemPrompt?: string

Defined in: react/src/hooks/useChat.ts:80


throttle?​

optional throttle?: number

Defined in: react/src/hooks/useChat.ts:59

Throttle for message updates while streaming, in ms. Default: none.

Inherited from​

CommonChatOptions.throttle


tools?​

optional tools?: Tools

Defined in: react/src/hooks/useChat.ts:81