Skip to content
Snippets Groups Projects
Commit 86610e6c authored by thucpn's avatar thucpn
Browse files

rename function in chat-ui

parent 0e4ee4a5
No related branches found
No related tags found
No related merge requests found
"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",
);
......
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")) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment