Utilities

Utilities

Miscellaneous @assistant-ui/react utilities for custom rendering, composition, and advanced assistant UI behavior.

API Reference

AssistantCloud

AssistantCloud
constructor?: (config: AssistantCloudConfig) => AssistantCloud

threads?: AssistantCloudThreads

auth?: { tokens: AssistantCloudAuthTokens; }

runs?: AssistantCloudRuns

files?: AssistantCloudFiles

telemetry?: AssistantCloudTelemetryConfig

ChainOfThoughtClient

ChainOfThoughtClient props
parts: readonly ChainOfThoughtPart[]

getMessagePart: (selector: { index: number }) => PartMethods

DevToolsHooks

DevToolsHooks
static subscribe?: (listener: () => void) => Unsubscribe

static clearEventLogs?: (apiId: number) => void

static getApis?: () => Map<number, DevToolsApiEntry>

ExportedMessageRepository

ExportedMessageRepository
headId?: string | null

messages: Array<{ message: ThreadMessage; parentId: string | null; runConfig?: RunConfig; }>

InMemoryThreadList

InMemoryThreadList props
thread: (threadId: string) => ResourceElement<ClientOutput<"thread">>

onSwitchToThread?: (threadId: string) => void

onSwitchToNewThread?: () => void

Interactables

const Interactables: () => ResourceElement<ClientOutput<"interactables">, undefined>;

makeAssistantVisible

const makeAssistantVisible: <T extends ComponentType<any>>(Component: T, config?: { clickable?: boolean | undefined; editable?: boolean | undefined; }) => T;

SingleThreadList

A minimal threads scope that wraps a single thread. Automatically provided by ExternalThread when no threads scope exists. Mounts the provided thread resource element.

SingleThreadList props
thread: ClientElement<"thread">

type: Resource<R, P> & { [fnSymbol]: (props: P) => R }

props: P

key?: string | number

Suggestions

const Suggestions: {
  (): ResourceElement<
    ClientOutput<"suggestions">,
    undefined
  >;
  (
    suggestions: SuggestionConfig[],
  ): ResourceElement<
    ClientOutput<"suggestions">,
    SuggestionConfig[]
  >;
};