This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from langchain.callbacks.base import BaseCallbackHandler | |
import azure.cognitiveservices.speech as speechsdk | |
import os | |
import base64 | |
import time | |
class StreamDisplayHandler(BaseCallbackHandler): | |
def __init__(self, container, initial_text="", display_method='markdown'): | |
self.container = container | |
self.text = initial_text | |
self.display_method = display_method |