debug: log file sizes at extraction and processing stages

Add logging to compare file sizes:
- [EXTRACT] sent to Gemini
- [CREATE_ITEM] received when creating item

This will reveal if image is being processed/changed between extraction and local processing.
This commit is contained in:
2026-04-22 10:14:03 +03:00
parent 4e23899f87
commit 9586aecfdc

View File

@@ -103,7 +103,9 @@ async def extract_label(
detail="File exceeds 10MB limit."
)
log.info(f"[EXTRACT] Sending {len(contents)} bytes to Gemini for analysis")
result = extract_label_info(contents, mode=mode)
log.info(f"[EXTRACT] Gemini returned: {type(result).__name__}")
return result
@router.post("/", response_model=schemas.Item, status_code=status.HTTP_201_CREATED)
@@ -152,6 +154,7 @@ def create_item(
try:
import base64
image_bytes = base64.b64decode(item.extracted_image_bytes)
log.info(f"[CREATE_ITEM] Received {len(image_bytes)} bytes for photo processing (base64 decoded)")
photo_result = _auto_save_photo_from_extraction(
item_id=db_item.id,