Compare commits

...

96 Commits

Author SHA1 Message Date
Dave Horton
abcb3ffa5d 0.1.1 2026-03-15 19:53:53 -04:00
Dave Horton
f5e7adcf66 update assemblyai 2026-03-15 19:53:36 -04:00
Dave Horton
f29b214208 0.1.0 2026-03-05 11:27:28 -05:00
Dave Horton
2bf7561980 better handling of synonyms and shortcuts (#127) 2026-03-05 11:26:51 -05:00
Dave Horton
96db93fcdc 0.0.130 2026-03-05 07:28:56 -05:00
Hoan Luu Huu
142718104a support model ces for dialogflow (#126) 2026-03-05 07:28:37 -05:00
Dave Horton
9ac144ef71 0.0.129 2026-03-05 07:24:30 -05:00
Hoan Luu Huu
337114035d support toolhook (#125) 2026-03-05 07:24:04 -05:00
Dave Horton
253bd8a49c 0.0.128 2026-02-26 07:25:14 -05:00
Hoan Luu Huu
7a5c094bfc houdifyOptions support audioQueryAbsoluteTimeout (#124) 2026-02-26 07:24:13 -05:00
Dave Horton
228f8773d3 0.0.127 2026-02-11 17:32:14 -05:00
Hoan Luu Huu
c9cd50c559 support noise isolation to config verb (#122)
* support noise isolation to config verb

* wip

* wip

* wip

* wip

* add vendor to turnTaking
2026-02-11 17:31:19 -05:00
Dave Horton
fe095be5c8 0.0.126 2026-02-01 13:43:23 -05:00
Dave Horton
71caf6bb53 allow listen to be nested in a conference verb (#123) 2026-02-01 13:42:49 -05:00
Dave Horton
887320fd5d 0.0.125 2026-01-21 07:28:59 -05:00
Hoan Luu Huu
f0ffdee9c6 support speechamtics end_of_utterance_silence_trigger (#121) 2026-01-21 07:28:44 -05:00
Dave Horton
1013db46d3 0.0.124 2026-01-21 07:23:25 -05:00
Sam Machin
8771e3f22f add statusHook to redirect (#120) 2026-01-21 07:22:54 -05:00
Dave Horton
ff757d3177 0.0.123 2026-01-02 10:20:58 -05:00
Sam Machin
5745cc9a29 add config:record type (#118) 2026-01-02 10:19:43 -05:00
Dave Horton
2b81fe20f0 0.0.122 2025-11-27 11:38:55 -06:00
Hoan Luu Huu
60a33e11eb suoppport houndifyOptions for requestInfo and sampleRate (#117) 2025-11-27 11:37:28 -06:00
Dave Horton
9717ce6d58 0.0.121 2025-11-18 07:31:21 -05:00
Hoan Luu Huu
49ffe5f526 support elevenlabs stt (#116) 2025-11-18 07:26:07 -05:00
Dave Horton
61590b66cc 0.0.120 2025-11-13 11:46:00 -05:00
Ed Robbins
d8cf684bf6 add audioLogging to azureOptions (#115) 2025-11-13 11:45:36 -05:00
Dave Horton
e039261eb5 0.0.119 2025-10-21 15:41:05 +01:00
Ed Robbins
23e726ed3f Add disableTtsCache to config verb spec (#114) 2025-10-21 10:40:41 -04:00
Sam Machin
e1bc5adc55 add distributeDtmf to conference (#113) 2025-10-21 10:40:08 -04:00
Dave Horton
76e2486535 0.0.118 2025-10-15 18:42:27 +03:00
Hoan Luu Huu
dfcf1de210 support gladia stt (#112) 2025-10-15 11:42:03 -04:00
Dave Horton
7d19707dec 0.0.117 2025-10-14 07:43:08 +03:00
Hoan Luu Huu
b4856e9d05 support houndify stt (#108)
* support houndify stt

* add testcase

* wip
2025-10-14 00:42:34 -04:00
Dave Horton
577191ed0d 0.0.116 2025-10-03 13:30:34 -04:00
Dave Horton
ee2ffff20d preflightThreshold is now eagerEotThreshold (#111) 2025-10-03 13:30:07 -04:00
Dave Horton
4c5b795498 0.0.115 2025-09-30 20:33:34 -07:00
Hoan Luu Huu
7ecd46393c fixed eagerEotThreshold for deepgram flux (#110) 2025-09-30 23:33:20 -04:00
Hoan Luu Huu
8fffe39195 update deepgrap flux options (#109) 2025-09-30 23:30:43 -04:00
Dave Horton
23cb499244 0.0.114 2025-09-09 17:56:59 -04:00
Dave Horton
fb94dc94cb wip (#107) 2025-09-09 17:56:30 -04:00
Hoan Luu Huu
30677b6cd1 auth should not be required by llm (#106) 2025-08-28 20:06:28 -04:00
Dave Horton
4ea9cda0f8 0.0.113 2025-08-11 20:44:53 -04:00
Dave Horton
a0b9f963c2 new deepgram option entity_prompt (#105) 2025-08-11 20:44:23 -04:00
Dave Horton
841a471faa 0.0.112 2025-08-05 10:18:46 -04:00
Dave Horton
44112f67b3 Wip (#104)
* wip

* wip
2025-08-05 10:18:14 -04:00
Dave Horton
1f7c98c0ce 0.0.111 2025-07-14 09:29:48 -04:00
Hoan Luu Huu
276a55e672 support Deepgram river options (#102) 2025-07-14 09:29:21 -04:00
Dave Horton
840db61042 0.0.110 2025-07-11 12:50:08 -04:00
Sam Machin
85e1b64ee4 add forwardPAI to dial (#103) 2025-07-11 12:49:37 -04:00
Dave Horton
8ed54e2d51 0.0.109 2025-07-11 10:20:35 -04:00
Hoan Luu Huu
c24fb7996c support enable stt latency calculation (#99)
* support enable stt latency calculation

* fixed review comment
2025-07-11 09:57:03 -04:00
Dave Horton
6c24ad1145 0.0.108 2025-07-09 10:23:15 -04:00
Sam Machin
af3955cb35 add alert (#101) 2025-07-09 10:22:54 -04:00
Hoan Luu Huu
1ee29749c3 support mod_vad_silero (#100)
* support mod_vad_silero

* wip

* wip
2025-07-06 16:02:17 -04:00
Dave Horton
dea57e0910 0.0.107 2025-07-02 20:36:01 -04:00
Hoan Luu Huu
f444a57bcd consistent assemblyAiOptions name (#98) 2025-07-02 20:35:08 -04:00
Dave Horton
a9a2339821 0.0.106 2025-06-29 08:04:27 -04:00
Hoan Luu Huu
95f3a06625 support assembly ai v3 (#97)
* support assembly ai v3

* wip
2025-06-29 08:02:46 -04:00
Dave Horton
985476e8b1 0.0.105 2025-06-10 15:25:01 +02:00
Hoan Luu Huu
1782db362e support autoStreamTts for enabling say.stream = true globaly (#96) 2025-06-10 15:24:14 +02:00
Dave Horton
e654ee9e10 0.0.104 2025-05-13 07:49:29 -04:00
Hoan Luu Huu
38d1d04c4a support whisper say verb instructions (#95) 2025-05-13 07:49:16 -04:00
Dave Horton
5cbd3886d1 0.0.103 2025-04-20 09:34:50 -04:00
Dave Horton
de8dfc9202 add mcpServers to llm (#89)
* add mcpServers to llm

* add testcase

---------

Co-authored-by: Quan HL <quan.luuhoang8@gmail.com>
2025-04-20 09:34:20 -04:00
Dave Horton
637431468d 0.0.102 2025-04-11 07:37:31 -04:00
Sam Machin
4a817c97b2 Update specs.json (#93)
model is not required for ALL llm providers
2025-04-11 07:19:02 -04:00
Dave Horton
ce44bf41d4 0.0.101 2025-03-26 16:16:48 -04:00
Dave Horton
ab84583eff add semantic_vad for openai stt (#92) 2025-03-26 16:16:20 -04:00
Dave Horton
13901713b8 0.0.100 2025-03-26 10:47:44 -04:00
Dave Horton
85fd68af16 add templates for openai prompts for stt (#91) 2025-03-26 10:47:18 -04:00
Dave Horton
5a5a397a68 0.0.99 2025-03-24 18:47:28 -04:00
Dave Horton
b85c7ac743 add openai STT options (#90)
* add openai STT options

* wip

* allow apikey passed as param for openai stt
2025-03-24 18:47:01 -04:00
Dave Horton
82c6952f70 0.0.98 2025-03-06 11:51:34 -05:00
Sam Machin
fc95fa3d02 add digitCount to amd (#88) 2025-03-06 11:51:01 -05:00
Dave Horton
6b3ee83d08 0.0.97 2025-02-15 09:22:43 -05:00
Hoan Luu Huu
3700ba6607 deepgram options noDelay (#86) 2025-02-15 09:10:11 -05:00
Dave Horton
09a76f44cb 0.0.96 2025-02-07 12:53:24 -05:00
Dave Horton
aa445c1edb add deepgramOptions.keyterms (#85) 2025-02-07 12:52:29 -05:00
rammohan-y
57887a660c https://github.com/jambonz/jambonz-feature-server/issues/1057 (#83)
added speechRecognitionMode in azureOptions as enum
2025-01-24 07:21:51 -05:00
Dave Horton
e9dace6495 0.0.94 2025-01-16 10:57:11 -05:00
Dave Horton
762a9639bd add channel to listen opts (#82) 2025-01-16 10:56:40 -05:00
Dave Horton
2740eb9848 wip (#81) 2025-01-16 10:53:30 -05:00
Dave Horton
1a525e7a3e 0.0.93 2025-01-15 10:36:15 -05:00
Dave Horton
f16b49cc23 add domain for speechmatics (#80) 2025-01-15 10:36:04 -05:00
Dave Horton
1cc7dae926 0.0.92 2025-01-13 10:55:23 -05:00
Sam Machin
8c50bf8764 add deepgram fillerWords (#79) 2025-01-13 10:54:54 -05:00
Dave Horton
e2bffbe0a8 0.0.91 2024-12-30 14:25:41 -05:00
Sam Machin
4b79b1408b add timeLimit to REST:Dial & test (#78)
also added timeLimit to the dial verb test
2024-12-30 14:23:32 -05:00
Dave Horton
900d517b8a 0.0.90 2024-12-11 10:32:44 -05:00
Hoan Luu Huu
104ca00a3d support refer display name (#76) 2024-12-11 10:27:55 -05:00
Dave Horton
7b3dd92c18 0.0.89 2024-12-05 16:16:55 -05:00
Dave Horton
43a2805ea8 add support for config.ttsStream (#75) 2024-12-05 16:16:35 -05:00
Dave Horton
f9e6755d8d 0.0.88 2024-11-26 14:42:44 -05:00
Dave Horton
264640bbc7 add say.closeStreamOnEmpty 2024-11-26 14:42:36 -05:00
Dave Horton
71d31952d6 0.0.87 2024-11-26 13:53:21 -05:00
Dave Horton
6a80506a81 add support for say verb streaming tts (#74) 2024-11-26 13:52:58 -05:00
5 changed files with 2512 additions and 753 deletions

View File

@@ -4,6 +4,27 @@ const _specData = require('./specs');
const specs = new Map();
for (const key in _specData) { specs.set(key, _specData[key]); }
/* verb synonyms and shortcuts: maps alias verb names to their canonical form,
optionally injecting properties (e.g. vendor) into the verb data */
const verbTransforms = new Map([
['stream', {verb: 'listen'}],
['s2s', {verb: 'llm'}],
['openai_s2s', {verb: 'llm', properties: {vendor: 'openai'}}],
['microsoft_s2s', {verb: 'llm', properties: {vendor: 'microsoft'}}],
['google_s2s', {verb: 'llm', properties: {vendor: 'google'}}],
['elevenlabs_s2s', {verb: 'llm', properties: {vendor: 'elevenlabs'}}],
['deepgram_s2s', {verb: 'llm', properties: {vendor: 'deepgram'}}],
['voiceagent_s2s', {verb: 'llm', properties: {vendor: 'voiceagent'}}],
['ultravox_s2s', {verb: 'llm', properties: {vendor: 'ultravox'}}],
]);
function applyVerbTransform(name, data) {
const transform = verbTransforms.get(name);
if (!transform) return {name, data};
const newData = transform.properties ? {...transform.properties, ...data} : data;
return {name: transform.verb, data: newData};
}
function normalizeJambones(logger, obj) {
if (!Array.isArray(obj)) {
throw new Error('malformed jambonz payload: must be array');
@@ -13,18 +34,22 @@ function normalizeJambones(logger, obj) {
if (typeof tdata !== 'object') throw new Error('malformed jambonz payload: must be array of objects');
if ('verb' in tdata) {
// {verb: 'say', text: 'foo..bar'..}
const name = tdata.verb;
const o = {};
Object.keys(tdata)
.filter((k) => k !== 'verb')
.forEach((k) => o[k] = tdata[k]);
const {name, data} = applyVerbTransform(tdata.verb, o);
const o2 = {};
o2[name] = o;
o2[name] = data;
document.push(o2);
}
else if (Object.keys(tdata).length === 1) {
// {'say': {..}}
document.push(tdata);
const key = Object.keys(tdata)[0];
const {name, data} = applyVerbTransform(key, tdata[key]);
const o2 = {};
o2[name] = data;
document.push(o2);
}
else {
logger.info(tdata, 'malformed jambonz payload: missing verb property');

2596
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "@jambonz/verb-specifications",
"version": "0.0.86",
"version": "0.1.1",
"description": "Jambonz Verb Specification Utilities",
"main": "index.js",
"scripts": {
@@ -20,7 +20,7 @@
"devDependencies": {
"eslint": "^7.32.0",
"eslint-plugin-promise": "^4.3.1",
"tape": "^5.6.1"
"tape": "^5.7.5"
},
"dependencies": {
"debug": "^4.3.4",

View File

@@ -1,4 +1,13 @@
{
"alert" : {
"properties": {
"id": "string",
"message": "string"
},
"required": [
"message"
]
},
"answer": {
"properties": {
"id": "string"
@@ -34,6 +43,7 @@
"id": "string",
"referTo": "string",
"referredBy": "string",
"referredByDisplayName": "string",
"headers": "object",
"actionHook": "object|string",
"eventHook": "object|string"
@@ -48,19 +58,27 @@
"synthesizer": "#synthesizer",
"recognizer": "#recognizer",
"bargeIn": "#bargeIn",
"ttsStream": "#ttsStream",
"record": "#recordOptions",
"listen": "#listenOptions",
"stream": "#listenOptions",
"transcribe": "#transcribeOptions",
"amd": "#amd",
"fillerNoise": "#fillerNoise",
"notifyEvents": "boolean",
"notifySttLatency": "boolean",
"reset": "string|array",
"onHoldMusic": "string",
"actionHookDelayAction": "#actionHookDelayAction",
"sipRequestWithinDialogHook": "object|string",
"boostAudioSignal": "number|string",
"vad":"#vad",
"referHook": "object|string"
"referHook": "object|string",
"earlyMedia": "boolean",
"autoStreamTts": "boolean",
"disableTtsCache": "boolean",
"noiseIsolation": "#noiseIsolation",
"turnTaking": "#turnTaking"
},
"required": []
},
@@ -96,6 +114,15 @@
"enable"
]
},
"ttsStream": {
"properties": {
"enable": "boolean",
"synthesizer": "#synthesizer"
},
"required": [
"enable"
]
},
"bargeIn": {
"properties": {
"enable": "boolean",
@@ -200,13 +227,15 @@
"properties": {
"id": "string",
"text": "string|array",
"instructions": "string",
"stream": "boolean",
"loop": "number|string",
"synthesizer": "#synthesizer",
"earlyMedia": "boolean",
"disableTtsCache": "boolean"
"disableTtsCache": "boolean",
"closeStreamOnEmpty": "boolean"
},
"required": [
"text"
]
},
"gather": {
@@ -252,7 +281,9 @@
"statusEvents": "array",
"statusHook": "object|string",
"enterHook": "object|string",
"record": "#record"
"record": "#record",
"listen": "#listen",
"distributeDtmf": "boolean"
},
"required": [
"name"
@@ -276,6 +307,7 @@
"exitMediaPath": "boolean",
"boostAudioSignal": "number|string",
"listen": "#listen",
"stream": "#listen",
"target": ["#target"],
"timeLimit": "number",
"timeout": "number",
@@ -283,7 +315,8 @@
"transcribe": "#transcribe",
"amd": "#amd",
"dub": ["#dub"],
"tag": "object"
"tag": "object",
"forwardPAI": "boolean"
},
"required": [
"target"
@@ -299,7 +332,7 @@
"region": "string",
"model": {
"type": "string",
"enum": ["es", "cx"]
"enum": ["es", "cx", "ces"]
},
"lang": "string",
"actionHook": "object|string",
@@ -387,7 +420,8 @@
"transcribe": "#transcribe",
"url": "string",
"wsAuth": "#auth",
"earlyMedia": "boolean"
"earlyMedia": "boolean",
"channel": "number"
},
"required": [
"url"
@@ -400,6 +434,7 @@
"model": "string",
"auth": "object",
"connectOptions": "object",
"mcpServers": ["#mcpServer"],
"actionHook": "object|string",
"eventHook": "object|string",
"toolHook": "object|string",
@@ -408,11 +443,19 @@
},
"required": [
"vendor",
"model",
"auth",
"llmOptions"
]
},
"mcpServer": {
"properties": {
"url": "string",
"auth": "object",
"roots": ["#root"]
},
"required": [
"url"
]
},
"message": {
"properties": {
"id": "string",
@@ -467,6 +510,11 @@
"type": "string",
"enum": ["startCallRecording", "stopCallRecording", "pauseCallRecording", "resumeCallRecording"]
},
"type" : {
"type" : "string",
"enum" : ["cloud", "siprec"]
},
"recordingID": "string",
"siprecServerURL": "string|array",
"headers": "object"
@@ -478,7 +526,8 @@
"redirect": {
"properties": {
"id": "string",
"actionHook": "object|string"
"actionHook": "object|string",
"statusHook": "object|string"
},
"required": [
"actionHook"
@@ -506,7 +555,8 @@
"amd": "#amd",
"dual_streams": "boolean",
"sipRequestWithinDialogHook": "string",
"referHook": "object|string"
"referHook": "object|string",
"timeLimit": "number"
},
"required": [
"call_hook",
@@ -533,7 +583,6 @@
"channel": "number"
},
"required": [
"transcriptionHook"
]
},
"target": {
@@ -689,7 +738,11 @@
"googleOptions": "#googleOptions",
"customOptions": "#customOptions",
"verbioOptions": "#verbioOptions",
"speechmaticsOptions": "#speechmaticsOptions"
"speechmaticsOptions": "#speechmaticsOptions",
"openaiOptions": "#openaiOptions",
"houndifyOptions": "#houndifyOptions",
"gladiaOptions": "object",
"elevenlabsOptions": "#elevenlabsOptions"
},
"required": [
"vendor"
@@ -732,12 +785,21 @@
"properties": {
"speechSegmentationSilenceTimeoutMs": "number",
"postProcessing" : "string",
"audioLogging" : "boolean",
"languageIdMode": {
"type": "string",
"enum": [
"AtStart",
"Continuous"
]
},
"speechRecognitionMode": {
"type": "string",
"enum": [
"CONVERSATION",
"DICTATION",
"INTERACTIVE"
]
}
},
"required": [
@@ -759,6 +821,62 @@
"transcriptNormalization": "array"
}
},
"houndifyOptions": {
"properties": {
"requestInfo": "object",
"sampleRate": "number",
"latitude": "number",
"longitude": "number",
"city": "string",
"state": "string",
"country": "string",
"timeZone": "string",
"domain": "string",
"audioEndpoint": "string",
"maxSilenceSeconds": "number",
"maxSilenceAfterFullQuerySeconds": "number",
"maxSilenceAfterPartialQuerySeconds": "number",
"vadSensitivity": "number",
"vadTimeout": "number",
"vadMode": "string",
"vadVoiceMs": "number",
"vadSilenceMs": "number",
"vadDebug": "boolean",
"audioFormat": "string",
"enableNoiseReduction": "boolean",
"enableProfanityFilter": "boolean",
"enablePunctuation": "boolean",
"enableCapitalization": "boolean",
"confidenceThreshold": "number",
"enableDisfluencyFilter": "boolean",
"maxResults": "number",
"enableWordTimestamps": "boolean",
"maxAlternatives": "number",
"partialTranscriptInterval": "number",
"sessionTimeout": "number",
"connectionTimeout": "number",
"customVocabulary": "array",
"languageModel": "string",
"audioQueryAbsoluteTimeout": "number"
}
},
"elevenlabsOptions": {
"properties": {
"includeTimestamps": "boolean",
"commitStrategy": {
"type": "string",
"enum": [
"manual",
"vad"
]
},
"vadSilenceThresholdSecs": "number",
"vadThreshold": "number",
"minSpeechDurationMs": "number",
"minSilenceDurationMs": "number",
"enableLogging": "boolean"
}
},
"cobaltOptions": {
"properties": {
"serverUri": "string",
@@ -812,6 +930,7 @@
"version": "string",
"punctuate": "boolean",
"smartFormatting": "boolean",
"noDelay": "boolean",
"profanityFilter": "boolean",
"redact": {
"type": "string",
@@ -831,11 +950,18 @@
"search": "array",
"replace": "array",
"keywords": "array",
"keyterms": "array",
"endpointing": "boolean | number",
"utteranceEndMs": "number",
"shortUtterance": "boolean",
"vadTurnoff": "number",
"tag": "string"
"tag": "string",
"fillerWords" : "boolean",
"eotThreshold": "number",
"eotTimeoutMs": "number",
"mipOptOut": "boolean",
"entityPrompt": "string",
"eagerEotThreshold":"number"
}
},
"sonioxOptions": {
@@ -866,6 +992,60 @@
"required": [
]
},
"openaiOptions": {
"properties": {
"apiKey": "string",
"model": "string",
"prompt": "string",
"promptTemplates": "#promptTemplates",
"language": "string",
"input_audio_noise_reduction": {
"type": "string",
"enum": [
"near_field",
"far_field"
]
},
"turn_detection": "#turnDetection"
},
"required": [
]
},
"promptTemplates": {
"properties": {
"hintsTemplate": "string",
"conversationHistoryTemplate": "string"
},
"required": [
]
},
"turnDetection": {
"properties": {
"type": {
"type": "string",
"enum": [
"none",
"server_vad",
"semantic_vad"
]
},
"eagerness": {
"type": "string",
"enum": [
"low",
"medium",
"high",
"auto"
]
},
"threshold": "number",
"prefix_padding_ms": "number",
"silence_duration_ms": "number"
},
"required": [
"type"
]
},
"speechmaticsOptions": {
"properties": {
"transcription_config": "#sm_transcriptionConfig",
@@ -878,9 +1058,11 @@
"sm_transcriptionConfig": {
"properties": {
"language": "string",
"domain": "string",
"additional_vocab": "array",
"diarization": "string",
"speaker_diarization_config": "#sm_speakerDiarizationConfig",
"conversation_config": "#sm_conversationConfig",
"enable_partials": "boolean",
"max_delay": "number",
"max_delay_mode": {
@@ -908,6 +1090,13 @@
"required": [
]
},
"sm_conversationConfig": {
"properties": {
"end_of_utterance_silence_trigger": "number"
},
"required": [
]
},
"sm_puctuationOverrides": {
"properties": {
"permitted_marks": "array",
@@ -1014,7 +1203,25 @@
},
"assemblyAiOptions": {
"properties": {
"apiKey": "string"
"apiKey": "string",
"serviceVersion": {
"type": "string",
"enum": [
"v2",
"v3"
]
},
"speechModel": "string",
"formatTurns": "boolean",
"endOfTurnConfidenceThreshold": "number",
"minEndOfTurnSilenceWhenConfident": "number",
"maxTurnSilence": "number",
"minTurnSilence": "number",
"keyterms": "array",
"prompt": "string",
"languageDetection": "boolean",
"vadThreshold": "number",
"inactivityTimeout": "number"
}
},
"resource": {
@@ -1095,16 +1302,25 @@
"voiceMs": "number",
"silenceMs": "number",
"strategy": "string",
"mode": "number"
"mode": "number",
"vendor": {
"type": "string",
"enum": [
"webrtc",
"silero"
]
},
"threshold": "number",
"speechPadMs": "number"
},
"required": [
"enable"
]
},
"amd": {
"properties": {
"actionHook": "object|string",
"thresholdWordCount": "number",
"digitCount": "number",
"timers": "#amdTimers",
"recognizer": "#recognizer"
},
@@ -1136,5 +1352,53 @@
"streaming": "boolean",
"sampleRate": "number"
}
},
"pipeline": {
"properties": {
"id": "string",
"stt": "#recognizer",
"tts": "#synthesizer",
"vad": "#vad",
"turnDetection": "#turnDetectionPipeline",
"llm": "#llm",
"preflightLlm": "boolean",
"actionHook": "object|string",
"eventHook": "object|string",
"toolHook": "object|string"
},
"required": [
"stt",
"llm",
"tts"
]
},
"turnDetectionPipeline": {
"properties": {
"vendor": {
"type": "string",
"enum": ["krisp"]
},
"threshold": "number",
"eagerEotThreshold": "number"
},
"required": [
"vendor"
]
},
"noiseIsolation" : {
"properties": {
"enable": "boolean",
"vendor": "string",
"level": "number",
"model": "string"
}
},
"turnTaking": {
"properties": {
"enable": "boolean",
"vendor": "string",
"threshold": "number",
"model": "string"
}
}
}

View File

@@ -1,6 +1,6 @@
const test = require('tape');
const logger = require('pino')({level: process.env.JAMBONES_LOGLEVEL || 'error'});
const { validate } = require('..');
const { validate, normalizeJambones } = require('..');
test("validate correct verbs", async (t) => {
@@ -72,12 +72,18 @@ test("validate correct verbs", async (t) => {
},
{
"verb": "config",
"notifySttLatency": true,
"recognizer": {
"vendor": "google",
"language": "de-DE",
"label": "label1",
"assemblyAiOptions": {
"apiKey": "apikey"
"apiKey": "apikey",
"serviceVersion": "v3",
"formatTurns": true,
"endOfTurnConfidenceThreshold": 0.5,
"minEndOfTurnSilenceWhenConfident": 500,
"maxTurnSilence": 2000
}
}
},
@@ -139,6 +145,7 @@ test("validate correct verbs", async (t) => {
"callerName": "Tom",
"answerOnBridge": true,
"dtmfCapture": ["*2", "*3"],
"timeLimit": 10,
"dtmfHook": {
"url": "/dtmf",
"method": "GET"
@@ -204,7 +211,12 @@ test("validate correct verbs", async (t) => {
"hintsBoost": 10,
"fastRecognitionTimeout": 2000,
"deepgramOptions": {
"endpointing": 500
"endpointing": 500,
"noDelay": true,
"eotThreshold": 500,
"eotTimeoutMs": 5000,
"eagerEotThreshold": 200,
"mipOptOut": true
}
},
"say": {
@@ -219,6 +231,10 @@ test("validate correct verbs", async (t) => {
"fallbackVoice": "voice"
}
},
"say": {
"text": "To speak to Sales press 1 or say Sales. To speak to customer support press 2 or say Support",
"instructions": "Voice: High-energy, upbeat, and encouraging, projecting enthusiasm and motivation."
},
"say": {
"text": "To speak to Sales press 1 or say Sales. To speak to customer support press 2 or say Support",
"synthesizer": {
@@ -263,6 +279,70 @@ test("validate correct verbs", async (t) => {
}
},
},
{
"verb": "gather",
"actionHook": "http://example.com/collect",
"input": ["digits", "speech"],
"bargein": true,
"dtmfBargein": true,
"finishOnKey": "#",
"numDigits": 5,
"timeout": 8,
"recognizer": {
"vendor": "houndify",
"language": "en-US",
"houndifyOptions": {
"requestInfo": {
"Latitude": 30.6,
"Longitude": 30.6,
"City": "Huston"
},
"sampleRate": 16000,
"latitude": 30.6,
"longitude": 30.6,
"city": "Huston",
"state": "CA",
"country": "US",
"timeZone": "GMT",
"domain": "Voice",
"audioEndpoint": "https://api.houndify.com/v1/audio",
"maxSilenceSeconds": 5,
"maxSilenceAfterFullQuerySeconds": 3,
"maxSilenceAfterPartialQuerySeconds": 2,
"vadSensitivity": 0.5,
"vadTimeout": 1000,
"vadMode": "auto",
"vadVoiceMs": 250,
"vadSilenceMs": 500,
"vadDebug": true,
"audioFormat": "PCM16",
"enableNoiseReduction": true,
"enableProfanityFilter": false,
"enablePunctuation": true,
"enableCapitalization": true,
"confidenceThreshold": 0.7,
"enableDisfluencyFilter": true,
"maxResults": 5,
"enableWordTimestamps": true,
"maxAlternatives": 3,
"partialTranscriptInterval": 100,
"sessionTimeout": 30000,
"connectionTimeout": 5000,
"customVocabulary": ["jambonz", "telephony", "voip"],
"languageModel": "enhanced",
"audioQueryAbsoluteTimeout": 5
},
"gladiaOptions": {
"post_processing": {
"summarization": false,
"summarization_config": {
"type": "general"
},
"chapterization": false
},
}
},
},
{
"verb": "gather",
"actionHook": "http://example.com/collect",
@@ -372,6 +452,10 @@ test("validate correct verbs", async (t) => {
}
}
},
{
"verb": "config",
"autoStreamTts": true
},
{
"verb": "config",
"vad": {
@@ -379,7 +463,28 @@ test("validate correct verbs", async (t) => {
"voiceMs": 250,
"silenceMs": 150,
"strategy": "one-shot",
"mode": 2
"mode": 2,
"vendor": "webrtc",
"threshold": 0.5,
"speechPadMs": 1000
}
},
{
"verb": "config",
"noiseIsolation": {
"enable": true,
"vendor": "krisp",
"level": 3,
"model": "custom-model"
}
},
{
"verb": "config",
"turnTaking": {
"enable": true,
"vendor": "krisp",
"threshold": 0.5,
"model": "turn-taking-model"
}
},
{
@@ -440,6 +545,12 @@ test("validate correct verbs", async (t) => {
"referTo": "+15083084809",
"actionHook": "/action"
},
{
"verb": "sip:refer",
"referTo": "+15083084809",
"referredByDisplayName": "Alice",
"actionHook": "/action"
},
{
"verb": "tag",
"data": {
@@ -457,6 +568,24 @@ test("validate correct verbs", async (t) => {
"interim": true
}
},
{
"verb": "transcribe",
"transcriptionHook": "http://example.com/transcribe",
"recognizer": {
"vendor": "nvidia",
"language" : "en-US",
"interim": true,
"elevenlabsOptions": {
"includeTimestamps": true,
"commitStrategy": "vad",
"vadSilenceThresholdSecs": 0.8,
"vadThreshold": 0.5,
"minSpeechDurationMs": 300,
"minSilenceDurationMs": 500,
"enableLogging": false
}
}
},
{
"verb": "transcribe",
"transcriptionHook": "http://example.com/transcribe",
@@ -512,7 +641,96 @@ test("validate correct verbs", async (t) => {
"actionHook": "/answeringMachineDetection",
},
"dual_streams": true
"dual_streams": true,
"timeLimit" : 10
},
{
"verb": "llm",
"vendor": 'ultravox',
"model": 'fixie-ai/ultravox',
"auth": {
"apiKey": "sk-1234567890abcdefg"
},
"llmOptions": {
"firstSpeaker": 'FIRST_SPEAKER_AGENT',
},
"mcpServers": [
{
"url": 'https://mcp.example.com',
"auth": {
"username": 'username',
"password": 'password'
}
}
]
},
{
"verb": "s2s",
"vendor": "openai",
"llmOptions": {
"model": "gpt-4o-realtime"
}
},
{
"verb": "openai_s2s",
"llmOptions": {
"model": "gpt-4o-realtime"
}
},
{
"verb": "google_s2s",
"llmOptions": {
"model": "gemini-2.0-flash"
}
},
{
"verb": "elevenlabs_s2s",
"llmOptions": {
"agentId": "agent-123"
}
},
{
"verb": "stream",
"url": "wss://myrecorder.example.com/calls",
"mixType": "stereo"
},
{
"verb": "pipeline",
"stt": {
"vendor": "google",
"language": "en-US"
},
"tts": {
"vendor": "google",
"language": "en-US"
},
"llm": {
"vendor": "openai",
"llmOptions": {
"model": "gpt-4o"
}
},
"actionHook": "/pipeline/action",
"eventHook": "/pipeline/event",
"toolHook": "/pipeline/tool"
},
{
"verb": "transcribe",
"transcriptionHook": "http://example.com/transcribe",
"recognizer": {
"vendor": "speechmatics",
"language": "en",
"speechmaticsOptions": {
"transcription_config": {
"language": "en",
"enable_partials": true,
"max_delay": 2,
"conversation_config": {
"end_of_utterance_silence_trigger": 0.5
}
}
}
}
}
];
try {
@@ -540,6 +758,110 @@ test('invalid test', async (t) => {
} catch(err) {
t.ok(1 == 1,'successfully validate verbs');
}
t.end();
})
});
test('verb synonyms: stream is synonym for listen', async (t) => {
// "verb" format
const result1 = normalizeJambones(logger, [
{"verb": "stream", "url": "wss://example.com/calls", "mixType": "stereo"}
]);
t.equal(Object.keys(result1[0])[0], 'listen', 'stream verb is rewritten to listen');
t.equal(result1[0].listen.url, 'wss://example.com/calls', 'data is preserved');
// object-key format
const result2 = normalizeJambones(logger, [
{"stream": {"url": "wss://example.com/calls"}}
]);
t.equal(Object.keys(result2[0])[0], 'listen', 'stream key is rewritten to listen');
// validate passes
try {
validate(logger, [{"verb": "stream", "url": "wss://example.com/calls"}]);
t.pass('stream verb validates successfully');
} catch (err) {
t.fail('stream verb should validate: ' + err);
}
t.end();
});
test('verb synonyms: s2s is synonym for llm', async (t) => {
const result = normalizeJambones(logger, [
{"verb": "s2s", "vendor": "openai", "llmOptions": {"model": "gpt-4o"}}
]);
t.equal(Object.keys(result[0])[0], 'llm', 's2s verb is rewritten to llm');
t.equal(result[0].llm.vendor, 'openai', 'vendor is preserved');
t.equal(result[0].llm.llmOptions.model, 'gpt-4o', 'llmOptions preserved');
try {
validate(logger, [{"verb": "s2s", "vendor": "openai", "llmOptions": {"model": "gpt-4o"}}]);
t.pass('s2s verb validates successfully');
} catch (err) {
t.fail('s2s verb should validate: ' + err);
}
t.end();
});
test('vendor shortcuts: openai_s2s injects vendor', async (t) => {
const result = normalizeJambones(logger, [
{"verb": "openai_s2s", "llmOptions": {"model": "gpt-4o-realtime"}}
]);
t.equal(Object.keys(result[0])[0], 'llm', 'openai_s2s is rewritten to llm');
t.equal(result[0].llm.vendor, 'openai', 'vendor is injected');
t.equal(result[0].llm.llmOptions.model, 'gpt-4o-realtime', 'llmOptions preserved');
try {
validate(logger, [{"verb": "openai_s2s", "llmOptions": {"model": "gpt-4o-realtime"}}]);
t.pass('openai_s2s validates successfully');
} catch (err) {
t.fail('openai_s2s should validate: ' + err);
}
t.end();
});
test('vendor shortcuts: all vendors work', async (t) => {
const vendors = [
'openai', 'microsoft', 'google', 'elevenlabs', 'deepgram', 'voiceagent', 'ultravox'
];
for (const vendor of vendors) {
const verbName = `${vendor}_s2s`;
const result = normalizeJambones(logger, [
{"verb": verbName, "llmOptions": {}}
]);
t.equal(Object.keys(result[0])[0], 'llm', `${verbName} rewrites to llm`);
t.equal(result[0].llm.vendor, vendor, `${verbName} injects vendor=${vendor}`);
}
t.end();
});
test('vendor shortcuts: object-key format works', async (t) => {
const result = normalizeJambones(logger, [
{"google_s2s": {"llmOptions": {"model": "gemini-2.0-flash"}}}
]);
t.equal(Object.keys(result[0])[0], 'llm', 'google_s2s key is rewritten to llm');
t.equal(result[0].llm.vendor, 'google', 'vendor is injected');
t.equal(result[0].llm.llmOptions.model, 'gemini-2.0-flash', 'llmOptions preserved');
t.end();
});
test('vendor shortcuts: explicit vendor in data overrides injected vendor', async (t) => {
const result = normalizeJambones(logger, [
{"verb": "openai_s2s", "vendor": "custom", "llmOptions": {}}
]);
t.equal(result[0].llm.vendor, 'custom', 'explicit vendor takes precedence');
t.end();
});
test('non-synonym verbs are unchanged', async (t) => {
const result = normalizeJambones(logger, [
{"verb": "say", "text": "hello"}
]);
t.equal(Object.keys(result[0])[0], 'say', 'say verb is not transformed');
const result2 = normalizeJambones(logger, [
{"llm": {"vendor": "openai", "llmOptions": {}}}
]);
t.equal(Object.keys(result2[0])[0], 'llm', 'llm verb is not transformed');
t.end();
});