feat: add WebSearchToolUI component and input UI, integrate Radix UI scroll area

This commit is contained in:
dayuan.jiang
2025-03-19 07:20:22 +00:00
parent 5d1a33b18d
commit 5a11c32bc4
8 changed files with 348 additions and 58 deletions

View File

@@ -0,0 +1,21 @@
import { makeAssistantToolUI } from "@assistant-ui/react";
type WebSearchArgs = {
query: string;
};
type WebSearchResult = {
title: string;
description: string;
url: string;
};
export const WebSearchToolUI = makeAssistantToolUI<
WebSearchArgs,
WebSearchResult
>({
toolName: "web_search",
render: ({ args, status }) => {
return <p>web_search({args.query}) </p>;
},
});