Spaces:
Sleeping
Sleeping
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 termcolor import colored
|
| 8 |
|
| 9 |
from Gradio_UI import GradioUI
|
| 10 |
|
|
@@ -21,13 +20,13 @@ def compare_degrees(current_weather:float, optimal_fermentation_degrees:float)->
|
|
| 21 |
dif_degrees = current_weather-optimal_fermentation_degrees
|
| 22 |
if abs(dif_degrees) >= 1.5:
|
| 23 |
if dif_degrees<0:
|
| 24 |
-
return
|
| 25 |
else:
|
| 26 |
-
return
|
| 27 |
else:
|
| 28 |
-
return
|
| 29 |
except Exception as e:
|
| 30 |
-
return
|
| 31 |
|
| 32 |
|
| 33 |
@tool
|
|
|
|
| 4 |
import pytz
|
| 5 |
import yaml
|
| 6 |
from tools.final_answer import FinalAnswerTool
|
|
|
|
| 7 |
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
|
|
|
| 20 |
dif_degrees = current_weather-optimal_fermentation_degrees
|
| 21 |
if abs(dif_degrees) >= 1.5:
|
| 22 |
if dif_degrees<0:
|
| 23 |
+
return f"RED LIGHT - the difference degrees between optimal and current weather are {dif_degrees}ºC - YOU SHOULD INCREASE THE HEATER BY {dif_degrees}ºC!"
|
| 24 |
else:
|
| 25 |
+
return f"RED LIGHT - the difference degrees between optimal and current weather are {dif_degrees}ºC - YOU SHOULD DECREASE THE HEATER BY {dif_degrees}ºC!"
|
| 26 |
else:
|
| 27 |
+
return f"GREEN LIGHT - the difference degrees between optimal and current weather are {dif_degrees} - which is in range!"
|
| 28 |
except Exception as e:
|
| 29 |
+
return f"Error fetching {str(current_weather)} and {str(optimal_fermentation_degrees)}."
|
| 30 |
|
| 31 |
|
| 32 |
@tool
|