# Image / OCR Testing Playbook

## TEST AGENT PROMPT – IMAGE INTEGRATION RULES

### Image Handling Rules
- Always use **base64-encoded images** for tests (JPEG/PNG/WEBP only)
- No SVG, BMP, HEIC; resize large images; never use solid-color images
- For OCR tests, use a real invoice image (vendor name, GSTIN, line items)

### Endpoint
- POST `/api/ocr/scan-bill` (multipart `file=<jpeg/png/webp>`, optional `mode=expense|purchase`)
- Returns JSON: `{vendor, gstin, date, total, tax, lines:[{name, qty, rate}], raw}`

### Auth
- Requires authenticated session (cookie). Use admin or staff session.

### Notes
- Model: `openai/gpt-4o` via `EMERGENT_LLM_KEY`.
- Library: `emergentintegrations.llm.chat.LlmChat` + `ImageContent(image_base64=...)`.
