Modalities integration
From start to finish, set up a chat-based application with custom modalities with NLX
What's a Modality?
A modality allows for information to be transmitted to a user that goes beyond a standard message. Images, audio, structured text, haptic signals, videos, and more can be modalities you may want to provide users during conversation.
Checklist
You'll complete the following to successfully use a custom modality:
You may add the following to an existing chat application in your workspace, if desired.
Pre-setup: Integrations
Est. time to complete: ~5 minutes
A one-time integration of a Natural Language Processing (NLP) engine must be completed in your workspace:
Step 1: Set up a modality
Est. time to complete: ~1 minute
Select Resources from workspace menu > Choose Modalities
Select + Add modality
Enter "Video" as the name name
Select Schema and change the Type to Object
Select Properties and then + Add property
Enter "src" as the Field name
Click Create modality
Step 2: Link to a flow node
Est. time to complete: ~1 minute
You'll now enable the video modality you created on an end node (user-type node or node at the end of a flow), and provide it with a video URL.
Select Intents from workspace menu > Create or choose an existing intent
Create a new flow card or select one with the API channel set as channel > Click on any end node
Select Add functionality > Choose Modalities
Toggle the Enable on
Enter
dQw4w9WgXcQ
as the value for "src"Click Save
Repeat for any other intent flows where you would like to enable your modality.
🧠 Looking for more? See Construct flows
Step 3: Set up & deploy application
Est. time to complete: ~10 minutes
Select Applications from workspace menu > Choose New application
Enter a descriptive name > Click Save
Click Intents tab of application > Select + Add intents > Attach one or more intents you've created to make available to your application
Select Default behaviors tab of application > Assign any attached intents to the application's behaviors > Click Save
Select Channels tab of application > Expand API option > Click + Create channel
Click + Add domain under Whitelisted domains > Add your webpage's URL and https://developers.nlx.ai
Click Create channel
Click Deployment tab of application > Select Create or Review & build
Wait for validation to complete > Select Create build*
When satisfied with a successful build, click Deploy
*After a build status appears as 🟢 Built, you may use the Test feature to test the conversation with your application using the latest build.
🔧 Need to troubleshoot your build? See how to troubleshoot build errors
Step 4: Set up a webpage
Est. time to complete: ~10 minutes
Using the NLX Chat SDK, you can quickly build an HTML page to test out your video modality. You'll need to copy the application URL and API key from the application's Deployment tab.
Resuming from Step 3, click on the Details link next to the Deployed status
Under Setup instructions, expand the API row
Copy the Application URL and API key
Copy the HTML file below and replace
REPLACE_WITH_APPLICATION_URL
andREPLACE_WITH_API_KEY
with the values you just copiedSave the HTML file you just edited and serve the HTML file with your preferred command line tool such as serve
Step 5: Test the modality
To test the modality, either host your HTML file or serve it locally using a command line tool like serve.
Once you can access the page, click on the chat widget at the bottom right of the page and converse with your application until you reach the node in the conversation where you set the modality.
Last updated