sicknick32 commited on
Commit
b3ce0be
·
verified ·
1 Parent(s): 63c6c74

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
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
- response = requests.get("https://ipinfo.io.json")
 
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"),