from google.generativeai import error
in the above import of the google's generative ai of the python module is not working as expected the error module is not found but in the below import, the error module is working prefect in my previous verison of my code, i want to know, is that deprecated or else me using wrongly the import module
"from google.genai import error"
google.generativeai
= Old deprecated SDK
google.genai
= New unified SDK
https://ai.google.dev/gemini-api/docs/migrate
pip uninstall google-generativeai
Then
pip install google-genai
You can check available modules like so.
from google import genai
print("Available in main genai module:")
print([item for item in dir(genai) if not item.startswith('_')])
It will give something like:
['Client', 'batches', 'caches', 'chats',
'client', 'errors', 'files', 'live', 'live_music',
'models', 'operations', 'pagers', 'tokens', 'tunings',
'types', 'version']
So correct import should be
from google.genai import errors