VisionReceiptResult vision.receipt-result@1
Generated at from
openvibe-contracts v0.419.0 and
openvibe-sdk v0.161.0.
- Version
- 1.0.0
- Owner
- vision
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/vision/receipt-result.v1.json
vision.receipt-result@1: POST /api/v1/receipt answers the store, the line items and the total the local OCR reader read (or the routed fallback read), with `raw_text` when the local pass produced it. OpenVibe.Food decides what enters a pantry; Vision returns the reading.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
answer | object | yes |
| |
answer.store | string | null | yes |
| |
answer.items | array of object | yes |
| |
answer.items[].name | string | yes |
| |
answer.items[].qty | number | yes |
| |
answer.items[].price | number | yes |
| |
answer.total | number | null | yes |
| |
answer.raw_text | string |
| ||
answer.receipt | object | yes |
| |
answer.receipt.engine | enum | yes |
| |
answer.receipt.model | string | null | yes | ||
answer.receipt.cost_usd | number | yes |
| |
answer.receipt.ms | integer | yes |
| |
answer.receipt.confidence | number | null | yes | ||
answer.receipt.retention | string | yes |
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: one
{
"answer": {
"store": "Corner Market",
"items": [
{
"name": "Milk",
"qty": 2,
"price": 3.5
}
],
"total": 7,
"receipt": {
"engine": "local",
"model": "Tesseract 5",
"cost_usd": 0,
"ms": 120,
"confidence": 0.9,
"retention": "not stored"
}
}
}Rejected: one
{
"answer": {
"store": "Corner Market",
"items": [
{
"name": "Milk",
"qty": "two",
"price": 3.5
}
],
"total": 7,
"receipt": {
"engine": "local",
"model": "Tesseract 5",
"cost_usd": 0,
"ms": 120,
"confidence": 0.9,
"retention": "not stored"
}
}
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('vision.receipt-result@1', value); // { valid, errors: [{ path, message }] }