ChatVibeAskResult chat.vibe-ask-result@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-result.v1.json

chat.vibe-ask-result@1: Vibe's answer to a chat.vibe-ask-request@1. `answered` carries the reply (plain text, Markdown stripped, for speech); `refused` says why nothing was asked (Vibe resting, the person's daily allowance spent). `url` is the Vibe chat that keeps the question and the answer.

Fields

FieldTypeRequiredDescriptionConstraints
stateenumyes
  • one of "answered", "refused"
textstringyes
  • maxLength 4000
urlstring
  • pattern ^https://
  • format uri
chatstringThe Vibe chat's slug.
  • pattern ^v-[0-9a-f]{12}$
codestringWhy it was refused (chat.vibe.off, chat.vibe.allowance).

Examples

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

Valid: answered
{
  "state": "answered",
  "text": "Clear skies after six, around twelve degrees.",
  "url": "https://openvibe.chat/vibe/v-0123456789ab",
  "chat": "v-0123456789ab"
}
Valid: refused
{
  "state": "refused",
  "text": "You have used today's free answers.",
  "code": "chat.vibe.allowance"
}
Rejected: bad-state
{
  "state": "maybe",
  "text": "x"
}

Validate

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