I have a problem with my aAPI KEY from google ai studio

AttributeError: ‘GenerativeModel’ object has no attribute ‘generate_embeddings’
Model object: genai.GenerativeModel(
model_name=‘models/text-embedding-005’,
generation_config={},
safety_settings={},
tools=None,
system_instruction=None,
cached_content=None, this error appears I don´t know how to resolve it, please help me with that, I participate in generative AI course from google through kaggle

Hi @Claudia_Arias_Gonzal , Welcome to the forum.

If you are initializing the client using an API key, currently only three embedding models are supported according to the documentation. You can use the text-embedding-004 model, which will work.

The text-embedding-005 model is supported only in the Vertex AI SDK

Thanks

Thank you, for your valuable comment, I’ll try with that