preview version
parent
83ba3d3f63
commit
ffcf917d3e
81
main.cpp
81
main.cpp
|
@ -43,52 +43,59 @@ int main() {
|
||||||
SetConsoleCtrlHandler(reinterpret_cast<PHANDLER_ROUTINE>(console_ctrl_handler), true);
|
SetConsoleCtrlHandler(reinterpret_cast<PHANDLER_ROUTINE>(console_ctrl_handler), true);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
// Manus agent = Manus();
|
|
||||||
// while (true) {
|
Manus agent = Manus();
|
||||||
// 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
|
|
||||||
);
|
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
if (agent_ptr->current_step == agent_ptr->max_steps) {
|
if (agent.current_step == agent.max_steps) {
|
||||||
std::cout << "Program automatically paused after " << agent_ptr->current_step << " steps." << std::endl;
|
std::cout << "Program automatically paused after " << agent.max_steps << " steps." << std::endl;
|
||||||
std::cout << "Enter your prompt (like 'continue' to continue or 'exit' to quit): ";
|
std::cout << "Enter your prompt (enter empty line to resume or 'exit' to quit): ";
|
||||||
agent_ptr->current_step = 0;
|
agent.current_step = 0;
|
||||||
} else {
|
} else {
|
||||||
std::cout << "Enter your prompt (or 'exit' to quit): ";
|
std::cout << "Enter your prompt (or 'exit' to quit): ";
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string prompt;
|
std::string prompt;
|
||||||
std::getline(std::cin, prompt);
|
std::getline(std::cin, prompt);
|
||||||
if (prompt == "exit") {
|
if (prompt == "exit") {
|
||||||
logger->info("Goodbye!");
|
logger->info("Goodbye!");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
logger->info("Processing your request...");
|
||||||
std::cout << "Processing your request..." << std::endl;
|
agent.run(prompt);
|
||||||
auto result = flow->execute(prompt);
|
|
||||||
std::cout << result << std::endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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
2
mcp
|
@ -1 +1 @@
|
||||||
Subproject commit 5bc09d6ab03c3d793c3550954fc5cd959d017303
|
Subproject commit 5e9ff48b070a11ba20529feb22c68d0e9ef46f3d
|
Loading…
Reference in New Issue