New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bespoken-batch-tester

Package Overview
Dependencies
Maintainers
4
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bespoken-batch-tester - npm Package Compare versions

Comparing version

to
0.10.1

4

package.json
{
"author": "Bespoken",
"bin": {
"bbt": "./bin/bbt.js"
"bbt": "bin/bbt.js"
},

@@ -62,3 +62,3 @@ "description": "This project tests utterances in batch - supporting a variety of data sources and reporting formats",

"standard": {},
"version": "0.10.0"
"version": "0.10.1"
}

@@ -83,2 +83,4 @@ # **Bespoken Batch Tester**

| device | No | The device value corresponds to the tag set on the device. If this value matches a tag, that device will be eligible to process this utterance.
| locale | No | The locale to use for this record. If not set, defaults to 'en-US'
| voiceID | No | The voice ID to use for this record. If not set, defaults to 'en-US-Wavenet-D'
| [expected values] | No | There can zero-to-many expected fields defined - these will automatically be compared to fields on the JSON output

@@ -85,0 +87,0 @@

@@ -39,2 +39,10 @@ const Config = require('./config')

if (r.locale) {
record.locale = r.locale
}
if (r.voiceID) {
record.voiceID = r.voiceID
}
// Add device tags automatically from the column labeled device

@@ -48,6 +56,13 @@ const deviceProperty = Object.keys(r).find(property => property.trim().toLowerCase() === 'device')

Object.keys(r).forEach(field => {
if (field.trim().toLowerCase() === 'utterance' || field.trim().toLowerCase() === 'device') {
if (field.trim().toLowerCase() === 'utterance' ||
field.trim().toLowerCase() === 'device') {
return
}
// Add locale and voice id as output fields
if (field.trim().toLowerCase() === 'locale' ||
field.trim().toLowerCase() === 'voiceid') {
record.addOutputField(field, r[field])
return
}
record.addExpectedField(field, r[field])

@@ -54,0 +69,0 @@ })

@@ -17,3 +17,3 @@ const _ = require('lodash')

async message (record, messages, attempt = 1) {
console.log('DEVICE MESSAGE ' + messages.toString())
console.info('DEVICE MESSAGE ' + messages.toString() + ' locale: ' + record.locale + ' voice: ' + record.voiceID)
const voiceID = record.voiceID || Config.get('virtualDeviceConfig.voiceID', undefined, false, 'en-US-Wavenet-D')

@@ -20,0 +20,0 @@ const locale = record.locale || Config.get('virtualDeviceConfig.locale', undefined, false, 'en-US')

@@ -119,2 +119,4 @@ const _ = require('lodash')

this._conversationId = undefined
this._locale = undefined
this._voiceID = undefined
this._rerun = false

@@ -201,2 +203,17 @@ }

/**
* Getter and setter for the locale
* @type {string}
*/
get locale () {
return this._locale
}
/**
* @private
*/
set locale (locale) {
this._locale = locale
}
/**
* Whether this record is being rerun

@@ -235,3 +252,18 @@ * @type {boolean}

}
/**
* Getter and setter for the utterance
* @type {string}
*/
get voiceID () {
return this._voiceID
}
/**
* @private
*/
set voiceID (voiceID) {
this._voiceID = voiceID
}
}
module.exports = { Source, Record }