code: def listen(voiceassitant_chain):
      engine = pyttsx3.init()
      r = sr.Recognizer()
      with sr.Microphone() as source:
          print("Calibrating...")
          r.adjust_for_ambient_noise(source, duration=5)
          # optional parameters to adjust microphone sensitivity
          # r.energy_threshold = 200
          # r.pause_threshold=0.5
  
          print("Okay, go!")
          while 1:
              text = ""
              print("listening now...")
              try:
                  audio = r.listen(
                      source, timeout=5, phrase_time_limit=30
                  )
                  print("Recognizing...")
                  # whisper model options are found here: https://github.com/openai/whisper#available-models-and-languages
                  # other speech recognition models are also available.
                  text = r.recognize_whisper(
                      audio,
                      model="medium.en",
                      show_dict=True,
                  )["text"]
              except Exception as e:
                  unrecognized_speech_text = (
                      f"Sorry, I didn't catch that. Exception was: {e}s"
                  )
                  text = unrecognized_speech_text
              print(text)
  
              response_text = voiceassitant_chain.predict(
                  human_input=text
              )
              print(response_text)
              engine.say(response_text)
              engine.runAndWait()
  
file_path: BigDL/python/llm/example/CPU/LangChain/native_int4/voiceassistant.py
imports: from langchain import LLMChain, PromptTemplate
  from bigdl.llm.langchain.llms import *
  from langchain.memory import ConversationBufferWindowMemory
  from langchain.callbacks.manager import CallbackManager
  from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
  import speech_recognition
  import pyttsx3
  import argparse
label_desc: Use image node_id 2 for calling a global function with example usage: listen(voiceassitant_chain) without return types