VisionMomentsRequest vision.moments-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/moments-request.v1.json

vision.moments-request@1: the body of POST /api/v1/moments. Up to 30 timestamped frames are compared with CLIP prompt embeddings; a histogram jump marks a scene change. VOD and stream chapters come from this.

Fields

FieldTypeRequiredDescriptionConstraints
framesarray of objectyes
  • minItems 1
  • maxItems 30
  • items: no other fields
frames[].timestamp_msintegeryes
  • minimum 0
frames[].imagestring
  • pattern ^data:image/
frames[].image_urlstring
  • pattern ^https?://
  • format uri
promptsarray of string
  • maxItems 10
  • items: maxLength 120

Examples

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

Valid: one
{
  "frames": [
    {
      "timestamp_ms": 0,
      "image": "data:image/png;base64,iVBORw0KGgo="
    },
    {
      "timestamp_ms": 5000,
      "image_url": "https://example.com/f.jpg"
    }
  ],
  "prompts": [
    "a goal"
  ]
}
Rejected: one
{
  "frames": [
    {
      "image": "data:image/png;base64,iVBORw0KGgo="
    }
  ]
}

Validate

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