Spaces:
Sleeping
Sleeping
Commit
·
5449122
1
Parent(s):
8542a40
Answers questions
Browse files- BuildingAChainlitApp.md +4 -0
BuildingAChainlitApp.md
CHANGED
|
@@ -133,6 +133,8 @@ Simply put, this downloads the file as a temp file, we load it in with `TextFile
|
|
| 133 |
|
| 134 |
Why do we want to support streaming? What about streaming is important, or useful?
|
| 135 |
|
|
|
|
|
|
|
| 136 |
## On Chat Start:
|
| 137 |
|
| 138 |
The next scope is where "the magic happens". On Chat Start is when a user begins a chat session. This will happen whenever a user opens a new chat window, or refreshes an existing chat window.
|
|
@@ -175,6 +177,8 @@ Now, we'll save that into our user session!
|
|
| 175 |
|
| 176 |
Why are we using User Session here? What about Python makes us need to use this? Why not just store everything in a global variable?
|
| 177 |
|
|
|
|
|
|
|
| 178 |
## On Message
|
| 179 |
|
| 180 |
First, we load our chain from the user session:
|
|
|
|
| 133 |
|
| 134 |
Why do we want to support streaming? What about streaming is important, or useful?
|
| 135 |
|
| 136 |
+
--> Streaming allows the response to be shown to the user as it becomes available. This is useful for long response messages. The user does not have to wait for the entire message to be available before viewing it.
|
| 137 |
+
|
| 138 |
## On Chat Start:
|
| 139 |
|
| 140 |
The next scope is where "the magic happens". On Chat Start is when a user begins a chat session. This will happen whenever a user opens a new chat window, or refreshes an existing chat window.
|
|
|
|
| 177 |
|
| 178 |
Why are we using User Session here? What about Python makes us need to use this? Why not just store everything in a global variable?
|
| 179 |
|
| 180 |
+
--> We are using session so that a user can interact multiple times with the same document upload. Similarly, when the same user revists the app or a different user visits the app, there is a fresh chat with no prior documents added. This keeps the response specific to only the documents loaded. Session is used instead of a global variable in order to handle multiple users at the same time.
|
| 181 |
+
|
| 182 |
## On Message
|
| 183 |
|
| 184 |
First, we load our chain from the user session:
|