new(whatsapp.gblib): New provider.
This commit is contained in:
parent
49056e9f76
commit
78107274d0
2 changed files with 9 additions and 7 deletions
|
@ -724,7 +724,7 @@ export class KBService implements IGBKBService {
|
|||
await this.undeployPackageFromStorage(instance, packageId);
|
||||
}
|
||||
|
||||
public static async RefreshNER(min: GBMinInstance) {
|
||||
public static async RefreshNER(min: GBMinInstance) {
|
||||
const questions = await KBService.getQuestionsNER(min.instance.instanceId);
|
||||
const contentLocale = min.core.getParam<string>(
|
||||
min.instance,
|
||||
|
@ -735,12 +735,15 @@ export class KBService implements IGBKBService {
|
|||
await CollectionUtil.asyncForEach(questions, async question => {
|
||||
const text = question.content;
|
||||
|
||||
let category = /.*\((.*)\).*/gi.exec(text)[1];
|
||||
let name =/(\w+)\(.*\).*/gi.exec(text)[1];
|
||||
|
||||
min["nerEngine"].addNamedEntityText(category, name,
|
||||
[contentLocale], [name]);
|
||||
const categoryReg = /.*\((.*)\).*/gi.exec(text);
|
||||
const nameReg = /(\w+)\(.*\).*/gi.exec(text);
|
||||
|
||||
if (categoryReg && nameReg) {
|
||||
let category = [1];
|
||||
let name = [1];
|
||||
min["nerEngine"].addNamedEntityText(category, name,
|
||||
[contentLocale], [name]);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -133,7 +133,6 @@ export class WhatsappDirectLine extends GBService {
|
|||
let productId = this.whatsappServiceNumber.split(';')[1]
|
||||
|
||||
let url = `${this.INSTANCE_URL}/${productId}/setWebhook`;
|
||||
let webhook = `${GBServer.globals.publicAddress}/webhooks/whatsapp`;
|
||||
WhatsappDirectLine.phones[phoneId] = this.botId;
|
||||
|
||||
options = {
|
||||
|
|
Loading…
Add table
Reference in a new issue