diff --git a/templates/types/streaming/nextjs/app/components/ui/chat/custom/deep-research-card.tsx b/templates/types/streaming/nextjs/app/components/ui/chat/custom/deep-research-card.tsx index fc77cc70bb8cd805c58b4b9d77826691d7c5a7e6..bc6118e61eebb0fe9b34a581c43365cc5b973c07 100644 --- a/templates/types/streaming/nextjs/app/components/ui/chat/custom/deep-research-card.tsx +++ b/templates/types/streaming/nextjs/app/components/ui/chat/custom/deep-research-card.tsx @@ -1,6 +1,6 @@ "use client"; -import { getCustomAnnotationData, useChatMessage } from "@llamaindex/chat-ui"; +import { getCustomAnnotation, useChatMessage } from "@llamaindex/chat-ui"; import { AlertCircle, CheckCircle2, @@ -146,7 +146,7 @@ export function DeepResearchCard({ className }: DeepResearchCardProps) { const { message } = useChatMessage(); const state = useMemo(() => { - const deepResearchEvents = getCustomAnnotationData<DeepResearchEvent>( + const deepResearchEvents = getCustomAnnotation<DeepResearchEvent>( message.annotations, (annotation) => annotation?.type === "deep_research_event", ); diff --git a/templates/types/streaming/nextjs/app/components/ui/chat/tools/chat-tools.tsx b/templates/types/streaming/nextjs/app/components/ui/chat/tools/chat-tools.tsx index 30606e5fda942b597d9118c47bc25746d171d774..a7e4eb218a927458b02e50ad8313963b0813eb8f 100644 --- a/templates/types/streaming/nextjs/app/components/ui/chat/tools/chat-tools.tsx +++ b/templates/types/streaming/nextjs/app/components/ui/chat/tools/chat-tools.tsx @@ -1,7 +1,7 @@ import { Message, MessageAnnotation, - getAnnotationData, + getChatUIAnnotation, useChatMessage, useChatUI, } from "@llamaindex/chat-ui"; @@ -22,7 +22,7 @@ export function ToolAnnotations() { // Get the tool data from the message annotations const annotations = message.annotations as MessageAnnotation[] | undefined; const toolData = annotations - ? (getAnnotationData(annotations, "tools") as unknown as ToolData[]) + ? (getChatUIAnnotation(annotations, "tools") as unknown as ToolData[]) : null; return toolData?.[0] ? ( <ChatTools data={toolData[0]} artifactVersion={artifactVersion} /> @@ -89,7 +89,7 @@ function getArtifactVersion( let versionIndex = 1; for (const m of messages) { const toolData = m.annotations - ? (getAnnotationData(m.annotations, "tools") as unknown as ToolData[]) + ? (getChatUIAnnotation(m.annotations, "tools") as unknown as ToolData[]) : null; if (toolData?.some((t) => t.toolCall.name === "artifact")) {