MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / selectAssistantForSession

Function selectAssistantForSession

src/stores/aiChat.ts:518–527  ·  view source on GitHub ↗
(chatKey: string, assistantId: string)

Source from the content-addressed store, hash-verified

516 }
517
518 function selectAssistantForSession(chatKey: string, assistantId: string): boolean {
519 const state = getSessionState(chatKey)
520 if (!state || state.isAIThinking) return false
521
522 const buffer = getOrCreateBuffer(state, getDisplayedBufferKey(state), assistantId)
523 buffer.assistantId = assistantId
524 state.selectedAssistantId = assistantId
525 assistantStore.selectAssistant(assistantId)
526 return true
527 }
528
529 async function loadAIChat(chatKey: string, aiChatId: string): Promise<boolean> {
530 const state = getSessionState(chatKey)

Callers 1

resetToSelectorOnEnterFunction · 0.85

Calls 3

getSessionStateFunction · 0.85
getOrCreateBufferFunction · 0.85
getDisplayedBufferKeyFunction · 0.85

Tested by

no test coverage detected