MCPcopy Create free account
hub / github.com/aurora-develop/aurora / Get

Method Get

initialize/session_manager.go:36–50  ·  view source on GitHub ↗

Get 根据 conversationID 获取缓存的 ChatClientState。 不存在时返回 nil;调用方拿到 conversationID 后再调用 Register 注册新状态。

(conversationID string)

Source from the content-addressed store, hash-verified

34// Get 根据 conversationID 获取缓存的 ChatClientState。
35// 不存在时返回 nil;调用方拿到 conversationID 后再调用 Register 注册新状态。
36func (sm *SessionManager) Get(conversationID string) *chatgpt.ChatClientState {
37 if conversationID == "" {
38 return nil
39 }
40 sm.mu.RLock()
41 entry, ok := sm.sessions[conversationID]
42 sm.mu.RUnlock()
43 if !ok {
44 return nil
45 }
46 sm.mu.Lock()
47 entry.lastUsed = time.Now()
48 sm.mu.Unlock()
49 return entry.state
50}
51
52// Register 将 ChatClientState 注册到 conversationID 下。
53func (sm *SessionManager) Register(conversationID string, state *chatgpt.ChatClientState) {

Callers 9

uploadInlineImageFunction · 0.80
nightmareMethod · 0.80
responsesMethod · 0.80
normalizeImageEditImagesFunction · 0.80
imageEditDownloadHTTPURLFunction · 0.80
filesMethod · 0.80
handleTranscriptionMethod · 0.80
chatgptConversationMethod · 0.80
handleToolCallingMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected