openmanus.cpp/include/flow/base_flow.h

77 lines
1.6 KiB
C
Raw Permalink Normal View History

2025-03-10 02:38:39 +08:00
#ifndef OPENMANUS_FLOW_BASE_FLOW_H
#define OPENMANUS_FLOW_BASE_FLOW_H
#include <string>
#include <memory>
#include <unordered_map>
#include <vector>
#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<AgentBase> agent);
/**
* @brief
* @param agents
*/
BaseFlow(const std::vector<std::shared_ptr<AgentBase>>& 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<AgentBase> getPrimaryAgent() const;
/**
* @brief
* @param key
* @return
*/
std::shared_ptr<AgentBase> getAgent(const std::string& key) const;
/**
* @brief
* @param key
* @param agent
*/
void addAgent(const std::string& key, std::shared_ptr<AgentBase> agent);
protected:
std::unordered_map<std::string, std::shared_ptr<AgentBase>> agents_;
std::string primary_agent_key_;
};
} // namespace openmanus
#endif // OPENMANUS_FLOW_BASE_FLOW_H