Skip to content

Commit

Permalink
fix getRecentMessageInteractions in composeState
Browse files Browse the repository at this point in the history
  • Loading branch information
bmgalego committed Nov 16, 2024
1 parent 4f4316e commit 30a6ba5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/core/src/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -838,10 +838,10 @@ Text: ${attachment.text}
recentInteractionsData: Memory[]
): Promise<string> => {
// 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 {
Expand All @@ -853,9 +853,9 @@ Text: ${attachment.text}
}
return `${sender}: ${message.content.text}`;
})
.join("\n");
);

return formattedInteractions;
return formattedInteractions.join("\n");
};

const formattedMessageInteractions =
Expand Down

0 comments on commit 30a6ba5

Please sign in to comment.