Migration Guide to Chainlit v1.0.0
Updating Chainlit
Begin the migration by updating Chainlit to the latest version:
pip install --upgrade chainlit
The documentation has been entirely updated, click on the links below to see the new APIs!
Message
Previously, messages were both used for chat interactions and display intermediate steps.
Intermediary steps are more than just messages, they have an input and an output, a start and an end.
For this reason, we decided to remove the parent_id
, prompt
and indent
fields from the cl.Message
class and introduce a new concept: cl.Step.
Finally, the disable_human_feedback
field has been renamed to disable_feedback
.
Prompt
The Chainlit Prompt
class was mixing fields for both chat and completion LLMs.
To make it clearer, it has been split into two classes: ChatGeneration and CompletionGeneration.
Generations are intended to be used with Step.
AppUser
The AppUser
class has been renamed to User
. The username
field has been renamed to identifier
to emphasize that it has to be a unique identifier.
The other fields such as provider
have been removed. A new metadata
field has been added instead. It is a dictionary that can be used to store any information about the user.
AskUserMessage
The response of AskUserMessage has been slightly modified. The content
field has been renamed to output
.
File Upload
File upload has been reworked to remove the size limit and vastly improve performance. The APIs stay the same with one exception.
The file objects returned by AskFileMessage and multi modal messages no longer have the content
of the file. Instead they have a path
field that can be used to manipulate the file.
Was this page helpful?