turtle170 commited on
Commit
c3aee78
·
verified ·
1 Parent(s): 5c7aeaa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
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 =====")