diff --git a/src/context.ts b/src/context.ts index 790b7b5..2d920b1 100644 --- a/src/context.ts +++ b/src/context.ts @@ -238,7 +238,7 @@ export const pluginSettings = t.Object({ }) export const serverContext = new Elysia({ name: 'server-context' }).use(httpError).decorate({ - // cat: cheshireCat, // TODO: Fix RangeError: Maximum call stack size exceeded. + // cat: cheshireCat, // FIXME: Fix RangeError: Maximum call stack size exceeded. mh: madHatter, rh: rabbitHole, log, diff --git a/src/looking_glass/agent-manager.ts b/src/looking_glass/agent-manager.ts index 9081540..943eb23 100644 --- a/src/looking_glass/agent-manager.ts +++ b/src/looking_glass/agent-manager.ts @@ -230,7 +230,7 @@ export class AgentManager { output: memoryOutput, intermediateSteps, } - const afterMemory = madHatter.executeHook('afterMemoryChain', reply, stray) + const afterMemory = await madHatter.executeHook('afterMemoryChain', reply, stray) return afterMemory } diff --git a/src/looking_glass/cheshire-cat.ts b/src/looking_glass/cheshire-cat.ts index 01dd730..92fb1f4 100644 --- a/src/looking_glass/cheshire-cat.ts +++ b/src/looking_glass/cheshire-cat.ts @@ -157,7 +157,7 @@ export class CheshireCat { { logMessage: 'Failed to retrieve embedder size. Reset to FakeEmbeddings.' }, ) - // TODO: Should we also set it in the db? + // QUESTION: Should we also set it in the db? if (error) this.embedder = getEmbedder('FakeEmbeddings')!.initModel({}) this._embedderSize = vector.length diff --git a/src/looking_glass/stray-cat.ts b/src/looking_glass/stray-cat.ts index c3f5f00..a2e0225 100644 --- a/src/looking_glass/stray-cat.ts +++ b/src/looking_glass/stray-cat.ts @@ -132,7 +132,7 @@ export class StrayCat { log.warn(`No websocket connection is open for "${this.userId}". Queuing the message...`) this.wsQueue.push(msg) } - madHatter.executeHook('afterSendMessage', msg, this) + madHatter.executeHook('afterSendMessage', msg, this) // QUESTION: Should we introduce MaybePromise also here? } /** @@ -148,7 +148,7 @@ export class StrayCat { const response = this.userMessage = await madHatter.executeHook('beforeReadMessage', msg, this) - // TODO: Find another way to handle this + // FEATURE: Find another way to handle this if (response.text.length > cheshireCat.embedderSize) { log.warn(`The input is too long. Storing it as document...`) await rabbitHole.ingestContent(this, response.text) @@ -257,7 +257,7 @@ ${labelsList}${examplesList} async queryDb>( question: string, type: T, - source: Omit, 'type'>, // TODO: Fix type inference + source: Omit, 'type'>, // BUG: Fix type inference ) { const appDataSource = new DataSource({ type, ...source } as DataSourceOptions) const db = await SqlDatabase.fromDataSourceParams({ appDataSource }) @@ -316,7 +316,7 @@ ${labelsList}${examplesList} */ addInteraction(interaction: ModelInteraction) { this.modelsInteractions.push(interaction) - madHatter.executeHook('afterModelInteraction', interaction, this) + madHatter.executeHook('afterModelInteraction', interaction, this) // QUESTION: Should we introduce MaybePromise also here? } /** @@ -386,7 +386,7 @@ ${labelsList}${examplesList} log.info(`Recalled ${memories.length} memories for ${key} collection.`) this.workingMemory[key] = memories } - madHatter.executeHook('afterRecallMemories', structuredClone(this.workingMemory), this) + await madHatter.executeHook('afterRecallMemories', structuredClone(this.workingMemory), this) interaction.reply = queryEmbedding interaction.endedAt = Date.now()