refactor(MessageHandler -> useServerStream): convert all relating files to TS and correct typings based on this change: properly refactor MessageHandler to a custom hook, where it's passed a submission object to instantiate the stream. This is the bare minimum groundwork for potentially having multiple streams running, which would be a big project to modularize a lot of the global state into maps/multiple streams, particular useful for having multiple views in place

This commit is contained in:
Danny Avila 2023-08-18 12:10:30 -04:00 committed by Danny Avila
parent 8b4d3c2c21
commit c74c68a135
5 changed files with 83 additions and 87 deletions

View file

@ -1,7 +1,7 @@
import { v4 } from 'uuid';
import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil';
import { parseConvo, getResponseSender } from 'librechat-data-provider';
import type { TMessage } from 'librechat-data-provider';
import type { TMessage, TSubmission } from 'librechat-data-provider';
import store from '~/store';
type TAskProps = {
@ -98,7 +98,7 @@ const useMessageHandler = () => {
error: false,
};
const submission = {
const submission: TSubmission = {
conversation: {
...currentConversation,
conversationId,