MCPcopy Index your code
hub / github.com/docker/genai-stack / addMessage

Function addMessage

front-end/src/lib/chat.store.js:13–21  ·  view source on GitHub ↗
(from, text, rag)

Source from the content-addressed store, hash-verified

11 const { subscribe, update } = writable({ state: chatStates.IDLE, data: [] });
12
13 function addMessage(from, text, rag) {
14 const newId = Math.random().toString(36).substring(2, 9);
15 update((state) => {
16 const message = { id: newId, from, text, rag };
17 state.data.push(message);
18 return state;
19 });
20 return newId;
21 }
22
23 function updateMessage(existingId, text, model = null) {
24 if (!existingId) {

Callers 1

sendFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected