update SoM_agent
This commit is contained in:
19
mm_agents/gemini_test.py
Normal file
19
mm_agents/gemini_test.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import PIL.Image
|
||||
import google.generativeai as genai
|
||||
|
||||
genai.configure(api_key="AIzaSyANsETKHVo-D8jZu1SnTSaQgLOJEDgnj9Q")
|
||||
|
||||
# for m in genai.list_models():
|
||||
# if 'generateContent' in m.supported_generation_methods:
|
||||
# print(m.name)
|
||||
|
||||
model = genai.GenerativeModel('gemini-pro-vision')
|
||||
|
||||
img = PIL.Image.open('image.jpg')
|
||||
|
||||
messages = [
|
||||
{'role':'user',
|
||||
'parts': ["Explain this image.", img]}
|
||||
]
|
||||
|
||||
response = model.generate_content(messages)
|
||||
Reference in New Issue
Block a user