In this article, you can find some frequently asked questions (FAQ) as well as some common troubleshooting regarding GeneXusAI.
You can set the User Log level property and the Log output property to see messages logged by the GeneXus Cognitive API.
Cloud providers usually have online demos on their official websites where you can test their services before using them. Also, every cloud provider has a section for pricing then you can compare the convenience of using one provider or another.
It is highly recommended to upgrade your GeneXusAI Module to be consistent with your GeneXus upgrade. GeneXusAI uses components from the GeneXus Core module and other built-in functionalities that may change between upgrades. In order to upgrade your GeneXusAI module navigate from Knowledge Manager > Manage Module References, select GeneXusAI from the list and click on the Update button (make sure you have the last version selected on the combo-box on the right dialog).
You can open a thread in our Technical Forum and our team will be pleased to help you. Describe how can we reproduce your problem with much detail as possible (code, expected result, comparative using other tools, etc.) and include any required file (e.g. images, audio, etc). It will be very helpful if you provide an XPZ file ready to reproduce.
Also, feel free to contact our support team.
Cause: |
Probably, you are working on GeneXus 16 Release (Upgrade 0). In this version, you can not call an AI task with a local file (e.g. by using Camera.TakePhoto(), PhotoGallery.ChooseImage(), or AudioRecorder.Stop() for Smart Devices, or FileUpload control for Web). This action will produce an error as follows:
.NET: Unable to cast object of type 'System.Net.FileWebRequest' to type 'System.Net.HttpWebRequest'
Java: An error occurred on the application server (404 - ) |
Solution: |
You must send the local file to the server and use a reference to it. See SAC#44045 for detailed information and solution. |
Cause: |
GeneXusAI, in its early versions, uses the default models for each provider and may return different results depending on the language (or other input features). |
Solution: |
There is no solution until the external provider improves its default models or until GeneXusAI provides facilities for adding custom models. If you have doubts about selecting a provider, you can search for an online demo and test them before you use them. For example, if you are testing SentimentAnalysis, KeyPhrases and ExtractEntities tasks of GeneXusAI, you can test the online demo of Microsoft Text Analytics service. |
Cause: |
You are providing a local URL (on 'localhost' or '10.0.2.2') that the external provider cannot access (e.g. for sending you a notification once a video has been processed). |
Solution: |
Deploy your application to a server that can be accessed from the Internet in order AI provider can execute the callback to your application, e.g. deploy your app to the cloud, this solution provides an appropriate environment for prototyping it (hosted on apps5.genexus.com or apps6.genexus.com). |
Cause: |
There is a problem trying to authorize the request made by the GeneXus Cognitive API.
Some well-known causes:
1) |
You did not set your provider service credentials properly |
2) |
You are using .NET Core generator in GeneXus16 Release (Upgrade 0) with a provider that requires username/password, but this authentication mechanism is not supported in that version. |
3) |
You are using the GeneXus Cognitive API with IBM from different machines and the same access credentials. In this scenario, IBM responses with HTTP 403 error code because it expects every request is made from a unique machine. |
4) |
You are using the GeneXus Cognitive API from a mobile application (specifically, Audio, Image or Video submodules) and you have an authorization layer on the server-side (e.g. GAM) that denies uploading multimedia files in your server. |
|
Solution: |
For the well-known causes:
1) |
You must provide the credentials given by the provider portal for the specific service you are using (not your access account credentials, neither any type of credentials -- it must be the specific service credentials). Refer to HowTo: Get credentials from a cloud provider for GeneXus Cognitive API for more information. |
2) |
Migrate your Knowledge Base to GeneXus 16 Upgrade 1. |
3) |
Use your access credentials from a unique machine. Otherwise, create as many access credentials as machines are you using (e.g. credentials for development and production). |
4) |
Consider adding an authentication/authorization layer on your mobile app or upload the media you are trying to use with the Audio, Image or Video submodule's task, get its URL and then call the task specifying the media with its URL instead of the local file path. |
|
Cause: |
Your provider deprecated a service used by some GeneXus Cognitive API's task.
The error message could be an HTTP 500 error code response from your provider or a GXAI5100 error code with a "Deprecated" message indicating this situation.
Examples:
1) |
IBM's Visual Recognition service decommissioned as of September 2019. |
|
Tasks affected: OCR, DetectFaces. |
2) |
SAP Leonardo services decommissioned as of June 2020 (deprecated as of August 2019). |
|
Tasks affected: All. |
|
Solution: |
If there is a replacement for the deprecated service, try to update your GeneXusAI module. Otherwise, since it is a deprecated feature by your provider, you must switch to another provider in order to use the affected tasks. |
Cause: |
The web app cannot read your local file. The most common case is when you reference your service-account.json file when using the Custom module with Google as a provider. |
Solution: |
Copy your local file into the web app directory and update your provider's property with the new file path if that's the case. |
Cause: |
You are using a provider that requires signing certificates for authorization (e.g. Google). |
Solution: |
You must install OpenSSL command-line tool in your environment (Windows/Linux) and ensure it is accessible by command-line.
Try typing the following in your command-line console.
> openssl version |
Cause: |
As of May 26 (2021), IBM updates every entry-point service URL (source: Watson Endpoint Change) and this error may occur if you are using an API-Key to access their services. |
Solution: |
Follow the instructions on Watson Endpoint Change article in order to get new credentials. You will see that credentials are provided as a JSON-string. Finally, you must update the way you are populating the &provider variable (based on Provider data type). This method only works since GeneXus 17 upgrade 1 (GeneXusAI 2.3.1).
For instance, if you have something like this:
&provider = new()
&privider.Name = !"{instance-name}"
&privider.Type = ProviderType.IBM
&property = new()
&property.Key = PropertyKey.Key
&provider.Value = !"{API-key}"
&provider.Properties.Add(&property)
You must update it for something like this:
&provider = new()
&privider.Name = !"{instance-name}"
&privider.Type = ProviderType.IBM
&property = new()
&property.Key = PropertyKey.Key
&provider.Value = !"{JSON-string}" // use the JSON-string credential instead
&provider.Properties.Add(&property)
Also, you can save your JSON-string into a file (avoid hardcoding it) and update it for something like this:
&provider = new()
&privider.Name = !"{instance-name}"
&privider.Type = ProviderType.IBM
&property = new()
&property.Key = PropertyKey.Key
&provider.Value = !"{JSON-file}" // use the JSON-file with the JSON-string credential instead
&provider.Properties.Add(&property)
|
In case the error persists, look for genexusai.tok file in your webapp directory and delete every entry associated with IBM. It may occur that the token expiration date is higher than May 26 (2021) when the watsonplatform.net entry-point was shut down.