Update NewChatProvider.tsx

This commit is contained in:
Nate Kelley 2025-02-11 11:22:27 -07:00
parent e7b96d9bd5
commit 75a9543e6c
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
1 changed files with 15 additions and 2 deletions

View File

@ -26,7 +26,21 @@ export const useBusterNewChat = () => {
const onStartNewChat = useMemoizedFn(async (prompt: string) => {
console.log('start new chat');
await new Promise((resolve) => setTimeout(resolve, 1000));
startListeningForChatProgress();
const result = await busterSocket.emitAndOnce({
emitEvent: {
route: '/chats/post',
payload: {
dataset_id: null, //TODO: add selected dataset id
prompt
}
},
responseEvent: {
route: '/chats/post:complete',
callback: completeChatCallback
}
});
stopListeningForChatProgress();
});
const onStartChatFromFile = useMemoizedFn(
@ -60,7 +74,6 @@ export const useBusterNewChat = () => {
callback: completeChatCallback
}
});
stopListeningForChatProgress();
}
);