forked from opea-project/GenAIComps
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathagent.py
More file actions
27 lines (20 loc) · 945 Bytes
/
agent.py
File metadata and controls
27 lines (20 loc) · 945 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
def instantiate_agent(args, strategy="react_langchain"):
if strategy == "react_langchain":
from .strategy.react import ReActAgentwithLangchain
return ReActAgentwithLangchain(args)
elif strategy == "react_langgraph":
from .strategy.react import ReActAgentwithLanggraph
return ReActAgentwithLanggraph(args)
elif strategy == "plan_execute":
from .strategy.planexec import PlanExecuteAgentWithLangGraph
return PlanExecuteAgentWithLangGraph(args)
elif strategy == "agentic_rag":
from .strategy.agentic_rag import RAGAgentwithLanggraph
return RAGAgentwithLanggraph(args)
elif strategy == "docgrader":
from .strategy.docgrader import RAGAgentDocGraderV1
return RAGAgentDocGraderV1(args)
else:
raise ValueError(f"Agent strategy: {strategy} not supported!")