MCPcopy
hub / github.com/mudler/LocalAI / createNewChat

Function createNewChat

core/http/static/chat.js:207–222  ·  view source on GitHub ↗
(model, systemPrompt, mcpMode)

Source from the content-addressed store, hash-verified

205
206// Create a new chat
207function createNewChat(model, systemPrompt, mcpMode) {
208 if (!window.Alpine || !Alpine.store("chat")) {
209 return null;
210 }
211
212 const chatStore = Alpine.store("chat");
213 const chat = chatStore.createChat(model, systemPrompt, mcpMode);
214
215 // Save to storage
216 saveChatsToStorage();
217
218 // Update UI to reflect new active chat
219 updateUIForActiveChat();
220
221 return chat;
222}
223
224// Switch to a different chat
225function switchChat(chatId) {

Callers

nothing calls this directly

Calls 3

saveChatsToStorageFunction · 0.85
updateUIForActiveChatFunction · 0.85
storeMethod · 0.80

Tested by

no test coverage detected