# pip install -U google-generativeai import google.generativeai as genai import os import PIL.Image
# obtain your key at https://aistudio.google.com/ genai.configure(api_key=os.environ["GOOGLE_API_KEY"]) model = genai.GenerativeModel('gemini-1.0-pro-latest') response = model.generate_content("讲一个鬼故事") print(response.text)
# pip install -U google-generativeai import google.generativeai as genai import os import PIL.Image
# obtain your key at https://aistudio.google.com/ genai.configure(api_key=os.environ["GOOGLE_API_KEY"]) model = genai.GenerativeModel('gemini-1.5-pro-latest')
# output bbox img = PIL.Image.open("dancer.jpg") prompt = 'Return bounding boxes of the dancer, in the format of [ymin, xmin, ymax, xmax]' response = model.generate_content([img, prompt]) print(response.text)