new(basic.gblib): HEAR in Teams will get pictures into URL.

This commit is contained in:
Rodrigo Rodriguez 2021-11-24 09:45:02 -03:00
parent 4368fe447b
commit 942c941e1a

View file

@ -92,8 +92,21 @@ export class SystemKeywords {
new ApiKeyCredentials({ inHeader: { 'Ocp-Apim-Subscription-Key': process.env.VISION_KEY } }), new ApiKeyCredentials({ inHeader: { 'Ocp-Apim-Subscription-Key': process.env.VISION_KEY } }),
process.env.VISION_ENDPOINT); 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<string>(
this.min.instance,
'Default Content Language',
GBConfigService.get('DEFAULT_CONTENT_LANGUAGE')
);
GBLog.info(`GBVision (caption): '${caption.text}' (Confidence: ${caption.confidence.toFixed(2)})`); GBLog.info(`GBVision (caption): '${caption.text}' (Confidence: ${caption.confidence.toFixed(2)})`);
caption = await this.min.conversationalService.translate(
this.min,
caption,
contentLocale
);
return caption.text; return caption.text;
} }