This topic describes how to configure and use the file upload feature in an AI assistant to process file content more efficiently.
Prerequisites
You have created an AI assistant and completed the web page integration. For more information, see Create an AI assistant.
Procedure
Step 1: Obtain the workspace ID
Obtain the workspace ID from Alibaba Cloud Model Studio. This topic uses llm-7c72iiw36kd8**** as an example.
Step 2: Configure file upload in AppFlow
To use the file upload feature, you must import a model that supports file processing into your AI assistant. This topic uses the Qwen-VL model from Alibaba Cloud Model Studio as an example. For more information about other available models, see Select a model.
-
Go to the AppFlow-AI Assistant page and select your target AI assistant.
-
On the AI Assistant Details page, in the General settings section, enable File and click Specifications.
-
In the dialog box, set Select Connector to Model Studio RAG Knowledge Retrieval, set Select Action to Import temporary files to Model Studio application data, and then click Next.
-
Set up a credential for file uploads.
-
Click Add New Credential, enter a Credential Name, set the role type to Create New Role, enter a role name, and click Create Role. The Trusted Service defaults to
appflow.computenest.aliyuncs.com. -
Specify a Permission Policy Name and click Create Policy.
NoteThis policy allows users to apply for file upload leases, add files, and view file descriptions.
The permission policy is in JSON format. The Action array includes
sfm:ApplyFileUploadLease,sfm:AddFile, andsfm:DescribeFile. The Resource is*, and the Effect isAllow. -
Click Authorize.
-
-
Select the newly created credential and click Next. In the Parameter configuration step, enter the workspace ID obtained in Step 1 in the workspace ID field, and then click Save.
-
Add a user in Alibaba Cloud Model Studio Account Management.
-
Click Add User. In the dialog box that appears, set Disk Category to RAM Role, for the RAM User field, select the role that you created in step 4, and click Save and Continue to Configure Permissions.
-
Click Permission. In the dialog box that appears, select a Business scope and a Role, and then click OK.
-
Click Completed to add the user.
-
-
In the preview pane on the right side of the Page settings section, file upload is now enabled.
Click the attachment icon next to the input box at the bottom of the preview pane to open a menu where you can select Upload Document or Upload Image.
Step 3: Enable file upload in web integration
-
Go to the AppFlow-AI Assistant page. On the AI Assistant Details page, click the Integration tab, and then click web page integration.
-
Click the Integration ID/Name that you want to configure. In the Message settings section, select the File Support checkbox, and then click OK to save the settings.
-
Test the file upload feature. For example, on the independent deployment page, click Upload Document to upload a file. Once configured, a paperclip icon appears in the AI assistant's chat interface. Click the icon to open a menu with the Upload Document and Upload Image options. You can now upload files and ask questions about their content.