Need clarification about Google AI python packageS (google-genai vs google-generativeai)

Hello,

The import statement the goes import google.generativeai as genai is the old version of importing Gemini API library where as the other import statement from google import genai is the newer version of importing the library. I would suggest to use the newer version of importing the library because of higher level of facade and abstraction. For more detailed summary visit Google.generativeai vs python-genai

Hope this helps

1 Like