Image capturing Flow updates

This commit is contained in:
sriram
2026-09-24 17:18:38 +05:30
parent f933ea10a1
commit fe208f4715
14 changed files with 1877 additions and 6 deletions

View File

@@ -469,6 +469,34 @@ OCR_NUM_THREADS = int(os.getenv("OCR_NUM_THREADS", "2"))
# bounded alike.
OCR_MAX_CHARS = int(os.getenv("OCR_MAX_CHARS", "500"))
# ---------------------------------------------------------------------------
# Capture-to-catalog - what /search/identify does when the photo is a product
# the catalog does not have (app/services/capture_discovery.py)
# ---------------------------------------------------------------------------
# OFF by default. When on, an unconfirmed identify reads the label, and - for a
# brand we already know - queues the product through the 11-stage pipeline and
# answers at once with a provisional card and a job id to poll. The row lands
# with validation_status=needs_review. This is the only path by which a public
# route WRITES to a brand table, which is why it is a switch.
ENABLE_CAPTURE_DISCOVERY = _bool("ENABLE_CAPTURE_DISCOVERY", "false")
# Photos and job records. Under DATA_DIR so a container keeps them on the volume.
CAPTURE_DIR = _dir("CAPTURE_DIR", DATA_DIR / "captures")
# Jobs waiting behind the one capture worker. Each runs all 11 stages - web
# image search and a live retail lookup included - so a minute or more apiece.
CAPTURE_QUEUE_MAX = int(os.getenv("CAPTURE_QUEUE_MAX", "8"))
# New discovery jobs one client (by IP) may start per hour. The route is public.
CAPTURE_MAX_PER_CLIENT_PER_HOUR = int(os.getenv("CAPTURE_MAX_PER_CLIENT_PER_HOUR", "20"))
# Absolute base of THIS API as the outside world reaches it, e.g.
# https://api.example.com. Needed only to show the colleague's own photo as the
# product image when the web search found none: image URLs must be absolute
# (vector_store._usable_image_url drops a bare path). Blank = never use it.
CAPTURE_PUBLIC_BASE_URL = os.getenv("CAPTURE_PUBLIC_BASE_URL", "").strip()
# A live retail-presence lookup (retail_presence.check_listing, live=True) for
# each discovered product: the pack-size check that catches a misread label.
CAPTURE_RETAIL_CHECK = _bool("CAPTURE_RETAIL_CHECK", "true")
# Stage 2's LLM description. Off falls back to the factual template.
CAPTURE_USE_LLM = _bool("CAPTURE_USE_LLM", "true")
# ---------------------------------------------------------------------------
# USDA FoodData Central - nutrition for loose, unbranded commodities
# ---------------------------------------------------------------------------