Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -226,6 +226,11 @@ def get_cached_prompt(key: str) -> str:
|
|
| 226 |
return json.dumps({
|
| 227 |
"success": False,
|
| 228 |
"error": str(e),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 229 |
def cache_response(prompt_hash: str, response: str) -> str:
|
| 230 |
"""Cache a complete response with extremely detailed logging"""
|
| 231 |
logger.info(f"[CACHE-RESPONSE] ===== CACHE RESPONSE REQUEST START =====")
|
|
|
|
| 226 |
return json.dumps({
|
| 227 |
"success": False,
|
| 228 |
"error": str(e),
|
| 229 |
+
"error_type": type(e).__name__,
|
| 230 |
+
"processing_time_ms": round(processing_time * 1000, 2),
|
| 231 |
+
"timestamp": datetime.datetime.now(pytz.UTC).isoformat()
|
| 232 |
+
}, indent=2)
|
| 233 |
+
|
| 234 |
def cache_response(prompt_hash: str, response: str) -> str:
|
| 235 |
"""Cache a complete response with extremely detailed logging"""
|
| 236 |
logger.info(f"[CACHE-RESPONSE] ===== CACHE RESPONSE REQUEST START =====")
|