mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2026-01-25 02:07:56 +00:00
support houndify stt (#1364)
* support houndify stt * wip * wip * wip * update houndify stt parameters * wip * wip
This commit is contained in:
@@ -1166,6 +1166,14 @@ class CallSession extends Emitter {
|
|||||||
service_version: credential.service_version
|
service_version: credential.service_version
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
else if ('houndify' === vendor) {
|
||||||
|
return {
|
||||||
|
speech_credential_sid: credential.speech_credential_sid,
|
||||||
|
client_id: credential.client_id,
|
||||||
|
client_key: credential.client_key,
|
||||||
|
user_id: credential.user_id
|
||||||
|
};
|
||||||
|
}
|
||||||
else if ('deepgramflux' === vendor) {
|
else if ('deepgramflux' === vendor) {
|
||||||
return {
|
return {
|
||||||
speech_credential_sid: credential.speech_credential_sid,
|
speech_credential_sid: credential.speech_credential_sid,
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ const {
|
|||||||
NvidiaTranscriptionEvents,
|
NvidiaTranscriptionEvents,
|
||||||
JambonzTranscriptionEvents,
|
JambonzTranscriptionEvents,
|
||||||
AssemblyAiTranscriptionEvents,
|
AssemblyAiTranscriptionEvents,
|
||||||
|
HoundifyTranscriptionEvents,
|
||||||
DeepgramfluxTranscriptionEvents,
|
DeepgramfluxTranscriptionEvents,
|
||||||
VoxistTranscriptionEvents,
|
VoxistTranscriptionEvents,
|
||||||
CartesiaTranscriptionEvents,
|
CartesiaTranscriptionEvents,
|
||||||
@@ -563,6 +564,18 @@ class TaskGather extends SttTask {
|
|||||||
this._onVendorConnectFailure.bind(this, cs, ep));
|
this._onVendorConnectFailure.bind(this, cs, ep));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'houndify':
|
||||||
|
this.bugname = `${this.bugname_prefix}houndify_transcribe`;
|
||||||
|
this.addCustomEventListener(ep, HoundifyTranscriptionEvents.Transcription,
|
||||||
|
this._onTranscription.bind(this, cs, ep));
|
||||||
|
this.addCustomEventListener(ep, HoundifyTranscriptionEvents.Error,
|
||||||
|
this._onVendorError.bind(this, cs, ep));
|
||||||
|
this.addCustomEventListener(ep, HoundifyTranscriptionEvents.ConnectFailure,
|
||||||
|
this._onVendorConnectFailure.bind(this, cs, ep));
|
||||||
|
this.addCustomEventListener(ep, HoundifyTranscriptionEvents.Connect,
|
||||||
|
this._onVendorConnect.bind(this, cs, ep));
|
||||||
|
break;
|
||||||
|
|
||||||
case 'voxist':
|
case 'voxist':
|
||||||
this.bugname = `${this.bugname_prefix}voxist_transcribe`;
|
this.bugname = `${this.bugname_prefix}voxist_transcribe`;
|
||||||
this.addCustomEventListener(ep, VoxistTranscriptionEvents.Transcription,
|
this.addCustomEventListener(ep, VoxistTranscriptionEvents.Transcription,
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ const {
|
|||||||
JambonzTranscriptionEvents,
|
JambonzTranscriptionEvents,
|
||||||
TranscribeStatus,
|
TranscribeStatus,
|
||||||
AssemblyAiTranscriptionEvents,
|
AssemblyAiTranscriptionEvents,
|
||||||
|
HoundifyTranscriptionEvents,
|
||||||
VoxistTranscriptionEvents,
|
VoxistTranscriptionEvents,
|
||||||
CartesiaTranscriptionEvents,
|
CartesiaTranscriptionEvents,
|
||||||
OpenAITranscriptionEvents,
|
OpenAITranscriptionEvents,
|
||||||
@@ -324,6 +325,18 @@ class TaskTranscribe extends SttTask {
|
|||||||
this._onVendorConnectFailure.bind(this, cs, ep, channel));
|
this._onVendorConnectFailure.bind(this, cs, ep, channel));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'houndify':
|
||||||
|
this.bugname = `${this.bugname_prefix}houndify_transcribe`;
|
||||||
|
this.addCustomEventListener(ep, HoundifyTranscriptionEvents.Transcription,
|
||||||
|
this._onTranscription.bind(this, cs, ep, channel));
|
||||||
|
this.addCustomEventListener(ep, HoundifyTranscriptionEvents.Error,
|
||||||
|
this._onVendorError.bind(this, cs, ep));
|
||||||
|
this.addCustomEventListener(ep, HoundifyTranscriptionEvents.ConnectFailure,
|
||||||
|
this._onVendorConnectFailure.bind(this, cs, ep, channel));
|
||||||
|
this.addCustomEventListener(ep, HoundifyTranscriptionEvents.Connect,
|
||||||
|
this._onVendorConnect.bind(this, cs, ep));
|
||||||
|
break;
|
||||||
|
|
||||||
case 'voxist':
|
case 'voxist':
|
||||||
this.bugname = `${this.bugname_prefix}voxist_transcribe`;
|
this.bugname = `${this.bugname_prefix}voxist_transcribe`;
|
||||||
this.addCustomEventListener(ep, VoxistTranscriptionEvents.Transcription,
|
this.addCustomEventListener(ep, VoxistTranscriptionEvents.Transcription,
|
||||||
|
|||||||
@@ -169,6 +169,12 @@
|
|||||||
"ConnectFailure": "assemblyai_transcribe::connect_failed",
|
"ConnectFailure": "assemblyai_transcribe::connect_failed",
|
||||||
"Connect": "assemblyai_transcribe::connect"
|
"Connect": "assemblyai_transcribe::connect"
|
||||||
},
|
},
|
||||||
|
"HoundifyTranscriptionEvents": {
|
||||||
|
"Transcription": "houndify_transcribe::transcription",
|
||||||
|
"Error": "houndify_transcribe::error",
|
||||||
|
"ConnectFailure": "houndify_transcribe::connect_failed",
|
||||||
|
"Connect": "houndify_transcribe::connect"
|
||||||
|
},
|
||||||
"VoxistTranscriptionEvents": {
|
"VoxistTranscriptionEvents": {
|
||||||
"Transcription": "voxist_transcribe::transcription",
|
"Transcription": "voxist_transcribe::transcription",
|
||||||
"Error": "voxist_transcribe::error",
|
"Error": "voxist_transcribe::error",
|
||||||
|
|||||||
@@ -142,6 +142,12 @@ const speechMapper = (cred) => {
|
|||||||
obj.api_key = o.api_key;
|
obj.api_key = o.api_key;
|
||||||
obj.service_version = o.service_version;
|
obj.service_version = o.service_version;
|
||||||
}
|
}
|
||||||
|
else if ('houndify' === obj.vendor) {
|
||||||
|
const o = JSON.parse(decrypt(credential));
|
||||||
|
obj.client_id = o.client_id;
|
||||||
|
obj.client_key = o.client_key;
|
||||||
|
obj.user_id = o.user_id;
|
||||||
|
}
|
||||||
else if ('voxist' === obj.vendor) {
|
else if ('voxist' === obj.vendor) {
|
||||||
const o = JSON.parse(decrypt(credential));
|
const o = JSON.parse(decrypt(credential));
|
||||||
obj.api_key = o.api_key;
|
obj.api_key = o.api_key;
|
||||||
|
|||||||
@@ -131,6 +131,43 @@ const stickyVars = {
|
|||||||
'OPENAI_TURN_DETECTION_PREFIX_PADDING_MS',
|
'OPENAI_TURN_DETECTION_PREFIX_PADDING_MS',
|
||||||
'OPENAI_TURN_DETECTION_SILENCE_DURATION_MS',
|
'OPENAI_TURN_DETECTION_SILENCE_DURATION_MS',
|
||||||
],
|
],
|
||||||
|
houndify: [
|
||||||
|
'HOUNDIFY_CLIENT_ID',
|
||||||
|
'HOUNDIFY_CLIENT_KEY',
|
||||||
|
'HOUNDIFY_USER_ID',
|
||||||
|
'HOUNDIFY_MAX_SILENCE_SECONDS',
|
||||||
|
'HOUNDIFY_MAX_SILENCE_AFTER_FULL_QUERY_SECONDS',
|
||||||
|
'HOUNDIFY_MAX_SILENCE_AFTER_PARTIAL_QUERY_SECONDS',
|
||||||
|
'HOUNDIFY_VAD_SENSITIVITY',
|
||||||
|
'HOUNDIFY_VAD_TIMEOUT',
|
||||||
|
'HOUNDIFY_VAD_MODE',
|
||||||
|
'HOUNDIFY_VAD_VOICE_MS',
|
||||||
|
'HOUNDIFY_VAD_SILENCE_MS',
|
||||||
|
'HOUNDIFY_VAD_DEBUG',
|
||||||
|
'HOUNDIFY_AUDIO_FORMAT',
|
||||||
|
'HOUNDIFY_ENABLE_NOISE_REDUCTION',
|
||||||
|
'HOUNDIFY_AUDIO_ENDPOINT',
|
||||||
|
'HOUNDIFY_ENABLE_PROFANITY_FILTER',
|
||||||
|
'HOUNDIFY_ENABLE_PUNCTUATION',
|
||||||
|
'HOUNDIFY_ENABLE_CAPITALIZATION',
|
||||||
|
'HOUNDIFY_CONFIDENCE_THRESHOLD',
|
||||||
|
'HOUNDIFY_ENABLE_DISFLUENCY_FILTER',
|
||||||
|
'HOUNDIFY_MAX_RESULTS',
|
||||||
|
'HOUNDIFY_ENABLE_WORD_TIMESTAMPS',
|
||||||
|
'HOUNDIFY_MAX_ALTERNATIVES',
|
||||||
|
'HOUNDIFY_PARTIAL_TRANSCRIPT_INTERVAL',
|
||||||
|
'HOUNDIFY_SESSION_TIMEOUT',
|
||||||
|
'HOUNDIFY_CONNECTION_TIMEOUT',
|
||||||
|
'HOUNDIFY_LATITUDE',
|
||||||
|
'HOUNDIFY_LONGITUDE',
|
||||||
|
'HOUNDIFY_CITY',
|
||||||
|
'HOUNDIFY_STATE',
|
||||||
|
'HOUNDIFY_COUNTRY',
|
||||||
|
'HOUNDIFY_TIMEZONE',
|
||||||
|
'HOUNDIFY_DOMAIN',
|
||||||
|
'HOUNDIFY_CUSTOM_VOCABULARY',
|
||||||
|
'HOUNDIFY_LANGUAGE_MODEL'
|
||||||
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -582,6 +619,30 @@ const normalizeAssemblyAi = (evt, channel, language) => {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const normalizeHoundify = (evt, channel, language) => {
|
||||||
|
const copy = JSON.parse(JSON.stringify(evt));
|
||||||
|
const alternatives = [];
|
||||||
|
const is_final = evt.ResultsAreFinal && evt.ResultsAreFinal[0] === true;
|
||||||
|
if (evt.Disambiguation && evt.Disambiguation.ChoiceData && evt.Disambiguation.ChoiceData.length > 0) {
|
||||||
|
// Handle Houndify Voice Search Result format
|
||||||
|
const choiceData = evt.Disambiguation.ChoiceData[0];
|
||||||
|
alternatives.push({
|
||||||
|
confidence: choiceData.ConfidenceScore || choiceData.ASRConfidence || 0.0,
|
||||||
|
transcript: choiceData.FormattedTranscription || choiceData.Transcription || '',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
language_code: language,
|
||||||
|
channel_tag: channel,
|
||||||
|
is_final,
|
||||||
|
alternatives,
|
||||||
|
vendor: {
|
||||||
|
name: 'houndify',
|
||||||
|
evt: copy
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
const normalizeVoxist = (evt, channel, language) => {
|
const normalizeVoxist = (evt, channel, language) => {
|
||||||
const copy = JSON.parse(JSON.stringify(evt));
|
const copy = JSON.parse(JSON.stringify(evt));
|
||||||
return {
|
return {
|
||||||
@@ -701,6 +762,8 @@ module.exports = (logger) => {
|
|||||||
return normalizeCobalt(evt, channel, language);
|
return normalizeCobalt(evt, channel, language);
|
||||||
case 'assemblyai':
|
case 'assemblyai':
|
||||||
return normalizeAssemblyAi(evt, channel, language, shortUtterance);
|
return normalizeAssemblyAi(evt, channel, language, shortUtterance);
|
||||||
|
case 'houndify':
|
||||||
|
return normalizeHoundify(evt, channel, language, shortUtterance);
|
||||||
case 'voxist':
|
case 'voxist':
|
||||||
return normalizeVoxist(evt, channel, language);
|
return normalizeVoxist(evt, channel, language);
|
||||||
case 'cartesia':
|
case 'cartesia':
|
||||||
@@ -1122,6 +1185,57 @@ module.exports = (logger) => {
|
|||||||
{ASSEMBLYAI_WORD_BOOST: JSON.stringify(rOpts.hints)})
|
{ASSEMBLYAI_WORD_BOOST: JSON.stringify(rOpts.hints)})
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
else if ('houndify' === vendor) {
|
||||||
|
const {
|
||||||
|
latitude, longitude, city, state, country, timeZone, domain, audioEndpoint,
|
||||||
|
maxSilenceSeconds, maxSilenceAfterFullQuerySeconds, maxSilenceAfterPartialQuerySeconds,
|
||||||
|
vadSensitivity, vadTimeout, vadMode, vadVoiceMs, vadSilenceMs, vadDebug,
|
||||||
|
audioFormat, enableNoiseReduction, enableProfanityFilter, enablePunctuation,
|
||||||
|
enableCapitalization, confidenceThreshold, enableDisfluencyFilter,
|
||||||
|
maxResults, enableWordTimestamps, maxAlternatives, partialTranscriptInterval,
|
||||||
|
sessionTimeout, connectionTimeout, customVocabulary, languageModel
|
||||||
|
} = rOpts.houndifyOptions || {};
|
||||||
|
|
||||||
|
opts = {
|
||||||
|
...opts,
|
||||||
|
HOUNDIFY_CLIENT_ID: sttCredentials.client_id,
|
||||||
|
HOUNDIFY_CLIENT_KEY: sttCredentials.client_key,
|
||||||
|
HOUNDIFY_USER_ID: sttCredentials.user_id,
|
||||||
|
HOUNDIFY_MAX_SILENCE_SECONDS: maxSilenceSeconds || 5,
|
||||||
|
HOUNDIFY_MAX_SILENCE_AFTER_FULL_QUERY_SECONDS: maxSilenceAfterFullQuerySeconds || 1,
|
||||||
|
HOUNDIFY_MAX_SILENCE_AFTER_PARTIAL_QUERY_SECONDS: maxSilenceAfterPartialQuerySeconds || 1.5,
|
||||||
|
...(vadSensitivity && {HOUNDIFY_VAD_SENSITIVITY: vadSensitivity}),
|
||||||
|
...(vadTimeout && {HOUNDIFY_VAD_TIMEOUT: vadTimeout}),
|
||||||
|
...(vadMode && {HOUNDIFY_VAD_MODE: vadMode}),
|
||||||
|
...(vadVoiceMs && {HOUNDIFY_VAD_VOICE_MS: vadVoiceMs}),
|
||||||
|
...(vadSilenceMs && {HOUNDIFY_VAD_SILENCE_MS: vadSilenceMs}),
|
||||||
|
...(vadDebug && {HOUNDIFY_VAD_DEBUG: vadDebug}),
|
||||||
|
...(audioFormat && {HOUNDIFY_AUDIO_FORMAT: audioFormat}),
|
||||||
|
...(enableNoiseReduction && {HOUNDIFY_ENABLE_NOISE_REDUCTION: enableNoiseReduction}),
|
||||||
|
...(enableProfanityFilter && {HOUNDIFY_ENABLE_PROFANITY_FILTER: enableProfanityFilter}),
|
||||||
|
...(enablePunctuation && {HOUNDIFY_ENABLE_PUNCTUATION: enablePunctuation}),
|
||||||
|
...(enableCapitalization && {HOUNDIFY_ENABLE_CAPITALIZATION: enableCapitalization}),
|
||||||
|
...(confidenceThreshold && {HOUNDIFY_CONFIDENCE_THRESHOLD: confidenceThreshold}),
|
||||||
|
...(enableDisfluencyFilter && {HOUNDIFY_ENABLE_DISFLUENCY_FILTER: enableDisfluencyFilter}),
|
||||||
|
...(maxResults && {HOUNDIFY_MAX_RESULTS: maxResults}),
|
||||||
|
...(enableWordTimestamps && {HOUNDIFY_ENABLE_WORD_TIMESTAMPS: enableWordTimestamps}),
|
||||||
|
...(maxAlternatives && {HOUNDIFY_MAX_ALTERNATIVES: maxAlternatives}),
|
||||||
|
...(partialTranscriptInterval && {HOUNDIFY_PARTIAL_TRANSCRIPT_INTERVAL: partialTranscriptInterval}),
|
||||||
|
...(sessionTimeout && {HOUNDIFY_SESSION_TIMEOUT: sessionTimeout}),
|
||||||
|
...(connectionTimeout && {HOUNDIFY_CONNECTION_TIMEOUT: connectionTimeout}),
|
||||||
|
...(latitude && {HOUNDIFY_LATITUDE: latitude}),
|
||||||
|
...(longitude && {HOUNDIFY_LONGITUDE: longitude}),
|
||||||
|
...(city && {HOUNDIFY_CITY: city}),
|
||||||
|
...(state && {HOUNDIFY_STATE: state}),
|
||||||
|
...(country && {HOUNDIFY_COUNTRY: country}),
|
||||||
|
...(timeZone && {HOUNDIFY_TIMEZONE: timeZone}),
|
||||||
|
...(domain && {HOUNDIFY_DOMAIN: domain}),
|
||||||
|
...(audioEndpoint && {HOUNDIFY_AUDIO_ENDPOINT: audioEndpoint}),
|
||||||
|
...(customVocabulary && {HOUNDIFY_CUSTOM_VOCABULARY:
|
||||||
|
Array.isArray(customVocabulary) ? customVocabulary.join(',') : customVocabulary}),
|
||||||
|
...(languageModel && {HOUNDIFY_LANGUAGE_MODEL: languageModel}),
|
||||||
|
};
|
||||||
|
}
|
||||||
else if ('voxist' === vendor) {
|
else if ('voxist' === vendor) {
|
||||||
opts = {
|
opts = {
|
||||||
...opts,
|
...opts,
|
||||||
|
|||||||
9
package-lock.json
generated
9
package-lock.json
generated
@@ -18,7 +18,7 @@
|
|||||||
"@jambonz/speech-utils": "^0.2.25",
|
"@jambonz/speech-utils": "^0.2.25",
|
||||||
"@jambonz/stats-collector": "^0.1.10",
|
"@jambonz/stats-collector": "^0.1.10",
|
||||||
"@jambonz/time-series": "^0.2.14",
|
"@jambonz/time-series": "^0.2.14",
|
||||||
"@jambonz/verb-specifications": "^0.0.116",
|
"@jambonz/verb-specifications": "^0.0.117",
|
||||||
"@modelcontextprotocol/sdk": "^1.9.0",
|
"@modelcontextprotocol/sdk": "^1.9.0",
|
||||||
"@opentelemetry/api": "^1.8.0",
|
"@opentelemetry/api": "^1.8.0",
|
||||||
"@opentelemetry/exporter-jaeger": "^1.23.0",
|
"@opentelemetry/exporter-jaeger": "^1.23.0",
|
||||||
@@ -1521,9 +1521,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@jambonz/verb-specifications": {
|
"node_modules/@jambonz/verb-specifications": {
|
||||||
"version": "0.0.116",
|
"version": "0.0.117",
|
||||||
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.116.tgz",
|
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.117.tgz",
|
||||||
"integrity": "sha512-EFAtwSpSWA12nk7eQfAiWS0bGkCA5+NqKsylnVIXNWuSjRZ5wTS0dAZZZxqtZxPZ1DxdBLCafbLsKZJ4fkC+tQ==",
|
"integrity": "sha512-yfnHWfqVRyE9ICBdVQV8CFwj0jDInpgMYdv9lI5c4iOmnYrJU3e/iFdrwM+abhFyZGL1Can9onynPW6RZFXXsw==",
|
||||||
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
"pino": "^8.8.0"
|
"pino": "^8.8.0"
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
"@jambonz/speech-utils": "^0.2.25",
|
"@jambonz/speech-utils": "^0.2.25",
|
||||||
"@jambonz/stats-collector": "^0.1.10",
|
"@jambonz/stats-collector": "^0.1.10",
|
||||||
"@jambonz/time-series": "^0.2.14",
|
"@jambonz/time-series": "^0.2.14",
|
||||||
"@jambonz/verb-specifications": "^0.0.116",
|
"@jambonz/verb-specifications": "^0.0.117",
|
||||||
"@modelcontextprotocol/sdk": "^1.9.0",
|
"@modelcontextprotocol/sdk": "^1.9.0",
|
||||||
"@opentelemetry/api": "^1.8.0",
|
"@opentelemetry/api": "^1.8.0",
|
||||||
"@opentelemetry/exporter-jaeger": "^1.23.0",
|
"@opentelemetry/exporter-jaeger": "^1.23.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user