mirror of
https://github.com/arc53/DocsGPT.git
synced 2026-05-07 06:30:03 +00:00
26 lines
810 B
Python
26 lines
810 B
Python
import logging
|
|
|
|
from application.agents.agentic_agent import AgenticAgent
|
|
from application.agents.classic_agent import ClassicAgent
|
|
from application.agents.research_agent import ResearchAgent
|
|
from application.agents.workflow_agent import WorkflowAgent
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
class AgentCreator:
|
|
agents = {
|
|
"classic": ClassicAgent,
|
|
"react": ClassicAgent, # backwards compat: react falls back to classic
|
|
"agentic": AgenticAgent,
|
|
"research": ResearchAgent,
|
|
"workflow": WorkflowAgent,
|
|
}
|
|
|
|
@classmethod
|
|
def create_agent(cls, type, *args, **kwargs):
|
|
agent_class = cls.agents.get(type.lower())
|
|
if not agent_class:
|
|
raise ValueError(f"No agent class found for type {type}")
|
|
return agent_class(*args, **kwargs)
|