#ifndef HUMANUS_FLOW_BASE_H #define HUMANUS_FLOW_BASE_H #include "../agent/base.h" namespace humanus { enum FlowType { PLANING = 0 }; const std::map FLOW_TYPE_MAP = { {PLANING, "planning"} }; // Base class for execution flows supporting multiple agents struct BaseFlow { std::map> agents; std::vector> tools; std::string primary_agent_key; BaseFlow(const std::map>& agents = {}, const std::vector>& tools = {}, const std::string& primary_agent_key = "") : agents(agents), tools(tools), primary_agent_key(primary_agent_key) { // If primary agent not specified, use first agent if (primary_agent_key.empty() && !agents.empty()) { primary_agent_key = agents.begin()->first; } } // Get the primary agent for the flow std::shared_ptr primary_agent() const { return agents.at(primary_agent_key); } // Get a specific agent by key std::shared_ptr get_agent(const std::string& key) const { return agents.at(key); } // Add a new agent to the flow void add_agent(const std::string& key, const std::shared_ptr& agent) { agents[key] = agent; } // Execute the flow with the given input virtual std::string execute(const std::string& input) = 0; }; } #endif // HUMANUS_FLOW_BASE_H