xd11yggy commited on
Commit
32ffa10
Β·
verified Β·
1 Parent(s): a084f5a

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -0
app.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from smolagents import DuckDuckGoSearchTool
2
+
3
+ # Initialize the tool
4
+ web_search = DuckDuckGoSearchTool()
5
+
6
+ # Perform search
7
+ results = web_search("Pont des Arts length in meters")
8
+
9
+ # Print results
10
+ for i, result in enumerate(results[:3]): # Show top 3 results
11
+ print(f"Result {i+1}:")
12
+ print(f"Title: {result['title']}")
13
+ print(f"URL: {result['href']}")
14
+ print(f"Snippet: {result['body']}\n")