Mdean77 commited on
Commit
50e44e2
1 Parent(s): 9f1b514

Answered the two questions in BuildingAChainlitApp.md

Browse files
Files changed (1) hide show
  1. BuildingAChainlitApp.md +10 -0
BuildingAChainlitApp.md CHANGED
@@ -133,6 +133,11 @@ 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 +180,11 @@ 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
+ ---
137
+ #### ANSWER #1:
138
+
139
+ Streaming will make the user perceive that something is happening and will perceive a faster response. If we did not support streaming, there would be a several second delay before the user sees anything on the screen. Streaming is not important if there is no user interaction, but otherwise, it is critical to make the app seem friendly.
140
+ ---
141
  ## On Chat Start:
142
 
143
  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.
 
180
 
181
  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?
182
 
183
+ ---
184
+ ### ANSWER #2:
185
+
186
+ This app can be hit by simultaneous users; User Session keeps chat-related information about each user separated. A global variable would be updated (and corrupted) by mixing information from multiple users.
187
+ ---
188
  ## On Message
189
 
190
  First, we load our chain from the user session: