add support for session config & cleanup

This commit is contained in:
akirilyuk
2022-02-02 20:19:38 +01:00
parent b9dfecceff
commit baed1b0eac
2 changed files with 48 additions and 48 deletions

View File

@@ -26,11 +26,18 @@ class SpeechConfig extends Emitter {
session
);
}
//this.turnConfig = nextTurn;
this.logger.debug({opts, sessionLevel: this.sessionConfig}, 'SpeechConfig updated');
}
makeGatherTaskConfig({textPrompt, urlPrompt, turnConfig} = {}) {
makeSayTaskConfig({text, turnConfig = {}} = {}) {
const synthesizer = lodash.merge({}, this.sessionConfig.synthesizer, turnConfig);
return {
text,
synthesizer
};
}
makeGatherTaskConfig({textPrompt, urlPrompt, turnConfig = {}} = {}) {
// we merge from top to bottom deeply so we wil have
// defaults from session config and then will override them via turn config
const opts = lodash.merge(