mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-26 09:16:22 +02:00
Added Further question component and streaming fix
This commit is contained in:
parent
1318feef66
commit
5197269c43
5 changed files with 92 additions and 61 deletions
18
surfsense_web/components/chat_v2/ChatFurtherQuestions.tsx
Normal file
18
surfsense_web/components/chat_v2/ChatFurtherQuestions.tsx
Normal 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} />;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue