MCPcopy
hub / github.com/wavetermdev/waveterm / Get

Method Get

pkg/aiusechat/chatstore/chatstore.go:23–43  ·  view source on GitHub ↗
(chatId string)

Source from the content-addressed store, hash-verified

21}
22
23func (cs *ChatStore) Get(chatId string) *uctypes.AIChat {
24 cs.lock.Lock()
25 defer cs.lock.Unlock()
26
27 chat := cs.chats[chatId]
28 if chat == nil {
29 return nil
30 }
31
32 // Copy the chat to prevent concurrent access issues
33 copyChat := &uctypes.AIChat{
34 ChatId: chat.ChatId,
35 APIType: chat.APIType,
36 Model: chat.Model,
37 APIVersion: chat.APIVersion,
38 NativeMessages: make([]uctypes.GenAIMessage, len(chat.NativeMessages)),
39 }
40 copy(copyChat.NativeMessages, chat.NativeMessages)
41
42 return copyChat
43}
44
45func (cs *ChatStore) Delete(chatId string) {
46 cs.lock.Lock()

Callers 15

ValidateIncomingRequestFunction · 0.45
WaveAIGetChatHandlerFunction · 0.45
CreateWriteTextFileDiffFunction · 0.45
UpdateToolUseDataFunction · 0.45
RemoveToolUseCallFunction · 0.45
ensureAltSseFunction · 0.45
RunGeminiChatStepFunction · 0.45
UpdateToolUseDataFunction · 0.45
RemoveToolUseCallFunction · 0.45
RunChatStepFunction · 0.45
RunAnthropicChatStepFunction · 0.45

Calls

no outgoing calls

Tested by 1