preview version

main
hkr04 2025-03-17 15:51:14 +08:00
parent 83ba3d3f63
commit ffcf917d3e
2 changed files with 45 additions and 38 deletions

View File

@ -43,52 +43,59 @@ int main() {
SetConsoleCtrlHandler(reinterpret_cast<PHANDLER_ROUTINE>(console_ctrl_handler), true);
#endif
}
// Manus agent = Manus();
// while (true) {
// std::string prompt;
// std::cout << "Enter your prompt (or 'exit' to quit): ";
// std::getline(std::cin, prompt);
// if (prompt == "exit") {
// logger->info("Goodbye!");
// break;
// }
// logger->info("Processing your request...");
// agent.run(prompt);
// }
std::shared_ptr<BaseAgent> agent_ptr = std::make_shared<Manus>();
std::map<std::string, std::shared_ptr<BaseAgent>> agents;
agents["default"] = agent_ptr;
auto flow = FlowFactory::create_flow(
FlowType::PLANNING,
nullptr, // llm
nullptr, // planning_tool
std::vector<std::string>{}, // executor_keys
"", // active_plan_id
agents, // agents
std::vector<std::shared_ptr<BaseTool>>{}, // tools
"default" // primary_agent_key
);
Manus agent = Manus();
while (true) {
if (agent_ptr->current_step == agent_ptr->max_steps) {
std::cout << "Program automatically paused after " << agent_ptr->current_step << " steps." << std::endl;
std::cout << "Enter your prompt (like 'continue' to continue or 'exit' to quit): ";
agent_ptr->current_step = 0;
if (agent.current_step == agent.max_steps) {
std::cout << "Program automatically paused after " << agent.max_steps << " steps." << std::endl;
std::cout << "Enter your prompt (enter empty line to resume or 'exit' to quit): ";
agent.current_step = 0;
} else {
std::cout << "Enter your prompt (or 'exit' to quit): ";
}
std::string prompt;
std::getline(std::cin, prompt);
if (prompt == "exit") {
logger->info("Goodbye!");
break;
}
std::cout << "Processing your request..." << std::endl;
auto result = flow->execute(prompt);
std::cout << result << std::endl;
logger->info("Processing your request...");
agent.run(prompt);
}
// std::shared_ptr<BaseAgent> agent_ptr = std::make_shared<Manus>();
// std::map<std::string, std::shared_ptr<BaseAgent>> agents;
// agents["default"] = agent_ptr;
// auto flow = FlowFactory::create_flow(
// FlowType::PLANNING,
// nullptr, // llm
// nullptr, // planning_tool
// std::vector<std::string>{}, // executor_keys
// "", // active_plan_id
// agents, // agents
// std::vector<std::shared_ptr<BaseTool>>{}, // tools
// "default" // primary_agent_key
// );
// while (true) {
// if (agent_ptr->current_step == agent_ptr->max_steps) {
// std::cout << "Program automatically paused after " << agent_ptr->current_step << " steps." << std::endl;
// std::cout << "Enter your prompt (enter empty line to resume or 'exit' to quit): ";
// agent_ptr->current_step = 0;
// } else {
// std::cout << "Enter your prompt (or 'exit' to quit): ";
// }
// std::string prompt;
// std::getline(std::cin, prompt);
// if (prompt == "exit") {
// logger->info("Goodbye!");
// break;
// }
// std::cout << "Processing your request..." << std::endl;
// auto result = flow->execute(prompt);
// std::cout << result << std::endl;
// }
}

2
mcp

@ -1 +1 @@
Subproject commit 5bc09d6ab03c3d793c3550954fc5cd959d017303
Subproject commit 5e9ff48b070a11ba20529feb22c68d0e9ef46f3d