Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -19,19 +19,34 @@ def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
|
|
19 |
return "What magic will you build ?"
|
20 |
|
21 |
@tool
|
22 |
-
def
|
23 |
-
"""
|
24 |
-
|
25 |
-
|
26 |
"""
|
27 |
-
|
28 |
-
#
|
29 |
-
|
30 |
-
#
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
|
37 |
final_answer = FinalAnswerTool()
|
|
|
19 |
return "What magic will you build ?"
|
20 |
|
21 |
@tool
|
22 |
+
def calculate_bandwidth():
|
23 |
+
"""
|
24 |
+
Calculate the recommended internet speed based on user inputs.
|
25 |
+
:return: Recommended bandwidth in Mbps
|
26 |
"""
|
27 |
+
usage_requirements = {
|
28 |
+
"browsing": 1, # Mbps per user
|
29 |
+
"video_call": 2, # Mbps per user
|
30 |
+
"hd_streaming": 5, # Mbps per user
|
31 |
+
"4k_streaming": 25, # Mbps per user
|
32 |
+
"gaming": 10, # Mbps per user
|
33 |
+
"remote_work": 3 # Mbps per user
|
34 |
+
}
|
35 |
+
|
36 |
+
users = int(input("Enter the number of users: "))
|
37 |
+
usage = {
|
38 |
+
"browsing": int(input("Users browsing the web: ")),
|
39 |
+
"video_call": int(input("Users on video calls: ")),
|
40 |
+
"hd_streaming": int(input("Users streaming in HD: ")),
|
41 |
+
"4k_streaming": int(input("Users streaming in 4K: ")),
|
42 |
+
"gaming": int(input("Users gaming online: ")),
|
43 |
+
"remote_work": int(input("Users working remotely: "))
|
44 |
+
}
|
45 |
+
|
46 |
+
total_bandwidth = sum(usage_requirements[activity] * count for activity, count in usage.items())
|
47 |
+
|
48 |
+
overhead = 1.2 # 20% overhead for seamless experience
|
49 |
+
return round(total_bandwidth * overhead, 2)
|
50 |
|
51 |
|
52 |
final_answer = FinalAnswerTool()
|