Display tokens as they arrive using stream_text.
stream_text
- an async
iterator that yields
text deltas in real time.
Prepare the script
Run it
stream_text
accepts the same arguments as generate_text
plus optional callbacks:on_chunk(delta)
- each text deltaon_error(exc)
- exceptions while streamingon_finish(full_text)
- once completestream_object
is similar, but yields objects instead of text.stream_text
is similar, but yields objects instead of text.