Slide 62
Slide 62 text
「天気情報取得ツール」のUI
のレンダリング
クライアント側
weatherTool
の呼び出しに合わせて WeatherCard
コンポーネントをレンダリングするこ
とを useCopilotAction hook
呼び出しで指定
import { useCopilotAction } from "@copilotkit/react-core";
// Pageのコンポーネント内
useCopilotAction({
name: "weatherTool",
description: "Get the weather for a given location.",
available: "frontend",
parameters: [{ name: "location", type: "string", required: true }],
// WeatherCardのコンポーネントを返す
render: ({ args, result, status }) =>
});
https://github.com/CopilotKit/with-mastra/blob/main/src/app/page.tsx