Skip to content

Commit

Permalink
feat(agents): extend bee start event
Browse files Browse the repository at this point in the history
Ref: #184
Signed-off-by: Tomas Dvorak <toomas2d@gmail.com>
  • Loading branch information
Tomas2D committed Dec 13, 2024
1 parent b9116be commit abb27fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/agents/bee/runners/default/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/agents/bee/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<{
Expand Down

0 comments on commit abb27fe

Please sign in to comment.