Skip to content

Commit

Permalink
fix(memory): make shallow copy of handlers
Browse files Browse the repository at this point in the history
Signed-off-by: Tomas Dvorak <[email protected]>
  • Loading branch information
Tomas2D committed Oct 10, 2024
1 parent 25234df commit be82ed5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/memory/tokenMemory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export class TokenMemory extends BaseMemory {
threshold: this.threshold,
syncThreshold: this.syncThreshold,
messages: shallowCopy(this.messages),
handlers: this.handlers,
handlers: shallowCopy(this.handlers),
tokensByMessage: this.messages
.map((message) => [message, this.tokensByMessage.get(message)])
.filter(([_, value]) => value !== undefined) as [BaseMessage, number][],
Expand Down

0 comments on commit be82ed5

Please sign in to comment.