Memory.getThreadById()
.getThreadById() 方法按 ID 擷取指定 thread。
使用範例使用範例 的直接連結
await memory?.getThreadById({ threadId: 'thread-123' })
參數參數 的直接連結
threadId:
string
要擷取的 thread ID。
傳回值傳回值 的直接連結
thread:
Promise<StorageThreadType | null>
Promise 會解析為與指定 ID 關聯的 thread;如找不到,則為 null。
相關內容相關內容 的直接連結
- Memory class 參考
- Memory 入門(涵蓋 thread 概念)
- createThread
- listThreads