In order to use a transformer function, one has to follow a few steps in the Help Center and Cognigy.AI. Since there are two different types of transformer functions in Cognigy.AI, namely Endpoint and NLU, this guide is separated into two parts.
Install an Endpoint Transformer
- Open the Transformers Overview page
- Click on Download for the wanted Endpoint Transformer:
Import / Upload Transformer to Cognigy.AI Endpoint
- Open the recently downloaded transformer function in a preferred text editor (e.g. Visual Studio Code)
- Optional: Adjust the code for your needs
- Copy the entire code to the clipboard (STRG + A -> STRG + C)
- Login to Cognigy.AI
- Navigate to
Deploy -> Endpoints -> Your Endpoint
- In this case, we use a REST Endpoint for WhatsApp
- Scroll down to the Transformer Functions section and open it
- Now paste the previously copied code into the black code field:
Transformer Settings
Based on the used functions in the transformer, one needs to enable various Transformer Settings:
- Abort on Error in Transformer
- Enable this, if the code should abort the execution when an error occurs
- Enable Input Transformer
- Enable this, if the
handleInput()
function is filled with custom code
- Enable this, if the
- Enable Output Transformer
- Enable this, if the
handleOutput()
function is filled with custom code
- Enable this, if the
- Enable Execution Finished Transformer
- Enable this, if the
executionFinished()
function is filled with custom code
- Enable this, if the
After pasting and enabling the required functions, the Endpoint Transformer can be used. In this example case, one could use Tyntec in order to provide WhatsApp as a channel. Please find more information about WhatsApp here.
Install an NLU Transformer
- Open the Transformers Overview page
- Click on Download for the wanted NLU Transformer:
Import / Upload Transformer to Cognigy.AI Endpoint
- Open the recently downloaded transformer function in a preferred text editor (e.g. Visual Studio Code)
- Optional: Adjust the code for your needs
- Copy the entire code to the clipboard (STRG + A -> STRG + C)
- Login to Cognigy.AI
- Navigate to
Deploy -> Build-> NLU Connectors
- In this case, we use a REST Endpoint for WhatsApp#
- Create a new Code NLU Connector:
- Click on the recently created NLU Connector
- Expand the Transformer Functions section
- Now paste the previously copied code into the black code field:
Transformer Settings
Based on the used functions in the transformer, one needs to enable various Transformer Settings:
- Abort on Error in Transformer
- Enable this, if the code should abort the execution when an error occurs
- Enable Code Transformer
- Enable this, if the
handleInput()
function is filled with custom code
- Enable this, if the
- Debug Transformer Stack
- Enable this, if the transformer stack should be exposed to the interaction panel (Test Chat)
After pasting and enabling the required functions, the NLUTransformer can be used.
Comments
0 comments