VisionMomentsResult vision.moments-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/moments-result.v1.json

vision.moments-result@1: POST /api/v1/moments answers scene changes and candidate moments (timestamp, matching prompt, score) for up to 30 frames. A moment is a suggestion: the room decides whether it becomes a clip or a chapter.

Fields

FieldTypeRequiredDescriptionConstraints
answerobjectyes
  • no other fields
answer.scene_changesarray of objectyes
  • items: no other fields
answer.scene_changes[].timestamp_msintegeryes
  • minimum 0
answer.scene_changes[].kindconstyes
  • = "scene_change"
answer.candidate_momentsarray of objectyes
  • maxItems 30
  • items: no other fields
answer.candidate_moments[].timestamp_msintegeryes
  • minimum 0
answer.candidate_moments[].promptstringyes
answer.candidate_moments[].scorenumberyes
answer.receiptobjectyes
  • no other fields
answer.receipt.engineenumyes
  • one of "local", "routed", "local+routed", "local+routed description"
answer.receipt.modelstring | nullyes
answer.receipt.cost_usdnumberyes
  • minimum 0
answer.receipt.msintegeryes
  • minimum 0
answer.receipt.confidencenumber | nullyes
answer.receipt.retentionstringyes

Examples

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

Valid: one
{
  "answer": {
    "scene_changes": [
      {
        "timestamp_ms": 5000,
        "kind": "scene_change"
      }
    ],
    "candidate_moments": [
      {
        "timestamp_ms": 5000,
        "prompt": "a goal",
        "score": 0.31
      }
    ],
    "receipt": {
      "engine": "local",
      "model": "CLIP ViT-B/32 q8 + histogram",
      "cost_usd": 0,
      "ms": 90,
      "confidence": 0.31,
      "retention": "not stored"
    }
  }
}
Rejected: one
{
  "answer": {
    "scene_changes": [
      {
        "timestamp_ms": 1,
        "kind": "cut"
      }
    ],
    "candidate_moments": [],
    "receipt": {
      "engine": "local",
      "model": null,
      "cost_usd": 0,
      "ms": 1,
      "confidence": null,
      "retention": "x"
    }
  }
}

Validate

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