logoassistant-ui

ToolFallback

Overview

The ToolFallback component displays a default ToolUI for tools that do not have a dedicated ToolUI.

Getting Started

Add tool-fallback

npx shadcn@latest add "https://r.assistant-ui.com/tool-fallback"

This adds a /components/assistant-ui/tool-fallback.tsx file to your project, which you can adjust as needed.

Use it in your application

Pass the ToolFallback component to the MessagePrimitive.Content component

/components/assistant-ui/thread.tsx
import {  } from "@/components/assistant-ui/tool-fallback";
 
const :  = () => {
  return (
    <. ="...">
      < ="...">
        <.
          ={{ : { :  } }}
        />
      </>
      < />
 
      < ="..." />
    </.>
  );
};

On this page

Edit on Github