From 942c941e1a2512c640d65e719954120ad213c739 Mon Sep 17 00:00:00 2001 From: Rodrigo Rodriguez Date: Wed, 24 Nov 2021 09:45:02 -0300 Subject: [PATCH] new(basic.gblib): HEAR in Teams will get pictures into URL. --- packages/basic.gblib/services/SystemKeywords.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/basic.gblib/services/SystemKeywords.ts b/packages/basic.gblib/services/SystemKeywords.ts index 30abeb6c..35a13fa2 100644 --- a/packages/basic.gblib/services/SystemKeywords.ts +++ b/packages/basic.gblib/services/SystemKeywords.ts @@ -92,8 +92,21 @@ export class SystemKeywords { new ApiKeyCredentials({ inHeader: { 'Ocp-Apim-Subscription-Key': process.env.VISION_KEY } }), process.env.VISION_ENDPOINT); - const caption = (await computerVisionClient.describeImage(url)).captions[0]; + let caption = (await computerVisionClient.describeImage(url)).captions[0]; + + const contentLocale = this.min.core.getParam( + this.min.instance, + 'Default Content Language', + GBConfigService.get('DEFAULT_CONTENT_LANGUAGE') + ); GBLog.info(`GBVision (caption): '${caption.text}' (Confidence: ${caption.confidence.toFixed(2)})`); + + caption = await this.min.conversationalService.translate( + this.min, + caption, + contentLocale + ); + return caption.text; }