Official Content

GeneXusAI is an installable module that aims to simplify the integration of cognitive services most common capabilities in GeneXus.

What do you have to do to include these tasks?

You have to install GeneXusAI module from the Manage Module References dialog on the Knowledge Manager option (located in the toolbar of GeneXus IDE). Once you installed it, you must configure your desired provider and set the appropriate properties for each task (credentials, deployment information, optional parameters, etc.).

Which providers are supported?

Supported providers are:

For detailed information, refer to the backlog in GeneXus Cognitive API - Release notes article.

Which AI tasks are available?

GeneXusAI is structured as follows. Each submodule has specific procedures, domains, and structured data types that allow you to integrate your desired task.

GeneXusAI
├── Configuration
├── Audio
│   ├── SpeechToText
│   └── TextToSpeech
├── Custom
│   ├── Check
│   ├── Delete
│   ├── Deploy
│   ├── Evaluate
│   ├── Predict
│   └── Train
├── Image
│   ├── Classify    ├── DetectFaces   ├── DetectObjects
│   ├── DetectScene   └── OCR
├── Text
│   ├── DetectLanguage
│   ├── ExtractEntitites
│   ├── KeyPhrases
│   ├── SentimentAnalysis
│   └── Translate
└── Video
    ├── Analyze
    └── Process

The availability of a service depends on the provider you chose (summarized in the following table), as well as its pricing, accuracy, and performance. Some empirical tests for these last two features are described on the documentation for each task. Pricing must be consulted on the provider's website.

GeneXus AI   Cloud-based
providers
  On-device
providers
Module Task   Amazon Google IBM Microsoft   MLKit CoreML
Audio SpeechToText    
TextToSpeech    
Custom Check    
Delete    
  Deploy    
  Evaluate    
  Predict   v  
  Train    
Image Classify    
DetectFaces    
DetectObjects    
DetectScene    
OCR    
Text DetectLanguage    
ExtractEntitites    
KeyPhrases    
SentimentAnalysis    
Translate    
Video Analyze    
Process    
                   

Reference:
+ : Available
+ –: Not provided
+ : Work in progress
+⚠: Deprecated/Decommissioned

What if you want to use another service that is not provided?

GeneXusAI offers the most common set of functionalities available to most providers. Specific services, for a particular provider, must be developed by hand.

For cloud-based providers, you can consume the ReST service by using HttpClient data type, or using the OpenAPI import tool when the provider exposes a Swagger descriptor (either in YAML or JSON), or even by creating an Native Object that wraps the provider's library. This last alternative is the one you must use for device-inference providers, which must be implemented by the Extension Library concept.

What do you have to do to set up a specific provider?

You must fully set the &provider input parameter before calling any procedure (the AI task) with the required properties for the provider you've chosen.

For example, if you want to use GeneXus Cognitive API - DetectFaces procedure with Microsoft Azure Cognitive Services, you should write something like this:

// Instanciate the provider. In this case, Microsoft.
&provider = new() 
&provider.Name = "my-microsoft-face-recognition-instance-1"
&provider.Type = ProviderType.Microsoft

// Add the required properties. In this case, the API-Key provided by Microsoft.
&providerProperty = new()
&providerProperty.key   = PropertyKey.Key
&providerProperty.Value = !"{your_microsoft_visual_recognition_key}"
&provider.Properties.Add(&providerProperty)

// Call to GeneXusAI's procedure and get the result.
&regions = GeneXusAI.Image.DetectFaces(&image, &provider, &messages)


You can reuse the &provider definition for multiple services when they share the credentials. If you add duplicated properties, GeneXusAI will always consider the last one you added.

Note: Each procedure (or AI task) of GeneXusAI will have specific requirements, especially in terms of service authentication credentials (read HowTo: Get credentials from a cloud provider for GeneXus Cognitive API). Detailed information can be found on the procedure's documentation you want to use.

Can you build a custom model in GenexusAI?

Yes. Refer to HowTo: Build a custom model for GeneXus Cognitive API.

Why should you use GenexusAI?

First of all, GeneXusAI encapsulates the complexity of learning specific solutions. You just only need to call a GeneXus's Procedure object with the required parameters, and that's all.

Maintenance is not a problem. You don't have to worry about being outdated. You just should update GeneXusAI module when you want or when it is needed.

On the other hand, imagine you already have developed a system that integrates AI in your solution, but some time later you realize that the service does not satisfy your requirements (e.g. in terms of cost, performance, etc.). If you were not using GeneXusAI, you should redesign your system (rewrite API-calls, create new structures or modify preexisting one, etc.). When you use GeneXusAI the only thing you do is to redefine your &provider input parameter with a new setting for the provider you chose.

Finally, GeneXusAI allows you to use multiple providers by defining multiple &provider instances for each provider you want to use. Then, for example, you can use GeneXus Cognitive API - DetectFaces procedure with Microsoft, GeneXus Cognitive API - Classify procedure with IBM and GeneXus Cognitive API - Translate procedure with Google. In this way, you can find the best balance between cost, performance, and accuracy; both for your users, your system and your business.

Scope

Last update: April 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant