code: def make_prompt(chat_history):
      task_description = "Below is an instruction that describes a task. Write a response that appropriately completes the request.｟newline｠｟newline｠"  # noqa:E501
      nb_user_tokens = []
      nb_bot_tokens = [0]
  
      parsed_instructions = []
      parsed_responses = []
  
      def parse_instruction(text):
          parsed_text = (
              f"### Instruction:｟newline｠ {text} ｟newline｠｟newline｠"
          )
          tokens = CACHE["tokenizer"]._tokenize(parsed_text)
          nb_user_tokens.append(len(tokens))
          return parsed_text
  
      def parse_response(text):
          parsed_text = f"### Response:｟newline｠{text}"
          tokens = CACHE["tokenizer"]._tokenize(parsed_text)
          nb_bot_tokens.append(len(tokens))
          return parsed_text
  
      out = [task_description]
      for _user_message, _bot_message in chat_history:
          parsed_instructions.append(parse_instruction(_user_message))
          if _bot_message is not None:
              parsed_responses.append(parse_response(_bot_message))
          else:
              parsed_responses.append("### Response:｟newline｠")
  
          keep_indices = prune_history(
              nb_user_tokens,
              nb_bot_tokens,
              max_context_length - len(task_description),
          )
          for i in keep_indices:
              out.append(parsed_instructions[i])
              out.append(parsed_responses[i])
      prompt = "".join(out)
      return prompt
  
file_path: OpenNMT-py/docs/source/examples/replicate_vicuna/chatbot.py
imports: import argparse
  import gradio
  import numpy
  import time
  import onmt.opts
  from onmt.transforms.tokenize import SentencePieceTransform
  from onmt.utils.parse import ArgumentParser
  from onmt.utils.misc import use_gpu, set_random_seed
label_desc: Use image node_id 1 for calling a global function with example usage: make_prompt(chat_history) and returns: prompt, parsed_text, parsed_text