mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
29 lines
786 B
TypeScript
29 lines
786 B
TypeScript
"use client";
|
|
|
|
import { CopilotChat, CopilotKitProvider } from "@copilotkit/react-core/v2";
|
|
import { createA2UIMessageRenderer } from "@copilotkit/a2ui-renderer";
|
|
import { theme } from "./theme";
|
|
|
|
// Disable static optimization for this page
|
|
export const dynamic = "force-dynamic";
|
|
|
|
const A2UIMessageRenderer = createA2UIMessageRenderer({ theme });
|
|
const activityRenderers = [A2UIMessageRenderer];
|
|
|
|
export default function Home() {
|
|
return (
|
|
<CopilotKitProvider
|
|
runtimeUrl="/api/copilotkit"
|
|
showDevConsole="auto"
|
|
renderActivityMessages={activityRenderers}
|
|
>
|
|
<main
|
|
className="h-full overflow-auto w-screen"
|
|
style={{ minHeight: "100dvh" }}
|
|
>
|
|
<CopilotChat className="h-full" />;
|
|
</main>
|
|
</CopilotKitProvider>
|
|
);
|
|
}
|