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
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
subject | string | yes | The person Vibe answers, as the calling service vouches (Bot: the machine's owner, with voice on for that machine). |
|
text | string | yes | What they asked. |
|
source | object | yes |
| |
source.kind | enum | yes |
| |
source.id | string | yes | The source's stable id (the machine's device id): one chat per source. |
|
source.name | string | What to call it in the chat's name (the machine's name). |
| |
lang | string |
| ||
idempotency_key | string | The caller's id for this ask (Bot: device id and the voice_ask id): asked again, the same answer, once. |
|
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 }] }