Find answers from the community

Updated 3 months ago

hi all,

hi all,
i was facing this issue all of a sudden, it was working fine till i restated my kernel

----> 4 Settings.llm = Gemini()
5 Settings.embed_model = OpenAIEmbedding(model="text-embedding-3-small")

File c:\Users\Maneesh\AppData\Local\Programs\Python\Python312\Lib\site-packages\llama_index\llms\gemini\base.py:141, in Gemini.init(self, api_key, model, temperature, max_tokens, generation_config, safety_settings, callback_manager, api_base, transport, model_name, default_headers, generate_kwargs) 138 # Explicitly passed args take precedence over the generation_config. 139 final_gen_config = {"temperature": temperature, base_gen_config}
--> 141 self._model = genai.GenerativeModel(
142 model_name=model,
143 generation_config=final_gen_config,
144 safety_settings=safety_settings,
145 )
147 self._model_meta = genai.get_model(model)
149 supported_methods = self._model_meta.supported_generation_methods

File c:\Users\Maneesh\AppData\Local\Programs\Python\Python312\Lib\site-packages\pydantic\main.py:837, in BaseModel.setattr(self, name, value)
832 raise AttributeError(
833 f'{name!r} is a ClassVar of {self.__class__.__name__} and cannot be set on an instance. '
834 f'If you want to set a value on the class, use {self.__class__.__name__}.{name} = value.'
835 )
836 elif not _fields.is_valid_field_name(name):
...
826 else:
827 # this is the current error
828 raise AttributeError(f'{type(self).name!r} object has no attribute {item!r}')

AttributeError: 'Gemini' object has no attribute 'pydantic_private'
W
m
4 comments
You'll need to update the deps again I think
There was a pydantic upgrade in v0.11.x so there may be some conflict with lower versions
Try upgrading pip install -U llama-index llama-index-llms-gemini llama-index-llms-openai
yeahh it is fixed by updating thanks for your response
Add a reply
Sign up and join the conversation on Discord