VisionFindRequest vision.find-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/find-request.v1.json

vision.find-request@1: the body of POST /api/v1/index and of GET or POST /api/v1/find. `index` stores a scoped CLIP embedding for one of the caller's own items (`item_id`, optional `result_url`); `find` searches only the caller's own private index, by words (`q`) or by an example image. No public image index is ever built.

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
qstring
  • minLength 1
  • maxLength 500
item_idstring
  • pattern ^[\w:.-]{1,200}$
result_urlstring
  • pattern ^https://
  • format uri

Examples

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

Valid: one
{
  "q": "red bike by the pier"
}
Rejected: one
{
  "q": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}

Validate

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