mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-21 17:17:58 +00:00
fix setting initial config
This commit is contained in:
@@ -7,9 +7,6 @@ const stripNulls = (obj) => {
|
||||
return obj;
|
||||
};
|
||||
|
||||
|
||||
const defaultSpeechConfig
|
||||
|
||||
class SpeechConfig extends Emitter {
|
||||
constructor({logger, ep, opts = {}}) {
|
||||
super();
|
||||
@@ -19,16 +16,16 @@ class SpeechConfig extends Emitter {
|
||||
this.update(opts);
|
||||
}
|
||||
|
||||
_mergeConfig(changedConfig = {}){
|
||||
_mergeConfig(changedConfig = {}) {
|
||||
const merged = lodash.merge(
|
||||
{},
|
||||
this.sessionConfig,
|
||||
changedConfig
|
||||
);
|
||||
merged.bargein.enable = changedConfig.bargein?.enable?.length === 0 ? [] : changedConfig.bargein?.enable;
|
||||
this.logger.debug({merged, sessionConfig: this.sessionConfig, changedConfig}, 'merged config');
|
||||
// should we override hints with empty array or leave it as it is once saved?
|
||||
// merged.recognizer.hints = changedConfig.recognizer?.hints
|
||||
{},
|
||||
this.sessionConfig,
|
||||
changedConfig
|
||||
);
|
||||
merged.bargein.enable = changedConfig.bargein?.enable?.length === 0 ? [] : changedConfig.bargein?.enable;
|
||||
this.logger.debug({merged, sessionConfig: this.sessionConfig, changedConfig}, 'merged config');
|
||||
// should we override hints with empty array or leave it as it is once saved?
|
||||
// merged.recognizer.hints = changedConfig.recognizer?.hints
|
||||
}
|
||||
|
||||
update(session) {
|
||||
|
||||
Reference in New Issue
Block a user