Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,8 +11,10 @@ from Gradio_UI import GradioUI
|
|
| 11 |
@tool
|
| 12 |
def get_location(arg1:str, arg2:int)-> str:
|
| 13 |
"""Retrieves the users approximate location using there ip address."""
|
| 14 |
-
|
|
|
|
| 15 |
data = response.json()
|
|
|
|
| 16 |
location_info = {
|
| 17 |
"city": data.get("city", "unknown"),
|
| 18 |
"region": data.get("region", "unkown"),
|
|
|
|
| 11 |
@tool
|
| 12 |
def get_location(arg1:str, arg2:int)-> str:
|
| 13 |
"""Retrieves the users approximate location using there ip address."""
|
| 14 |
+
try:
|
| 15 |
+
response = requests.get("https://ipinfo.io.json")
|
| 16 |
data = response.json()
|
| 17 |
+
|
| 18 |
location_info = {
|
| 19 |
"city": data.get("city", "unknown"),
|
| 20 |
"region": data.get("region", "unkown"),
|