with client.messages.stream(...) as stream: for text in stream.text_stream: print(text)