Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,48 +1,26 @@
|
|
1 |
-
from smolagents import CodeAgent,DuckDuckGoSearchTool, HfApiModel,load_tool,tool
|
2 |
import datetime
|
3 |
import requests
|
4 |
import pytz
|
5 |
import yaml
|
6 |
-
from tools.final_answer import FinalAnswerTool
|
7 |
|
8 |
from Gradio_UI import GradioUI
|
9 |
|
10 |
|
11 |
# Below is an example of a tool that does nothing. Amaze us with your creativity!
|
12 |
|
13 |
-
@tool
|
14 |
-
def get_domain_ip(domain:str)-> str: #it's important to specify the return type
|
15 |
-
#Keep this format for the description / args / args description but feel free to modify the tool
|
16 |
-
"""
|
17 |
-
A tool that retrieves WHOIS information for a given domain, including registrant and technical contact details.
|
18 |
-
|
19 |
-
Args:
|
20 |
-
domain: A string representing a valid domain name (e.g., 'google.com or www.google.co') to look up.
|
21 |
-
|
22 |
-
Returns:
|
23 |
-
A formatted string containing the domain's WHOIS information.
|
24 |
-
"""
|
25 |
-
try:
|
26 |
-
# Create a domain object
|
27 |
-
domain = domain
|
28 |
-
domain_info = (domain)
|
29 |
-
return f"A summary of the '{domain}' domain and contact details: {domain_info}"
|
30 |
-
except Exception as e:
|
31 |
-
return f"Error fetching domain for {domain} whois lookup: {e}"
|
32 |
-
|
33 |
@tool
|
34 |
def calculator(a: int, b: int) -> int:
|
35 |
-
"""This tool multiplies two integers ('a' and 'b').
|
36 |
Args:
|
37 |
-
a: an integer
|
38 |
-
b: an integer
|
39 |
"""
|
40 |
return a * b
|
41 |
|
42 |
print(calculator.to_string())
|
43 |
|
44 |
-
|
45 |
-
|
46 |
@tool
|
47 |
def get_current_time_in_timezone(timezone: str) -> str:
|
48 |
"""A tool that fetches the current local time in a specified timezone.
|
|
|
1 |
+
from smolagents import CodeAgent,DuckDuckGoSearchTool, FinalAnswerTool, HfApiModel,load_tool,tool
|
2 |
import datetime
|
3 |
import requests
|
4 |
import pytz
|
5 |
import yaml
|
|
|
6 |
|
7 |
from Gradio_UI import GradioUI
|
8 |
|
9 |
|
10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity!
|
11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
@tool
|
13 |
def calculator(a: int, b: int) -> int:
|
14 |
+
"""This tool multiplies two integers ('a' and 'b') and outputs the product as integer.
|
15 |
Args:
|
16 |
+
a: the first argument (an integer)
|
17 |
+
b: the second argument (an integer)
|
18 |
"""
|
19 |
return a * b
|
20 |
|
21 |
print(calculator.to_string())
|
22 |
|
23 |
+
|
|
|
24 |
@tool
|
25 |
def get_current_time_in_timezone(timezone: str) -> str:
|
26 |
"""A tool that fetches the current local time in a specified timezone.
|