logoassistant-ui
Reference

<AssistantRuntimeProvider />

The AssistantRuntimeProvider provides data and APIs used by assistant-ui components.

Almost all components in assistant-ui require an AssistantRuntimeProvider around them to function properly.

You must either wrap your app in an AssistantRuntimeProvider or pass a runtime to the <Thread /> component instead.

import { AssistantRuntimeProvider } from "@assistant-ui/react";
 
const MyApp = () => {
  const runtime = useEdgeRuntime({ api: "/api/chat" });
 
  return (
    <AssistantRuntimeProvider runtime={runtime}>
      {/* your app */}
    </AssistantRuntimeProvider>
  );
};

Properties

AssistantRuntimeProvider

runtime:

AssistantRuntime

The runtime to provide to the rest of your app.

children?:

React.ReactNode

On this page

Edit on Github