DreamStream-1 commited on
Commit
c76350c
·
verified ·
1 Parent(s): 09328d2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -2,6 +2,7 @@ import os
2
  import requests
3
  import gradio as gr
4
  import pandas as pd
 
5
 
6
  # Google Maps API Key (replace with your actual key)
7
  api_key = "GOOGLE_API_KEY"
@@ -28,7 +29,7 @@ def get_places_data(query, location, radius, next_page_token=None):
28
  print("Places data response:", response.json()) # Logging the response
29
  return response.json()
30
  else:
31
- print("Error fetching places data:", response.text) # Logging any errors
32
  return None
33
 
34
  # Function to fetch detailed information for a specific place using its place_id
@@ -49,7 +50,7 @@ def get_place_details(place_id):
49
  "website": details_data.get("website", "")
50
  }
51
  else:
52
- print("Error fetching place details:", response.text) # Logging any errors
53
  return {}
54
 
55
  # Function to fetch all places data including pagination
 
2
  import requests
3
  import gradio as gr
4
  import pandas as pd
5
+ import time #Import missing time library
6
 
7
  # Google Maps API Key (replace with your actual key)
8
  api_key = "GOOGLE_API_KEY"
 
29
  print("Places data response:", response.json()) # Logging the response
30
  return response.json()
31
  else:
32
+ print(f"Error fetching places data: Status code {response.status_code}, {response.text}") #Improved error message
33
  return None
34
 
35
  # Function to fetch detailed information for a specific place using its place_id
 
50
  "website": details_data.get("website", "")
51
  }
52
  else:
53
+ print(f"Error fetching place details: Status code {response.status_code}, {response.text}") #Improved error message
54
  return {}
55
 
56
  # Function to fetch all places data including pagination