You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I create a text field and assign state @{text_msg} and append it from the stream chunks, it does successfully output the whole response (displayed in UI) bit by bit.
for chunk in stream:
if (chunk.choices[0].delta.content) is None: # Stop when stream ends
return
else:
state['text_msg'] += chunk.choices[0].delta.content
So my question is, how may I get the stream to display in the chatbot itself?
Any help would be appreciated. Thank you.
(P.S Love this framework. I am a total noob with Python and this makes it easier for me to learn along the way)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
When using OpenAI API, I can get a non-streamed response and have it displayed in the chatbot with no issue.
E.g:
However, if I try to set it to stream (for the typewriter effect and not have to wait for the whole response), it throws this:
If I create a text field and assign state @{text_msg} and append it from the stream chunks, it does successfully output the whole response (displayed in UI) bit by bit.
So my question is, how may I get the stream to display in the chatbot itself?
Any help would be appreciated. Thank you.
(P.S Love this framework. I am a total noob with Python and this makes it easier for me to learn along the way)
Beta Was this translation helpful? Give feedback.
All reactions