Recipe: QR code decoder + handler
Vision model decodes QR payloads and routes them through a configurable handler chain — no native scanner SDK required.
Architecture
- Image upload → base64 encode → vision model prompt
- Model returns raw payload string + inferred content type
- Handler router dispatches: URL → open, vCard → save, WiFi → connect
- Fallback: display raw text with copy-to-clipboard
Prompt template
You are a QR code decoder. Analyze the image.
Return JSON:
{
"payload": "<decoded string>",
"type": "url" | "vcard" | "wifi" | "text"
}
If no QR code found, return { "error": true }.Handler routing table
| Type | Action |
|---|---|
| url | Open in default browser |
| vcard | Parse fields → save to contacts |
| wifi | Extract SSID/pass → trigger connection |
| text | Display with copy button |
← All recipesRequires vision-capable model endpoint