Davit6174 commited on
Commit
dddc250
·
verified ·
1 Parent(s): 98954d2

Update tools.py

Browse files
Files changed (1) hide show
  1. tools.py +8 -4
tools.py CHANGED
@@ -1,7 +1,11 @@
 
1
  from langchain_community.tools.ddg_search import DuckDuckGoSearchRun
2
 
3
- # Add more tools here later (e.g., calculator, file loader, etc.)
4
 
5
- def get_tools():
6
- search = DuckDuckGoSearchRun()
7
- return [search]
 
 
 
 
1
+ from langchain.tools import tool
2
  from langchain_community.tools.ddg_search import DuckDuckGoSearchRun
3
 
4
+ search = DuckDuckGoSearchRun()
5
 
6
+ @tool
7
+ def web_search(query: str) -> str:
8
+ """Perform a web search using DuckDuckGo."""
9
+ return search.run(query)
10
+
11
+ tools = [web_search]