ChatVibeAskRequest chat.vibe-ask-request@1

Generated at from openvibe-contracts v0.221.0 and openvibe-sdk v0.65.0.

Version
1.0.0
Owner
chat
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/chat/vibe-ask-request.v1.json

chat.vibe-ask-request@1: a first-party service asks Vibe, OpenVibe's assistant, on a person's behalf (Vibe by voice: OpenVibe.Bot passes what the person said after their machine's call word). Chat keeps it in the person's own Vibe chats, one chat per source ("Voice on <machine>"), and answers with Vibe's reply, which counts against the person's daily allowance like any of their Vibe answers. POST /internal/chat/vibe/ask, capability chat.vibe.ask, loopback only.

Fields

FieldTypeRequiredDescriptionConstraints
subjectstringyesThe person Vibe answers, as the calling service vouches (Bot: the machine's owner, with voice on for that machine).
  • pattern ^usr_[0-9A-HJKMNP-TV-Z]{26}$
textstringyesWhat they asked.
  • minLength 1
  • maxLength 2000
sourceobjectyes
  • no other fields
source.kindenumyes
  • one of "voice"
source.idstringyesThe source's stable id (the machine's device id): one chat per source.
  • pattern ^[A-Za-z0-9_.:-]{1,64}$
source.namestringWhat to call it in the chat's name (the machine's name).
  • maxLength 80
langstring
  • pattern ^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8}){0,2}$
idempotency_keystringThe caller's id for this ask (Bot: device id and the voice_ask id): asked again, the same answer, once.
  • pattern ^[A-Za-z0-9_.:-]{1,128}$

Examples

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

Valid: voice
{
  "subject": "usr_01JABCDEFGHJKMNPQRSTVWXYZ0",
  "text": "what is the weather like this evening",
  "source": {
    "kind": "voice",
    "id": "dev_01JABCDEFGHJKMNPQRSTVWXYZ0",
    "name": "desk-pc"
  },
  "lang": "en-US",
  "idempotency_key": "dev_01JABCDEFGHJKMNPQRSTVWXYZ0:va-001"
}
Rejected: no-source
{
  "subject": "usr_01JABCDEFGHJKMNPQRSTVWXYZ0",
  "text": "hello"
}

Validate

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