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