Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Supplier Invoice Image Upload Moderation: Multimodal Chat Classifies NSFW and Violence

Описание и применение

Модерация изображений счетов поставщика осуществляется через мульти‑модальный чат‑модель Infrai, возвращающую строгое JSON‑ответ. Решения сохраняются как сырые ответы модели и нормализованные статусы, позволяя быстро принимать решения о продолжении или остановке извлечения данных.

Задача

Support agents need quick, trustworthy safety decisions on supplier invoice images before extraction, but no dedicated image‑moderation endpoint exists in Infrai.

Результат

The service now reliably classifies invoice images for NSFW and violence, with clear failure handling and policy versioning. Moderation latency is bounded, and raw responses are preserved for audit and future policy changes.

Рабочий процесс

  • 1. Receive image URL and policy version from intake service.
  • 2. Build a chat request with text prompt and image URL, specifying response_format as a strict JSON schema.
  • 3. Send request to /v1/chat/completions with retry logic (max 4 attempts, 12‑second outer deadline).
  • 4. Parse the JSON response; if malformed or missing, record failure class and route to review.
  • 5. Store raw model response and normalized status (allow/hold/block).
  • 6. If status is allow, proceed to extraction; if hold or block, halt extraction and notify reviewer.

Доказательства

send the image and a brief application policy to a multimodal chat model, require a strict JSON result, then store both the raw model decision and a small internal status.

Источник

The following program is intentionally direct. It performs one complete REST call, sets an explicit method, reads credentials from the environment, caps the response at 1 MiB, surfaces non-success bodies, honors an integer Retry-After on HTTP 429, and stops after four attempts or a 12-second outer deadline.

Источник

  • Дата записи: 2026-10-13T04:41:08.537Z