datacipen commited on
Commit
9e7c5d1
·
verified ·
1 Parent(s): 5737731

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +8 -9
main.py CHANGED
@@ -156,14 +156,13 @@ async def on_message(message: cl.Message):
156
  cl.Text(name="Sources", content=sources_text, display="inline")
157
  )
158
 
159
- async with cl.Step(type="run", name="QA Assistant"):
160
- async for chunk in runnable.astream(
161
- message.content,
162
- config=RunnableConfig(callbacks=[
163
- cl.LangchainCallbackHandler(),
164
- PostMessageHandler(msg)
165
- ]),
166
- ):
167
- await msg.stream_token(chunk)
168
 
169
  await msg.send()
 
156
  cl.Text(name="Sources", content=sources_text, display="inline")
157
  )
158
 
159
+ async for chunk in runnable.astream(
160
+ message.content,
161
+ config=RunnableConfig(callbacks=[
162
+ cl.LangchainCallbackHandler(),
163
+ PostMessageHandler(msg)
164
+ ]),
165
+ ):
166
+ await msg.stream_token(chunk)
 
167
 
168
  await msg.send()