code: def llava_formatter(
      prompt: str, order_image_tokens: bool = False
  ) -> Tuple[str, List[str]]:
      """
      Formats the input prompt by replacing image tags and returns the new prompt along with image locations.
  
      Parameters:
          - prompt (str): The input string that may contain image tags like <img ...>.
          - order_image_tokens (bool, optional): Whether to order the image tokens with numbers.
              It will be useful for GPT-4V. Defaults to False.
  
      Returns:
          - Tuple[str, List[str]]: A tuple containing the formatted string and a list of images (loaded in b64 format).
      """
  
      # Initialize variables
      new_prompt = prompt
      image_locations = []
      images = []
      image_count = 0
  
      # Regular expression pattern for matching <img ...> tags
      img_tag_pattern = re.compile(r"<img ([^>]+)>")
  
      # Find all image tags
      for match in img_tag_pattern.finditer(prompt):
          image_location = match.group(1)
  
          try:
              img_data = get_image_data(image_location)
          except Exception as e:
              # Remove the token
              print(
                  f"Warning! Unable to load image from {image_location}, because of {e}"
              )
              new_prompt = new_prompt.replace(match.group(0), "", 1)
              continue
  
          image_locations.append(image_location)
          images.append(img_data)
  
          # Increment the image count and replace the tag in the prompt
          new_token = (
              f"<image {image_count}>"
              if order_image_tokens
              else "<image>"
          )
  
          new_prompt = new_prompt.replace(match.group(0), new_token, 1)
          image_count += 1
  
      return new_prompt, images
  
file_path: autogen/autogen/agentchat/contrib/img_utils.py
imports: import base64
  import mimetypes
  import re
  from io import BytesIO
  from typing import Any, Dict, List, Optional, Tuple, Union
  import requests
  from PIL import Image
label_desc: Use image node_id 2 for calling a global function with example usage: llava_formatter(prompt, order_image_tokens) and returns: new_prompt,  images