24 lines
794 B
C++
24 lines
794 B
C++
#ifndef HUMANUS_FLOW_FACTORY_H
|
|
#define HUMANUS_FLOW_FACTORY_H
|
|
|
|
#include "base.h"
|
|
#include "../agent/base.h"
|
|
#include "flow_planning.h"
|
|
|
|
namespace humanus {
|
|
|
|
// Factory for creating different types of flows with support for multiple agents
|
|
struct FlowFactory {
|
|
static BaseFlow create_flow(FlowType flow_type, std::map<std::string, std::shared_ptr<BaseAgent>> agents, std::vector<std::shared_ptr<BaseTool>> tools, std::string primary_agent_key) {
|
|
switch (flow_type) {
|
|
case FlowType::PLANNING:
|
|
return std::make_shared<PlanningFlow>(agents, tools, primary_agent_key);
|
|
default:
|
|
throw std::invalid_argument("Unknown flow type: " + std::to_string(static_cast<int>(flow_type)));
|
|
}
|
|
}
|
|
};
|
|
|
|
}
|
|
#endif // HUMANUS_FLOW_FACTORY_H
|