Allow users to upload files
Having the ability for users to upload files can be an essential functionality for many AI applications. Whether it's allowing users to upload a report, a contract, or homework, integrating this feature can provide a richer interaction experience. This tutorial will walk you through enabling file uploads in your Stack AI application.
Prerequisites:
Make sure you're logged into Stack AI.
Have a project ready, or create a new project where you'd like to allow file uploads.
Step-by-step Guide:
1. Add a Document Data Loader
To begin the process, you must integrate a mechanism to handle file uploads.
Navigate to the Data Loaders section.
Select the
Document
data loader.
2. Enable User Uploads
Go to the data loader settings.
Inside the Document settings, find the option labeled
expose in interface
.Toggle or check this option to enable it.
3. Publish Your Project
To reflect the changes and make the upload feature active:
Navigate to the project builder.
Click on the
Publish
button or its equivalent. This action will save and deploy your project with the new changes.
4. Exporting Your Project
Export your chatbot or form to make it available on various platforms.
From the builder, click on the
Export
option.Choose whether you want to export as a
Chatbot
or aForm
.
6. Configure Inputs/Outputs
To handle the incoming file data properly, configure the input settings:
In the export configuration, navigate to the
inputs/outputs
section.Here, find the option related to the
document node
.Enable this node as an
input
. This ensures that the chatbot or form can accept file uploads from users.
7. Complete the Remaining Exporting Steps
Follow the additional steps to export the project.
8. Done!
Congratulations! You've now successfully integrated file upload functionality into your chatbot. Test the feature to ensure everything works as expected, and make any necessary adjustments.
Last updated