1
1
mirror of https://github.com/leon-ai/leon.git synced 2024-12-23 16:53:04 +03:00

refactor(bridge/nodejs): protected memory constructor

This commit is contained in:
louistiti 2023-05-16 23:07:12 +08:00
parent 5539130dd9
commit 51152a0fe3
No known key found for this signature in database
GPG Key ID: 0A1C3B043E70C77D
2 changed files with 2 additions and 1 deletions

View File

@ -61,6 +61,7 @@ export class Memory<T = unknown> {
`You cannot read the memory "${this.name}" as it belongs to another skill which haven't written to this memory yet` `You cannot read the memory "${this.name}" as it belongs to another skill which haven't written to this memory yet`
) )
} }
try { try {
if (!fs.existsSync(this.memoryPath)) { if (!fs.existsSync(this.memoryPath)) {
await this.clear() await this.clear()

View File

@ -2,7 +2,7 @@ export abstract class Widget<T> {
public readonly type: string public readonly type: string
public readonly options: T public readonly options: T
public constructor(options: T) { protected constructor(options: T) {
this.type = this.constructor.name this.type = this.constructor.name
this.options = options this.options = options
} }