mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 16:50:39 +00:00
wip
This commit is contained in:
@@ -15,8 +15,7 @@ class Dialogflow extends Task {
|
||||
this.agent = this.data.agent;
|
||||
this.region = this.data.region || 'default';
|
||||
this.model = this.data.model || 'es';
|
||||
this.cmd = this.model === 'cx' ? 'dialogflow_cx_start' : 'dialogflow_start';
|
||||
this.cmdStop = this.model === 'cx' ? 'dialogflow_cx_stop' : 'dialogflow_stop';
|
||||
this.queryInput = this.data.queryInput || {};
|
||||
|
||||
assert(this.agent || !this.isCX, 'agent is required for dialogflow cx');
|
||||
assert(this.credentials, 'dialogflow credentials are required');
|
||||
@@ -76,6 +75,9 @@ class Dialogflow extends Task {
|
||||
this.fallbackLabel = this.data.tts.fallbackLabel;
|
||||
}
|
||||
this.bargein = this.data.bargein;
|
||||
|
||||
this.cmd = this.model === 'cx' ? 'dialogflow_cx_start' : 'dialogflow_start';
|
||||
this.cmdStop = this.model === 'cx' ? 'dialogflow_cx_stop' : 'dialogflow_stop';
|
||||
}
|
||||
|
||||
get name() { return TaskName.Dialogflow; }
|
||||
@@ -184,10 +186,10 @@ class Dialogflow extends Task {
|
||||
this.environment,
|
||||
this.lang,
|
||||
];
|
||||
if (this.welcomeEvent) {
|
||||
baseArgs.push(this.welcomeEvent);
|
||||
if (Object.keys(this.queryInput).length > 0) {
|
||||
baseArgs.push(`'${JSON.stringify(this.queryInput)}'`);
|
||||
}
|
||||
await this.ep.api(this.cmd, `${baseArgs.join(' ')}`)
|
||||
await this.ep.api(this.cmd, `${baseArgs.join(' ')}`);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user