WikiImagesSuggestRequest wiki.images-suggest-request@1

Generated at from openvibe-contracts v0.419.0 and openvibe-sdk v0.161.0.

Version
1.0.0
Owner
wiki
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/wiki/images-suggest-request.v1.json

wiki.images-suggest-request@1: the body of wiki.images.suggest on OpenVibe.Wiki (an editor of the space). POST /api/v1/pages/:id/images/suggest asks the wiki.article.images task for the article's lead picture and figures: Wikimedia Commons and Openverse first, keeping the licence and the author; then OpenVibe.Pics and the page's own Media; an AI illustration only when nothing real exists, never of a real person. Every field is optional; the path names the article.

Fields

FieldTypeRequiredDescriptionConstraints
querystring | nullWhat to look for; defaults to the article's title and summary.
  • maxLength 300
sectionstring | nullA section heading the pictures should illustrate; omitted, the lead picture is suggested first.
  • maxLength 200
countintegerAt most this many suggestions (default 8).
  • minimum 1
  • maximum 12
allow_aibooleanWhether an illustration may be drawn when no real picture exists (default true; never for an article about a real person).
choiceai.choiceThe search engine (search/commons, search/openverse, …) for the wiki.article.images task; the owner's or person's choice answers when omitted.

Examples

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

Valid: commons
{
  "query": "OpenVibe Link machine",
  "section": "Setup",
  "count": 6,
  "allow_ai": false,
  "choice": {
    "model": "search/commons",
    "source": "openvibe"
  }
}
Rejected: too-many
{
  "count": 99
}

Validate

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