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

Google N/A
IBM 'US South' or 'Dallas'
Microsoft  'West US' (except for Video, which uses 'West US 2')
SAP 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.

    Google Cloud AI IBM Watson MS Cognitive Services  SAP Leonardo
Audio SpeechToText Cloud Speech
(key)
Speech To Text
(username/password or key)
Bing Speech
(key)
N/A
TextToSpeech Cloud Speech
(key)
Text To Speech
(username/password or key)
Bing Speech
(key)
N/A
Image Classify Cloud Vision
(key)
Visual Recognition
(key)
Computer Vision
(key)
Sandbox
(key)
DetectFaces Cloud Vision
(key)
Visual Recognition
(key)
Computer Vision
(key)
Sandbox
(key)
DetectObjects Cloud Vision
(key)
N/A Computer Vision
(key)
N/A
DetectScene Cloud Vision
(key)
N/A Computer Vision
(key)
N/A
OCR Cloud Vision
(key)
Visual Recognition
(key)
Computer Vision
(key)
Sandbox
(key)
Text DetectLanguage Cloud Translation
(key)
Language Translator
(key)
Translator Text
(key)
Sandbox
(key)
ExtractEntitites Cloud Natural Language
(key)
Natural Language Understanding 
(username/password or key)
Text Analytics
(key)
N/A
KeyPhrases Cloud Natural Language
(key)
Natural Language Understanding
(username/password or key)
Text Analytics
(key)
N/A
SentimentAnalysis Cloud Natural Language
(key)
Natural Language Understanding
(username/password or key)
Text Analytics
(key)
N/A
Translate Cloud Translation
(key)
Language Translator
(key)
Translator Text
(key)
Sandbox
(key)
Text Analyze Video Intelligence
(key)
N/A Video Indexer
(key/account)
N/A
Process Video Intelligence
(key)
N/A Video Indexer
(key/account)
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.
  • 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.