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
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
state | enum | yes |
| |
text | string | yes |
| |
url | string |
| ||
chat | string | The Vibe chat's slug. |
| |
code | string | Why 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 }] }