Artin2009 commited on
Commit
cafedbd
1 Parent(s): cbcf538

Update chain_app.py

Browse files
Files changed (1) hide show
  1. chain_app.py +5 -3
chain_app.py CHANGED
@@ -697,10 +697,12 @@ async def main(message: cl.Message):
697
  prompt_truncation='OFF',
698
  connectors=[],
699
  )
700
- print(stream)
701
 
702
- # for event in stream:
703
- # await cl.Message(content=event.text).send()
 
 
704
 
705
 
706
 
 
697
  prompt_truncation='OFF',
698
  connectors=[],
699
  )
700
+ msg = cl.Message(content="")
701
 
702
+ for event in stream:
703
+ if event.event_type == 'text-generation':
704
+ await msg.stream_token(content=event.text)
705
+ await msg.send()
706
 
707
 
708