openmanus.cpp/src/flow/flow_factory.cpp

30 lines
773 B
C++

#include "include/flow/flow_factory.h"
#include <stdexcept>
namespace openmanus {
std::shared_ptr<BaseFlow> FlowFactory::createFlow(
FlowType flow_type,
std::shared_ptr<AgentBase> agent
) {
switch (flow_type) {
case FlowType::PLANNING:
return std::make_shared<PlanningFlow>(agent);
default:
throw std::runtime_error("未知的流程类型");
}
}
std::shared_ptr<BaseFlow> FlowFactory::createFlow(
FlowType flow_type,
const std::vector<std::shared_ptr<AgentBase>>& agents
) {
switch (flow_type) {
case FlowType::PLANNING:
return std::make_shared<PlanningFlow>(agents);
default:
throw std::runtime_error("未知的流程类型");
}
}
} // namespace openmanus