Hi,
Firstly, nice work on Copilot Kit.
I am using the new CopilotChat v2 components; however, I cannot get the thumbs up and thumbs down components to render. I have also tried to assign the onClick handlers for both via the messageView, assistantMessage props however they don't seem to be passed to the child component correctly.
I have included my sample code below. Any help will be greatly appreciated.
"use client";
import { useCopilotAction } from "@copilotkit/react-core";
import { CopilotChat, type AssistantMessage } from "@copilotkit/react-core/v2";
export default function CopilotKitPage() {
const handleThumbsDown = (message: AssistantMessage) => {
console.log("Thumbs down clicked for message:", message);
alert("Sorry to hear that! We'll strive to do better.");
};
const handleThumbsUp = (message: AssistantMessage) => {
console.log("Thumbs up clicked for message:", message);
alert("Thanks for the feedback!");
};
return (
<main className="flex justify-center items-center min-h-screen w-full">
<CopilotChat
className="w-4/5 min-h-screen"
messageView={{
assistantMessage: {
onThumbsUp: handleThumbsUp,
onThumbsDown: handleThumbsDown,
},
}}
labels={{
modalHeaderTitle: "Chat with your assistant",
chatInputPlaceholder: "How can I help you today?",
chatDisclaimerText: "",
assistantMessageToolbarThumbsUpLabel: "Thumbs up",
assistantMessageToolbarThumbsDownLabel: "Thumbs down",
}}
/>
</main>
);
}