64 lines
1.4 KiB
C++
64 lines
1.4 KiB
C++
#ifndef OPENMANUS_FLOW_PLANNING_FLOW_H
|
|
#define OPENMANUS_FLOW_PLANNING_FLOW_H
|
|
|
|
#include <string>
|
|
#include <memory>
|
|
#include <unordered_map>
|
|
#include "base_flow.h"
|
|
|
|
namespace openmanus {
|
|
|
|
/**
|
|
* @class PlanningFlow
|
|
* @brief 规划流程,使用规划代理执行任务
|
|
*/
|
|
class PlanningFlow : public BaseFlow {
|
|
public:
|
|
/**
|
|
* @brief 构造函数
|
|
* @param agent 主要代理
|
|
*/
|
|
PlanningFlow(std::shared_ptr<AgentBase> agent);
|
|
|
|
/**
|
|
* @brief 构造函数
|
|
* @param agents 多个代理
|
|
*/
|
|
PlanningFlow(const std::vector<std::shared_ptr<AgentBase>>& agents);
|
|
|
|
/**
|
|
* @brief 执行流程
|
|
* @param input_text 输入文本
|
|
* @return 执行结果
|
|
*/
|
|
virtual std::string execute(const std::string& input_text) override;
|
|
|
|
private:
|
|
/**
|
|
* @brief 获取当前计划状态
|
|
* @return 计划状态
|
|
*/
|
|
std::string getPlanStatus();
|
|
|
|
/**
|
|
* @brief 更新步骤执行状态
|
|
* @param step_id 步骤ID
|
|
* @param status 状态
|
|
* @return 是否成功
|
|
*/
|
|
bool updateStepStatus(const std::string& step_id, const std::string& status);
|
|
|
|
/**
|
|
* @brief 获取当前步骤索引
|
|
* @return 当前步骤索引
|
|
*/
|
|
int getCurrentStepIndex();
|
|
|
|
private:
|
|
std::string active_plan_id_;
|
|
std::unordered_map<std::string, std::unordered_map<std::string, std::string>> step_execution_tracker_;
|
|
};
|
|
|
|
} // namespace openmanus
|
|
|
|
#endif // OPENMANUS_FLOW_PLANNING_FLOW_H
|