code: def prepare_chain(args):
      llm_model_path = args.llm_model_path
  
      # Use a easy prompt could bring good-enough result
      # For Chinese Prompt
      # template = """{history}\n\n问：{human_input}\n\n答："""
      template = template_dict[args.language]
      prompt = PromptTemplate(
          input_variables=["history", "human_input"], template=template
      )
  
      method_index = 1 if args.directly else 0
      llm = llm_load_methods[method_index](
          model_id=llm_model_path,
          model_kwargs={"temperature": 0, "trust_remote_code": True},
      )
  
      # Following code are complete the same as the use-case
      voiceassitant_chain = LLMChain(
          llm=llm,
          prompt=prompt,
          verbose=True,
          llm_kwargs={"max_new_tokens": args.max_new_tokens},
          memory=ConversationBufferWindowMemory(k=2),
      )
  
      recog_model_path = args.recog_model_path
      processor = WhisperProcessor.from_pretrained(recog_model_path)
      recogn_model = AutoModelForSpeechSeq2Seq.from_pretrained(
          recog_model_path, load_in_4bit=True
      )
      recogn_model.config.forced_decoder_ids = None
      forced_decoder_ids = processor.get_decoder_prompt_ids(
          language=args.language, task="transcribe"
      )
  
      return (
          voiceassitant_chain,
          processor,
          recogn_model,
          forced_decoder_ids,
      )
  
file_path: BigDL/python/llm/example/CPU/LangChain/transformers_int4/voiceassistant.py
imports: from langchain import LLMChain, PromptTemplate
  from bigdl.llm.langchain.llms import TransformersLLM
  from langchain.memory import ConversationBufferWindowMemory
  from bigdl.llm.transformers import AutoModelForSpeechSeq2Seq
  from transformers import WhisperProcessor
  import speech_recognition
  import numpy
  import pyttsx3
  import argparse
  import time
label_desc: Use image node_id 1 for calling a global function with example usage: prepare_chain(args) and returns: voiceassitant_chain,  processor,  recogn_model,  forced_decoder_ids