Update app.py
Browse files
app.py
CHANGED
|
@@ -192,16 +192,16 @@ async def generate(
|
|
| 192 |
# FINAL RESPONSE TIME
|
| 193 |
response_time_ms = round((time.time() - start_time) * 1000)
|
| 194 |
|
| 195 |
-
# LOG SUCCESS
|
| 196 |
logs_collection.insert_one({
|
| 197 |
"timestamp": datetime.utcnow(),
|
| 198 |
-
"status": "success",
|
| 199 |
"input1_id": str(input1_id),
|
| 200 |
"input2_id": str(input2_id) if input2_id else None,
|
| 201 |
"output_id": str(out_id),
|
| 202 |
"prompt": prompt,
|
| 203 |
-
"user_email": user.get("email"),
|
| 204 |
-
"response_time_ms": response_time_ms
|
| 205 |
})
|
| 206 |
|
| 207 |
return JSONResponse({
|
|
|
|
| 192 |
# FINAL RESPONSE TIME
|
| 193 |
response_time_ms = round((time.time() - start_time) * 1000)
|
| 194 |
|
| 195 |
+
# LOG SUCCESS - THIS WAS MISSING THE STATUS AND RESPONSE_TIME_MS FIELDS!
|
| 196 |
logs_collection.insert_one({
|
| 197 |
"timestamp": datetime.utcnow(),
|
| 198 |
+
"status": "success", # ✅ FIXED: Added status field
|
| 199 |
"input1_id": str(input1_id),
|
| 200 |
"input2_id": str(input2_id) if input2_id else None,
|
| 201 |
"output_id": str(out_id),
|
| 202 |
"prompt": prompt,
|
| 203 |
+
"user_email": user.get("email"), # ✅ FIXED: Changed from "user" to "user_email"
|
| 204 |
+
"response_time_ms": response_time_ms # ✅ FIXED: Added response_time_ms field
|
| 205 |
})
|
| 206 |
|
| 207 |
return JSONResponse({
|