class_docstr: Integration with the Google generative AI Python Library
class_docstr_tok: ["Integration","with","the","Google","generative","AI","Python","Library"]
docstr: API_KEY preference order:
      1. provided at model creation
      2. provided at engine creation
      3. GOOGLE_GENAI_API_KEY env variable
      4. google_gemini.api_key setting in config.json
docstr_tok: ["API_KEY","preference","order",":","1.","provided","at","model","creation","2.","provided","at","engine","creation","3",".","GOOGLE_GENAI_API_KEY","env","variable","4.","google_gemini.api_key","setting","in","config.json"]
code: def _get_google_gemini_api_key(self, args, strict=True):
      """
      API_KEY preference order:
          1. provided at model creation
          2. provided at engine creation
          3. GOOGLE_GENAI_API_KEY env variable
          4. google_gemini.api_key setting in config.json
      """
  
      if "api_key" in args["using"]:
          return args["using"]["api_key"]
      # 2
      connection_args = self.engine_storage.get_connection_args()
      if "api_key" in connection_args:
          return connection_args["api_key"]
      # 3
      api_key = os.getenv("GOOGLE_GENAI_API_KEY")
      if api_key is not None:
          return api_key
      # 4
      config = Config()
      google_gemini_config = config.get("google_gemini", {})
      if "api_key" in google_gemini_config:
          return google_gemini_config["api_key"]
  
      if strict:
          raise Exception(
              'Missing API key "api_key". Either re-create this ML_ENGINE specifying the `api_key` parameter,\
                   or re-create this model and pass the API key with `USING` syntax.'
          )
  
file_path: mindsdb/mindsdb/integrations/handlers/google_gemini_handler/google_gemini_handler.py
imports: import os
  from typing import Dict, Optional
  import google.generativeai
  import pandas
  from mindsdb.integrations.libs.base import BaseMLEngine
  from mindsdb.utilities import log
  from mindsdb.utilities.config import Config
label_desc: Use image node_id 4 for calling the GoogleGeminiHandler obj's underlying member method code with example usage: obj._get_google_gemini_api_key(args, strict) and returns: args, connection_args, api_key, google_gemini_config