Skip to content

Commit

Permalink
wip(agents): initial implementation of human-intervention in plan adj…
Browse files Browse the repository at this point in the history
…ustment

- Added basic structure for handling user input during plan adjustments.

Ref: i-am-bee#121
Signed-off-by: Matias Molinas <[email protected]>
  • Loading branch information
matiasmolinas committed Dec 19, 2024
1 parent 6c8c1e8 commit 69f263f
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions examples/agents/experimental/replan_extended.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,35 @@ import { OpenMeteoTool } from "bee-agent-framework/tools/weather/openMeteo";
import { UnconstrainedMemory } from "bee-agent-framework/memory/unconstrainedMemory";
import { createConsoleReader } from "examples/helpers/io.js";
import { RePlanAgent } from "bee-agent-framework/agents/experimental/replan/agent";
import { BAMChatLLM } from "bee-agent-framework/adapters/bam/chat";
import { OllamaChatLLM } from "bee-agent-framework/adapters/ollama/chat";
import { OpenAIChatLLM } from "bee-agent-framework/adapters/openai/chat";
import { InterventionTool } from "../../tools/experimental/intervention.js";
import { HumanTool } from "../../tools/experimental/human.js";
import { InterventionManager } from "../../managers/interventionManager.js";
import { Emitter } from "bee-agent-framework/emitter/emitter";
import { RePlanEvents } from "../../emitter/replan.js";

const reader = createConsoleReader();

const llm = BAMChatLLM.fromPreset("meta-llama/llama-3-1-70b-instruct");
// Initialize LLM
//const llm = new OllamaChatLLM({
// modelId: "granite3.1-dense:8b",
//});
const llm = new OpenAIChatLLM({
modelId: "gpt-4o-mini",
});

const memory = new UnconstrainedMemory();

const interventionTool = new InterventionTool(reader);
const humanTool = new HumanTool(reader);

const agent = new RePlanAgent({
llm,
memory,
tools: [new DuckDuckGoSearchTool(), new OpenMeteoTool(), interventionTool],
tools: [new OpenMeteoTool(), humanTool],
});

const interventionManager = new InterventionManager(Emitter.root, interventionTool);
//const interventionManager = new InterventionManager(Emitter.root, interventionTool);

try {
for await (const { prompt } of reader) {
Expand Down

0 comments on commit 69f263f

Please sign in to comment.