From 30a6ba512c0a92bf9bad1e34fd8538a98cbe856f Mon Sep 17 00:00:00 2001 From: Bruno Galego Date: Sat, 16 Nov 2024 19:54:27 +0000 Subject: [PATCH] fix getRecentMessageInteractions in composeState --- packages/core/src/runtime.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/core/src/runtime.ts b/packages/core/src/runtime.ts index 2c4e5940..f221d417 100644 --- a/packages/core/src/runtime.ts +++ b/packages/core/src/runtime.ts @@ -838,10 +838,10 @@ Text: ${attachment.text} recentInteractionsData: Memory[] ): Promise => { // Format the recent messages - const formattedInteractions = await recentInteractionsData - .map(async (message) => { + const formattedInteractions = await Promise.all( + recentInteractionsData.map(async (message) => { const isSelf = message.userId === this.agentId; - let sender; + let sender: string; if (isSelf) { sender = this.character.name; } else { @@ -853,9 +853,9 @@ Text: ${attachment.text} } return `${sender}: ${message.content.text}`; }) - .join("\n"); + ); - return formattedInteractions; + return formattedInteractions.join("\n"); }; const formattedMessageInteractions =