Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,6 +5,7 @@ import datetime
|
|
| 5 |
import requests
|
| 6 |
import pytz
|
| 7 |
import yaml
|
|
|
|
| 8 |
from tools.final_answer import FinalAnswerTool
|
| 9 |
|
| 10 |
from Gradio_UI import GradioUI
|
|
@@ -118,10 +119,9 @@ def get_date_panchang(date: str = None, data_language: str = "EN") -> str:
|
|
| 118 |
data = response.json()
|
| 119 |
|
| 120 |
if not data or not isinstance(data, dict):
|
| 121 |
-
return "
|
| 122 |
|
| 123 |
-
|
| 124 |
-
return data
|
| 125 |
|
| 126 |
except Exception as e:
|
| 127 |
return f" Failed to fetch Panchang for {api_date}: {str(e)}"
|
|
|
|
| 5 |
import requests
|
| 6 |
import pytz
|
| 7 |
import yaml
|
| 8 |
+
import json
|
| 9 |
from tools.final_answer import FinalAnswerTool
|
| 10 |
|
| 11 |
from Gradio_UI import GradioUI
|
|
|
|
| 119 |
data = response.json()
|
| 120 |
|
| 121 |
if not data or not isinstance(data, dict):
|
| 122 |
+
return "Empty or unexpected response."
|
| 123 |
|
| 124 |
+
return json.dumps(data, ensure_ascii=False)
|
|
|
|
| 125 |
|
| 126 |
except Exception as e:
|
| 127 |
return f" Failed to fetch Panchang for {api_date}: {str(e)}"
|