MCPcopy Create free account
hub / github.com/admineral/OpenAI-Assistant-API-Chat / updateChatState

Function updateChatState

app/modules/chatModules.ts:81–94  ·  view source on GitHub ↗
(prevMessages: Message[], newMessages: Message[], setChatMessages: (messages: any[]) => void)

Source from the content-addressed store, hash-verified

79 * @param {Function} setChatMessages - State setter function for chat messages.
80 */
81export const updateChatState = (prevMessages: Message[], newMessages: Message[], setChatMessages: (messages: any[]) => void): Promise<void> => {
82 console.log('updateChatState called with new messages:', newMessages);
83 console.log('Current messages:', prevMessages);
84
85 console.log('Updating chat state...');
86 const updatedMessages = [...prevMessages, ...newMessages];
87
88 return new Promise((resolve) => {
89 setChatMessages(updatedMessages);
90 console.log('Chat state updated successfully.');
91 console.log('Updated messages:', updatedMessages);
92 resolve();
93 });
94};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected