Documents
assistant-runtime-provider
assistant-runtime-provider
Type
External
Status
Published
Created
Mar 17, 2026
Updated
May 19, 2026
Updated by
Dosu Bot
Source
View

import { AssistantRuntimeProvider, AuiProvider } from "@/generated/typeDocs";

{/* AUTO-GENERATED PAGE by scripts/generate-api-reference.mts /}
{/
Do not edit manually. */}

{/* api-reference /}
{/
AUTO-GENERATED by scripts/generate-api-reference.mts /}
{/
Do not edit this block manually. */}

API Reference#

AssistantRuntimeProvider#

{/* api-example:AssistantRuntimeProvider */}

import { AssistantRuntimeProvider } from "@assistant-ui/react";
import { useChatRuntime, AssistantChatTransport } from "@assistant-ui/react-ai-sdk";

const MyApp = () => {
  const runtime = useChatRuntime({
    transport: new AssistantChatTransport({
      api: "/api/chat",
    }),
  });

  return (
    <AssistantRuntimeProvider runtime={runtime}>
      {/* your app */}
    </AssistantRuntimeProvider>
  );
};

{/* api-example:AssistantRuntimeProvider */}

<ParametersTable {...AssistantRuntimeProvider} />

AuiProvider#

Supplies an AssistantClient to the React tree.

Place near the root of any subtree that uses useAui or the
primitives built on it. Components rendered outside an AuiProvider
receive a default client whose scope accessors throw on use, so
missing-provider mistakes surface at the point of use.

When mounting a runtime built with one of the runtime hooks, use
AssistantRuntimeProvider — it installs an AuiProvider
internally — rather than wiring AuiProvider yourself.

function ScopedAssistant({ children, scopes }) {
  const aui = useAui(scopes);

  return <AuiProvider value={aui}>{children}</AuiProvider>;
}

<ParametersTable {...AuiProvider} />
{/* api-reference */}

assistant-runtime-provider | Dosu