Ask the user to upload a file before continuing. If the user does not answer in time (see timeout), a TimeoutError will be raised or None will be returned depending on raise_on_timeout. If a project ID is configured, the messages will be uploaded to the cloud storage.Documentation Index
Fetch the complete documentation index at: https://docs.chainlit.io/llms.txt
Use this file to discover all available pages before exploring further.
Attributes
Text displayed above the upload button.
List of mime type to accept like
["text/csv", "application/pdf"] or a dict like {"text/plain": [".txt", ".py"]}.
More infos here https://react-dropzone.org/#!/Accepting%20specific%20file%20types.Maximum file size in MB. Defaults to 2.
Maximum number of files to upload. Defaults to 1. Maximum value is 10.
The author of the message, defaults to the chatbot name defined in your
config.
The number of seconds to wait for an answer before raising a TimeoutError.
Whether to raise a socketio TimeoutError if the user does not answer in time.
Returns
The files uploaded by the user.
Example
Ask for a text file
accept parameter to precise the file extension for each mime type:
Ask for a python file