code: def gemini_text_image_pt(messages: list):
      """
      {
          "contents":[
              {
              "parts":[
                  {"text": "What is this picture?"},
                  {
                  "inline_data": {
                      "mime_type":"image/jpeg",
                      "data": "'$(base64 -w0 image.jpg)'"
                  }
                  }
              ]
              }
          ]
      }
      """
      try:
          import google.generativeai as genai
      except:
          raise Exception(
              "Importing google.generativeai failed, please run 'pip install -q google-generativeai"
          )
  
      prompt = ""
      images = []
      for message in messages:
          if isinstance(message["content"], str):
              prompt += message["content"]
          elif isinstance(message["content"], list):
              # see https://docs.litellm.ai/docs/providers/openai#openai-vision-models
              for element in message["content"]:
                  if isinstance(element, dict):
                      if element["type"] == "text":
                          prompt += element["text"]
                      elif element["type"] == "image_url":
                          image_url = element["image_url"]["url"]
                          images.append(image_url)
  
      content = [prompt] + images
      return content
  
imports: from enum import Enum
  import requests, traceback
  import json
  from jinja2 import Template, exceptions, Environment, meta
  from typing import Optional, Any
label_desc: Use image node_id 18 for calling a global function with example usage: gemini_text_image_pt(messages) and returns: content