Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,6 +4,7 @@ import datetime
|
|
| 4 |
import requests
|
| 5 |
import pytz
|
| 6 |
import yaml
|
|
|
|
| 7 |
|
| 8 |
from tools.final_answer import FinalAnswerTool
|
| 9 |
from Gradio_UI import GradioUI
|
|
@@ -31,7 +32,8 @@ def get_weather(location: str, celsius: Optional[bool] = False) -> str:
|
|
| 31 |
Returns:
|
| 32 |
A string describing the current weather at the location.
|
| 33 |
"""
|
| 34 |
-
api_key = "weather_api_key" # Replace with your API key from https://weatherstack.com/
|
|
|
|
| 35 |
units = "m" if celsius else "f" # 'm' for Celsius, 'f' for Fahrenheit
|
| 36 |
|
| 37 |
url = f"http://api.weatherstack.com/current?access_key={api_key}&query={location}&units={units}"
|
|
|
|
| 4 |
import requests
|
| 5 |
import pytz
|
| 6 |
import yaml
|
| 7 |
+
import os
|
| 8 |
|
| 9 |
from tools.final_answer import FinalAnswerTool
|
| 10 |
from Gradio_UI import GradioUI
|
|
|
|
| 32 |
Returns:
|
| 33 |
A string describing the current weather at the location.
|
| 34 |
"""
|
| 35 |
+
# api_key = "weather_api_key" # Replace with your API key from https://weatherstack.com/
|
| 36 |
+
os.environ['WEATHERSTACK_API_KEY'] = 'weather_api_key'
|
| 37 |
units = "m" if celsius else "f" # 'm' for Celsius, 'f' for Fahrenheit
|
| 38 |
|
| 39 |
url = f"http://api.weatherstack.com/current?access_key={api_key}&query={location}&units={units}"
|