LangChain 1 · Chat models
Stream the response
Print the answer as it is generated.
for chunk in model.stream("Write a haiku about Python."):
print(chunk.text, end="", flush=True)
Official LangChain 1 documentation
LangChain 1 · Chat models
Print the answer as it is generated.
for chunk in model.stream("Write a haiku about Python."):
print(chunk.text, end="", flush=True)
Official LangChain 1 documentation
Was this page helpful?