Closed DaHui-BT closed 4 months ago
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.
https://github.com/google-gemini/generative-ai-python/issues/288
Thanks, but I don't think this is the right fix.
AFAIKT Something in your setup is breaking the proto-plus library, and is returning the proto instances without their proto-plus wrappers.
Your change fixes the first immediate symptom, but the code is littered with isinstance checks that won't see the expected proto-plus classes, and will do the wrong thing.
The last coment on https://github.com/google-gemini/generative-ai-python/issues/288 says they can reproduce this in anaconda.
Are you using anaconda?
Yes, I'm using miniconda.
I make a new commit with changes for turning the dir(part, attr)
into hasattr(part, attr)
which can just focus on using attribute checks.
I think this is the fix we need: https://github.com/googleapis/proto-plus-python/pull/471
Description of the change
I have changed the
generation_types.py
file. The changed line at [443, 446, 454]. Turn thepart
intodir(part)
Motivation
When using this library like:
the following error has occur:
Type of change
Bug fix
Checklist
git pull --rebase upstream main
).