Added Further question component and streaming fix

This commit is contained in:
Utkarsh-Patel-13 2025-07-25 15:40:29 -07:00
parent 1318feef66
commit 5197269c43
5 changed files with 92 additions and 61 deletions

View file

@ -0,0 +1,18 @@
"use client";
import { SuggestedQuestions } from "@llamaindex/chat-ui/widgets";
import { getAnnotationData, Message, useChatUI } from "@llamaindex/chat-ui";
export const ChatFurtherQuestions: React.FC<{message: Message}> = ({message}) => {
const annotations: string[][] = getAnnotationData(message, "FURTHER_QUESTIONS");
const { append, requestData } = useChatUI();
console.log('🔥 annotations', annotations);
if (annotations.length !== 1 || annotations[0].length === 0) {
return <></>;
}
return <SuggestedQuestions questions={annotations[0]} append={append} requestData={requestData} />;
};