new(whatsapp.gblib): New provider.

This commit is contained in:
Rodrigo Rodriguez 2022-06-12 18:43:19 -03:00
parent 49056e9f76
commit 78107274d0
2 changed files with 9 additions and 7 deletions

View file

@ -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]);
}
});

View file

@ -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 = {