Hooks

Runtime Hooks

Hooks for creating assistant runtimes.

Runtime hooks create the AssistantRuntime passed to AssistantRuntimeProvider.

import {
  AssistantRuntimeProvider,
  useLocalRuntime,
} from "@assistant-ui/react";

function App() {
  const runtime = useLocalRuntime(chatModelAdapter);

  return (
    <AssistantRuntimeProvider runtime={runtime}>
      {children}
    </AssistantRuntimeProvider>
  );
}

Core Runtime Hooks

Integration Runtime Hooks

Runtime Options

Most runtime hooks accept adapters for persistence, attachments, speech, dictation, feedback, and suggestions. See Adapters for the adapter map.