mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-09-07 08:26:15 +00:00
fixed bugs:
This commit is contained in:
parent
eb3eb6da44
commit
21fbcf0037
3 changed files with 7 additions and 6 deletions
|
|
@ -44,7 +44,8 @@ export interface SupermemoryMastraOptions extends SupermemoryBaseOptions {
|
|||
containerTag: string
|
||||
|
||||
/**
|
||||
* Custom ID for grouping messages into the same document (e.g., conversation ID)
|
||||
* Custom ID for grouping messages into the same document (e.g., conversation ID).
|
||||
* Required for Mastra processors.
|
||||
*/
|
||||
customId: string
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,19 +13,19 @@ export class MemoryCache<T = string> {
|
|||
* Normalizes the message by trimming and collapsing whitespace.
|
||||
*
|
||||
* @param containerTag - The container tag/user ID
|
||||
* @param conversationId - Optional conversation ID
|
||||
* @param customId - Custom ID for grouping messages (e.g., conversation ID)
|
||||
* @param mode - The memory retrieval mode
|
||||
* @param message - The user message content
|
||||
* @returns A unique cache key for this turn
|
||||
*/
|
||||
static makeTurnKey(
|
||||
containerTag: string,
|
||||
conversationId: string | undefined,
|
||||
customId: string | undefined,
|
||||
mode: MemoryMode,
|
||||
message: string,
|
||||
): string {
|
||||
const normalizedMessage = message.trim().replace(/\s+/g, " ")
|
||||
return `${containerTag}:${conversationId || ""}:${mode}:${normalizedMessage}`
|
||||
return `${containerTag}:${customId || ""}:${mode}:${normalizedMessage}`
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -121,8 +121,8 @@ export interface SupermemoryBaseOptions {
|
|||
apiKey?: string
|
||||
/** Custom Supermemory API base URL */
|
||||
baseUrl?: string
|
||||
/** Conversation ID to group messages into the same document for a conversation */
|
||||
conversationId?: string
|
||||
/** Custom ID to group messages into the same document (e.g., conversation ID, thread ID) */
|
||||
customId?: string
|
||||
/** Memory retrieval mode */
|
||||
mode?: MemoryMode
|
||||
/** Memory persistence mode */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue