MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / getOrCreateBuffer

Function getOrCreateBuffer

src/stores/aiChat.ts:362–371  ·  view source on GitHub ↗
(
    state: AIChatSessionState,
    bufferKey: string,
    assistantId: string | null = null
  )

Source from the content-addressed store, hash-verified

360 }
361
362 function getOrCreateBuffer(
363 state: AIChatSessionState,
364 bufferKey: string,
365 assistantId: string | null = null
366 ): AIChatBuffer {
367 if (!state.aiChatBuffers[bufferKey]) {
368 state.aiChatBuffers[bufferKey] = createAIChatBuffer(assistantId)
369 }
370 return state.aiChatBuffers[bufferKey]
371 }
372
373 /**
374 * 将当前 UI 绑定到某个 conversation buffer。

Callers 6

bindDisplayedBufferFunction · 0.85
renameBufferKeyFunction · 0.85
loadAIChatFunction · 0.85
sendMessageFunction · 0.85
editMessageAndRegenerateFunction · 0.85

Calls 1

createAIChatBufferFunction · 0.85

Tested by

no test coverage detected