HowTo: Get credentials from a cloud provider for GeneXusAI

Official Content
This documentation is valid for:

This article aims to explain how can you get the configuration credentials needed for use GeneXusAI.

Step 1 - Access to provider console

Login on your AI provider with your credentials (with previous registration).

Step 2 - Select the AI service

After login, you will redirect to the developer console. Then, from the dashboard, create/enable a new resource for your desired AI task (you can filter services by name). This action usually asks you for a resource name, a region, and other general settings for the service you are creating (such information depends on the provider you use).

Regions supported by provider

Amazon 'US Standard/US East (N. Virginia)' (a.k.a. 'us-east-1')
Baidu 'Beijing'
Google N/A
IBM 'US South' or 'Dallas'
Microsoft  'West US' (except for Video, which uses 'West US 2')
SAP N/A
Tencent N/A

If you do not set the region properly a GXAI5000 error will be raised with an 'Authentication Failed' message

Credentials by task

The following table summarizes which service credentials you need (by name) for each task in GeneXusAI.

    Amazon ML Baidu AI Google Cloud AI IBM Watson MS Cognitive Services  SAP Leonardo Tencent AI
Audio SpeechToText Polly
(key/secret key)
百度语音
(id/key/secret key)
Cloud Speech
(key)
Speech To Text
(key, or username/password)
Bing Speech
(key)
N/A 语音识别
(id/key)
TextToSpeech Transcribe
(key/secret key)
百度语音
(id/key/secret key)
Cloud Speech
(key)
Text To Speech
(key, or username/password)
Bing Speech
(key)
N/A 音合成
(id/key)
Image Classify Rekognition
(key/secret key)
视觉技术
(id/key/secret key)
Cloud Vision
(key)
Visual Recognition
(key)
Computer Vision
(key)
Sandbox
(key)
多标签识别
(id/key)
DetectFaces Rekognition
(key/secret key)
视觉技术
(id/key/secret key)
Cloud Vision
(key)
Visual Recognition
(key)
Computer Vision
(key)
Sandbox
(key)
人脸检测与分析
(id/key)
DetectObjects Rekognition
(key/secret key)
N/A Cloud Vision
(key)
N/A Computer Vision
(key)
N/A 物体识别
(id/key)
DetectScene Rekognition
(key/secret key)
视觉技术
(id/key/secret key)
Cloud Vision
(key)
N/A Computer Vision
(key)
N/A 场景识别
(id/key)
OCR Rekognition
(key/secret key)
视觉技术
(id/key/secret key)
Cloud Vision
(key)
Visual Recognition
(key)
Computer Vision
(key)
Sandbox
(key)
通用OCR
(id/key)
Text DetectLanguage Comprehend
(key/secret key)
通用翻译
(id/secret key)
Cloud Translation
(key)
Language Translator
(key)
Translator Text
(key)
Sandbox
(key)
语种识别
(id/key)
ExtractEntitites Comprehend
(key/secret key)
自然语言
(id/key/secret key)
Cloud Natural Language
(key)
Natural Language Understanding 
(key, or username/password)
Text Analytics
(key)
N/A 专有名词
(id/key)
KeyPhrases Comprehend
(key/secret key)
自然语言
(id/key/secret key)
Cloud Natural Language
(key)
Natural Language Understanding
(key, or username/password)
Text Analytics
(key)
N/A N/A
SentimentAnalysis Comprehend
(key/secret key)
自然语言
(id/key/secret key)
Cloud Natural Language
(key)
Natural Language Understanding
(key, or username/password)
Text Analytics
(key)
N/A 专有名词
(id/key)
Translate Translate
(key/secret key)
通用翻译
(id/secret key)
Cloud Translation
(key)
Language Translator
(key)
Translator Text
(key)
Sandbox
(key)
文本翻译
(id/key)
Text Analyze N/A 视频内容分析
(key/secret key)
Video Intelligence
(key)
N/A Video Indexer
(key/account)
N/A N/A
Process N/A 视频内容分析
(key/secret key)
Video Intelligence
(key)
N/A Video Indexer
(key/account)
N/A N/A
                 

Step 3 - Generate and set the credentials

Once your service has been created, the provider displays you the credentials you need. Then, you simply must copy them and set it on the Provider.Property field.

For example, for a username/password scenario, you write the following code:

&provider = new()

&provider.Name = !"{your_environment_name}"
&provider.Type = ProviderType.[Amazon|Baidu|Google|IBM|Microsoft|SAP|Tencent]

&providerProperty= new()
&providerProperty.key = GeneXusAI.Configuration.PropertyKey.Username
&providerProperty.Value = !"{your_assigned_username}"
&provider.Properties.Add(&providerProperty)

&providerProperty= new()
&providerProperty.key = GeneXusAI.Configuration.PropertyKey.Password
&providerProperty.Value = !"{your_assigned_password}"
&provider.Properties.Add(&providerProperty)
where:  
&provider : Provider, GeneXusAI.Configuration
&providerProperty : Provider.Property, GeneXusAI.Configuration


On the other hand, for a key scenario, you should write the following code:

&provider = new()

&provider.Name = !"{your_environment_name}"
&provider.Type = <your ProviderType>

&providerProperty= new()
&providerProperty.key = PropertyKey.Key
&providerProperty.Value = !"{your_api_key}"
&provider.Properties.Add(&providerProperty)

Usually, this credentials will be located in a "resource management" section (or similar) in case you want to retrieve them again or regenerate them when it is needed.

Step 4 - Execute your AI task

Finally, you will be able to execute your AI task.

Notes

  • For SAP Leonardo, Sandbox key can be retrieved on each API service by the "Show API Key" option and will be the same no matter what service you choose. For such reason, the documentation does not specify which service you should use (e.g. Inference Service for Optical Character Recognition (OCR) if you use GeneXusAI.Image.OCR task) due to the API key will be the same for every service.
  • For MS Cognitive Services, when you create a new resource, ensure to choose 'West U.S.' region, except if you are trying to use Video module. If that is the case, please follow these steps:
    1) Login to Video Indexer portal.
    2) Click on "Connect to Azure" button.
    3.a) Select 'West US 2'.
    3.b) Create a new resource group in case you do not have one.
    3.c) Click on the "Connect" button (this process may take a while).
    4) Get your Account ID for the user you create in step (3).
    5) Go to Product Authorization and authorize the API usage.
    6) Get your API Key from you user profile.
  • For IBM Watson, when you create a new resource, ensure to choose 'US South' region. Those services that allow authentication by username/password are maintained for backward compatibility (new instances will give you a key, not an username/password).
  • For Google Cloud AI, you must create a single project and enable each API you desire to use. Then, on the "Credentials" option, you will able to create an API key for all those APIs you enabled.

Availability

This document applies as of GeneXus 16.

Was this page helpful?
What Is This?
Your feedback about this content is important. Let us know what you think.