Skip to content

Commit

Permalink
feat(agent): add memory getter to the base class
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas2D committed Sep 9, 2024
1 parent 8aad96e commit bf985d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/agents/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { AgentMeta } from "@/agents/types.js";
import { Serializable } from "@/internals/serializable.js";
import { GetRunContext, GetRunInstance, Run, RunContext } from "@/context.js";
import { Emitter } from "@/emitter/emitter.js";
import { BaseMemory } from "@/memory/base.js";

export class AgentError extends FrameworkError {}

Expand Down Expand Up @@ -73,5 +74,6 @@ export abstract class BaseAgent<
this.emitter.destroy();
}

public abstract get memory(): BaseMemory;
public abstract get meta(): AgentMeta;
}
4 changes: 4 additions & 0 deletions src/agents/bee/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ export class BeeAgent extends BaseAgent<BeeRunInput, BeeRunOutput, BeeRunOptions
this.register();
}

get memory() {
return this.input.memory;
}

get meta(): AgentMeta {
if (this.input.meta) {
return this.input.meta;
Expand Down

0 comments on commit bf985d1

Please sign in to comment.