LangChain - Production Deployment
Given this code snippet using streaming:
What will be the output behavior?
from langchain.callbacks.base import BaseCallbackHandler
class PrintHandler(BaseCallbackHandler):
def on_llm_new_token(self, token: str, **kwargs):
print(token, end='')
handler = PrintHandler()
llm = OpenAI(streaming=True, callbacks=[handler])
llm('Hello')What will be the output behavior?
