diff --git a/packages/core.gbapp/services/GBConversationalService.ts b/packages/core.gbapp/services/GBConversationalService.ts index c2e5d75d..735f8225 100644 --- a/packages/core.gbapp/services/GBConversationalService.ts +++ b/packages/core.gbapp/services/GBConversationalService.ts @@ -341,7 +341,6 @@ export class GBConversationalService { } public async sendEvent(min: GBMinInstance, step: GBDialogStep, name: string, value: Object): Promise { - if (step.context.activity.channelId !== 'msteams' && step.context.activity.channelId !== 'omnichannel') { GBLogEx.info( min, @@ -642,30 +641,32 @@ export class GBConversationalService { }); } - public async fillAndBroadcastTemplate(min: GBMinInstance, template, mobile: string, text) { - - template = template.replace(/\-/gi, '_') - template = template.replace(/\./gi, '_') + template = template.replace(/\-/gi, '_'); + template = template.replace(/\./gi, '_'); let isMedia = text.toLowerCase().endsWith('.jpg') || text.toLowerCase().endsWith('.jpeg') || - text.toLowerCase().endsWith('.png'); + text.toLowerCase().endsWith('.png') || + text.toLowerCase().endsWith('.mp4') || + text.toLowerCase().endsWith('.mov'); - let image = !isMedia ? /(.*)\n/gim.exec(text)[0].trim() : text; + let mediaFile = !isMedia ? /(.*)\n/gim.exec(text)[0].trim() : text; const gbaiName = DialogKeywords.getGBAIPath(min.botId); - const fileUrl = urlJoin(process.env.BOT_URL, 'kb', gbaiName, `${min.botId}.gbkb`, 'images', image); + const fileUrl = urlJoin(process.env.BOT_URL, 'kb', gbaiName, `${min.botId}.gbkb`, 'media', mediaFile); - let urlImage = image.startsWith('http') ? image : fileUrl; + let urlMedia = mediaFile.startsWith('http') ? mediaFile : fileUrl; if (!isMedia) { - text = text.substring(image.length + 1).trim(); + text = text.substring(mediaFile.length + 1).trim(); text = text.replace(/\n/g, '\\n'); } - template = isMedia ? image.replace(/\.[^/.]+$/, '') : template; + template = isMedia ? mediaFile.replace(/\.[^/.]+$/, '') : template; + + let mediaType = text.toLowerCase().endsWith('.mp4') || text.toLowerCase().endsWith('.mov') ? 'video' : 'image'; let data: any = { name: template, @@ -674,9 +675,9 @@ export class GBConversationalService { type: 'header', parameters: [ { - type: 'image', - image: { - link: urlImage + type: mediaType, + media: { + link: urlMedia } } ] @@ -685,8 +686,9 @@ export class GBConversationalService { }; await this.sendToMobile(min, mobile, data, null); - GBLogEx.info(min, `Sending answer file to mobile: ${mobile}. Header: ${urlImage}`); + GBLogEx.info(min, `Sending answer file to mobile: ${mobile}. Header: ${urlMedia}`); } + // tslint:enable:no-unsafe-any public async sendMarkdownToMobile(min: GBMinInstance, step: GBDialogStep, mobile: string, text: string) { diff --git a/templates/marketing.gbai/marketing.gbdialog/poster.bas b/templates/marketing.gbai/marketing.gbdialog/poster.bas index 025e05cc..875ec99b 100644 --- a/templates/marketing.gbai/marketing.gbdialog/poster.bas +++ b/templates/marketing.gbai/marketing.gbdialog/poster.bas @@ -16,5 +16,5 @@ POST TO INSTAGRAM username, password, image, caption # Postar no Facebook POST TO FACEBOOK username, password, image, caption -# Postar no Twitter -TWEET username, password, image, caption +# Postar no BlueSky +BLUESKY username, password, image, caption diff --git a/templates/talk-to-data.gbai/talk-to-data.gbialog/start.bas b/templates/talk-to-data.gbai/talk-to-data.gbialog/start.bas deleted file mode 100644 index cbbb7d05..00000000 --- a/templates/talk-to-data.gbai/talk-to-data.gbialog/start.bas +++ /dev/null @@ -1,10 +0,0 @@ - -data = FIND "products.csv" -BEGIN SYSTEM PROMPT -Engage users effectively as if you're a sales assistant in the virtual store. -Begin by welcoming them warmly and encouraging them to explore our range of products. - Provide clear instructions on how to inquire about specific items or browse - categories. Ensure the tone is friendly, helpful, and inviting to encourage - interaction. Use prompts to guide users through the purchasing process and offer - assistance whenever needed. Offer them this products: ${ TOJSON (data) } -END SYSTEM PROMPT \ No newline at end of file diff --git a/templates/talk-to-data.gbai/talk-to-data.gbot/config.csv b/templates/talk-to-data.gbai/talk-to-data.gbot/config.csv index 8eb084de..eb1e3b88 100644 --- a/templates/talk-to-data.gbai/talk-to-data.gbot/config.csv +++ b/templates/talk-to-data.gbai/talk-to-data.gbot/config.csv @@ -1,4 +1,4 @@ -name,value -Answer Mode,chart -llm File,northwind.db -llm Driver,sqlite \ No newline at end of file + name,value + Answer Mode,sql + llm File,northwind.db + llm Driver,sqlite \ No newline at end of file