From abb27fee0eeee0baf17f0192b0fa76c9f490d54b Mon Sep 17 00:00:00 2001 From: Tomas Dvorak Date: Wed, 4 Dec 2024 17:59:56 +0100 Subject: [PATCH] feat(agents): extend bee start event Ref: #184 Signed-off-by: Tomas Dvorak --- src/agents/bee/runners/default/runner.ts | 5 +++-- src/agents/bee/types.ts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/agents/bee/runners/default/runner.ts b/src/agents/bee/runners/default/runner.ts index 0fb89975..914b4a40 100644 --- a/src/agents/bee/runners/default/runner.ts +++ b/src/agents/bee/runners/default/runner.ts @@ -85,9 +85,10 @@ export class DefaultRunner extends BaseRunner { } }, executor: async () => { - await emitter.emit("start", { meta }); + const tools = this.input.tools.slice(); + await emitter.emit("start", { meta, tools, memory: this.memory }); - const { parser, parserRegex } = this.createParser(this.input.tools); + const { parser, parserRegex } = this.createParser(tools); const llmOutput = await this.input.llm .generate(this.memory.messages.slice(), { signal, diff --git a/src/agents/bee/types.ts b/src/agents/bee/types.ts index 2bc4f004..18a0e459 100644 --- a/src/agents/bee/types.ts +++ b/src/agents/bee/types.ts @@ -69,7 +69,7 @@ export interface BeeUpdateMeta extends BeeMeta { } export interface BeeCallbacks { - start?: Callback<{ meta: BeeMeta }>; + start?: Callback<{ meta: BeeMeta; tools: AnyTool[]; memory: BaseMemory }>; error?: Callback<{ error: Error; meta: BeeMeta }>; retry?: Callback<{ meta: BeeMeta }>; success?: Callback<{