MCPcopy
hub / github.com/openai/openai-assistants-quickstart / appendToLastMessage

Function appendToLastMessage

app/components/chat.tsx:217–226  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

215 */
216
217 const appendToLastMessage = (text) => {
218 setMessages((prevMessages) => {
219 const lastMessage = prevMessages[prevMessages.length - 1];
220 const updatedLastMessage = {
221 ...lastMessage,
222 text: lastMessage.text + text,
223 };
224 return [...prevMessages.slice(0, -1), updatedLastMessage];
225 });
226 };
227
228 const appendMessage = (role, text) => {
229 setMessages((prevMessages) => [...prevMessages, { role, text }]);

Callers 3

handleTextDeltaFunction · 0.85
handleImageFileDoneFunction · 0.85
toolCallDeltaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected