Skip to content

Commit

Permalink
fix(agent): add createdAt to newly created messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas2D committed Sep 11, 2024
1 parent 1ddf5f7 commit 9313f52
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/agents/bee/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ export class BeeAgent extends BaseAgent<BeeRunInput, BeeRunOutput, BeeRunOptions
finalMessage = BaseMessage.of({
role: Role.ASSISTANT,
text: iteration.state.final_answer,
meta: {
createdAt: new Date(),
},
});
await run.emitter.emit("success", {
data: finalMessage,
Expand All @@ -174,6 +177,9 @@ export class BeeAgent extends BaseAgent<BeeRunInput, BeeRunOutput, BeeRunOptions
BaseMessage.of({
role: Role.USER,
text: input.prompt,
meta: {
createdAt: run.createdAt,
},
}),
);
}
Expand Down

0 comments on commit 9313f52

Please sign in to comment.