VisionAskRequest vision.ask-request@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/ask-request.v1.json

vision.ask-request@1: the body of POST /api/v1/ask and /api/v1/describe on OpenVibe.Vision. `task` is what the caller wants (ask, describe, identify, count, translate, ocr); `mode` is auto (local OCR first, then OpenVibe.AI), local (never a model) or ai. A read question (text, sign, receipt, label) is answered by the local OCR reader first in auto mode. `lang` is the Tesseract language and `model` is a provider:model hint AI may ignore.

Fields

FieldTypeRequiredDescriptionConstraints
imagestringThe image as a data URL (base64).
  • pattern ^data:image/
image_urlstringA public image URL, fetched through Vision's private-address guard.
  • pattern ^https?://
  • format uri
questionstring
  • maxLength 2000
taskenum
  • one of "ask", "describe", "identify", "count", "translate", "ocr"
modeenum
  • one of "auto", "local", "ai"
langstring
  • maxLength 40
modelstring
  • maxLength 120

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: one
{
  "image": "data:image/png;base64,iVBORw0KGgo=",
  "question": "What is on the desk?",
  "task": "ask",
  "mode": "auto"
}
Rejected: one
{
  "image_url": "https://example.com/a.png",
  "task": "compare"
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('vision.ask-request@1', value);   // { valid, errors: [{ path, message }] }