import google.generativeai as genai
gemini_key = "AIzaSyDj-6hCRGUmR2mltZr-EwknnevrQmWBi4o"
#%%

genai.configure(api_key=gemini_key)
model = genai.GenerativeModel("gemini-1.5-flash")
response = model.generate_content("Explain how AI works")
print(response.text)
#%%
import google.generativeai as genai
import PIL.Image

genai.configure(api_key=gemini_key)

model = genai.GenerativeModel("gemini-1.5-flash")
image = PIL.Image.open(r"C:\Users\Utente\Downloads\1699542296152.jpeg")
response = model.generate_content(["Describe this person physically", image])
print(response.text)
#%%
import google.generativeai as genai

genai.configure(api_key=gemini_key)

model = genai.GenerativeModel("gemini-1.5-flash")
response = model.generate_content("Explain how AI works", stream=True)
for chunk in response:
    print(chunk.text, end="")
