#ifndef OPENMANUS_FLOW_BASE_FLOW_H #define OPENMANUS_FLOW_BASE_FLOW_H #include #include #include #include #include "../agent_base.h" namespace openmanus { /** * @enum FlowType * @brief 流程类型枚举 */ enum class FlowType { PLANNING }; /** * @class BaseFlow * @brief 执行流程的基类,支持多个代理 */ class BaseFlow { public: /** * @brief 构造函数 * @param agent 主要代理 */ BaseFlow(std::shared_ptr agent); /** * @brief 构造函数 * @param agents 多个代理 */ BaseFlow(const std::vector>& agents); /** * @brief 析构函数 */ virtual ~BaseFlow() = default; /** * @brief 执行流程 * @param input_text 输入文本 * @return 执行结果 */ virtual std::string execute(const std::string& input_text) = 0; /** * @brief 获取主要代理 * @return 主要代理 */ std::shared_ptr getPrimaryAgent() const; /** * @brief 获取指定代理 * @param key 代理键 * @return 代理 */ std::shared_ptr getAgent(const std::string& key) const; /** * @brief 添加代理 * @param key 代理键 * @param agent 代理 */ void addAgent(const std::string& key, std::shared_ptr agent); protected: std::unordered_map> agents_; std::string primary_agent_key_; }; } // namespace openmanus #endif // OPENMANUS_FLOW_BASE_FLOW_H