GeneXusAI is an installable module that aims to simplify the integration of cognitive services most common capabilities in GeneXus.
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.).
Supported providers are:
For detailed information, refer to the backlog in GeneXus Cognitive API - Release notes article.
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.
Reference:
+ ✓: Available
+ –: Not provided
+ ⧖: Work in progress
+⚠: Deprecated/Decommissioned
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.
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.
®ions = 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.
Yes. Refer to HowTo: Build a custom model for GeneXus Cognitive API.
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.