ChatClientTools

Unpublished development API. This package is under development and is not available as a published release.

The part of ClientTools that Chat reads; it never runs a tool itself.

import type { ChatClientTools } from '@threadplane/react/chat';

Declaration

export interface ChatClientTools  {
  getSnapshot(): readonly PendingClientToolCall[];
  render(call: ClientToolCallLike): ReactNode | undefined;
  subscribe(notify: () => void): () => void;
}

Members

getSnapshot · overload 1

Calls waiting for an answer, oldest first. A new array whenever one starts or ends.

getSnapshot(): readonly PendingClientToolCall[];

Returns

readonly PendingClientToolCall[]

render · overload 1

The view for a pending call of one of these tools, or undefined when the call is not one of them, is already settled, or has no handler waiting (such as a call observed from history).

render(call: ClientToolCallLike): ReactNode | undefined;

Parameters

call · required
ClientToolCallLike

Returns

ReactNode | undefined

subscribe · overload 1

subscribe(notify: () => void): () => void;

Parameters

notify · required
() => void

Returns

() => void