Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,6 @@ import requests
|
|
| 4 |
import pytz
|
| 5 |
import yaml
|
| 6 |
from tools.final_answer import FinalAnswerTool
|
| 7 |
-
from ip2geotools.databases.noncommercial import DbIpCity
|
| 8 |
from bs4 import BeautifulSoup
|
| 9 |
import urllib as ur
|
| 10 |
import tkinter as tk
|
|
@@ -25,31 +24,6 @@ from Gradio_UI import GradioUI
|
|
| 25 |
# """
|
| 26 |
# # return
|
| 27 |
|
| 28 |
-
@tool
|
| 29 |
-
def get_location_tool(ip: str):
|
| 30 |
-
response = DbIpCity.get(ip, api_key='free')
|
| 31 |
-
|
| 32 |
-
return {
|
| 33 |
-
'city': response.city,
|
| 34 |
-
'region': response.region,
|
| 35 |
-
'country': response.country,
|
| 36 |
-
'latitude': response.latitude,
|
| 37 |
-
'longitude': response.longitude
|
| 38 |
-
}
|
| 39 |
-
|
| 40 |
-
"""
|
| 41 |
-
This is a tool that gets the exact location of a user including city, region, country, latitude, and longitude.
|
| 42 |
-
Args:
|
| 43 |
-
ip: A string representing a valid ip address (e.g., '192.168.10.1')
|
| 44 |
-
|
| 45 |
-
Returns: ip address, city, region, country, and geo coordinates
|
| 46 |
-
"""
|
| 47 |
-
|
| 48 |
-
response = DbIpCity.get('YOUR_IP_ADDRESS') # Replace with the actual IP address
|
| 49 |
-
location = get_location('ip_address')
|
| 50 |
-
print(location)
|
| 51 |
-
|
| 52 |
-
|
| 53 |
@tool
|
| 54 |
def get_current_time_in_timezone(timezone: str):
|
| 55 |
|
|
|
|
| 4 |
import pytz
|
| 5 |
import yaml
|
| 6 |
from tools.final_answer import FinalAnswerTool
|
|
|
|
| 7 |
from bs4 import BeautifulSoup
|
| 8 |
import urllib as ur
|
| 9 |
import tkinter as tk
|
|
|
|
| 24 |
# """
|
| 25 |
# # return
|
| 26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
@tool
|
| 28 |
def get_current_time_in_timezone(timezone: str):
|
| 29 |
|