Skip to content

Commit 8c55c5f

Browse files
committed
add default tool set
1 parent 33a59aa commit 8c55c5f

File tree

3 files changed

+15
-20
lines changed

3 files changed

+15
-20
lines changed

template_langgraph/agents/chat_with_tools_agent/agent.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@
66
from template_langgraph.agents.chat_with_tools_agent.models import AgentState
77
from template_langgraph.llms.azure_openais import AzureOpenAiWrapper
88
from template_langgraph.loggers import get_logger
9-
from template_langgraph.tools.cosmosdb_tool import search_cosmosdb
10-
from template_langgraph.tools.dify_tool import run_dify_workflow
11-
from template_langgraph.tools.elasticsearch_tool import search_elasticsearch
12-
from template_langgraph.tools.qdrant_tool import search_qdrant
9+
from template_langgraph.tools.common import DEFAULT_TOOLS
1310

1411
logger = get_logger(__name__)
1512

@@ -41,12 +38,7 @@ def __call__(self, inputs: dict):
4138
class ChatWithToolsAgent:
4239
def __init__(self):
4340
self.llm = AzureOpenAiWrapper().chat_model
44-
self.tools = [
45-
search_cosmosdb,
46-
run_dify_workflow,
47-
search_qdrant,
48-
search_elasticsearch,
49-
]
41+
self.tools = DEFAULT_TOOLS
5042

5143
def create_graph(self):
5244
"""Create the main graph for the agent."""

template_langgraph/agents/kabuto_helpdesk_agent/agent.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,15 @@
22

33
from template_langgraph.llms.azure_openais import AzureOpenAiWrapper
44
from template_langgraph.loggers import get_logger
5-
from template_langgraph.tools.dify_tool import run_dify_workflow
6-
from template_langgraph.tools.elasticsearch_tool import search_elasticsearch
7-
from template_langgraph.tools.qdrant_tool import search_qdrant
5+
from template_langgraph.tools.common import DEFAULT_TOOLS
86

97
logger = get_logger(__name__)
108

119

1210
class KabutoHelpdeskAgent:
1311
def __init__(self, tools=None):
1412
if tools is None:
15-
# Default tool for searching Qdrant
16-
tools = [
17-
run_dify_workflow,
18-
search_qdrant,
19-
search_elasticsearch,
20-
# Add other tools as needed
21-
]
13+
tools = DEFAULT_TOOLS
2214
self.agent = create_react_agent(
2315
model=AzureOpenAiWrapper().chat_model,
2416
tools=tools,

template_langgraph/tools/common.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from template_langgraph.tools.cosmosdb_tool import search_cosmosdb
2+
from template_langgraph.tools.dify_tool import run_dify_workflow
3+
from template_langgraph.tools.elasticsearch_tool import search_elasticsearch
4+
from template_langgraph.tools.qdrant_tool import search_qdrant
5+
6+
DEFAULT_TOOLS = [
7+
search_cosmosdb,
8+
run_dify_workflow,
9+
search_qdrant,
10+
search_elasticsearch,
11+
]

0 commit comments

Comments
 (0)