generative-ai-python
generative-ai-python copied to clipboard
Unable to Coerce return values when they are Protos
TLDR
When calling a function that returns a proto (or list of protos), a ValueError is thrown because it cannot coerce the results.
Potential Fix
I'm assuming the result from the function call needs to be in some standard python type (i.e. list, str, int, etc.) Instead of attempting to coerce each field in the proto, can we simply return the entire proto as a string?
If you see here, I've written a wrapper method around the original, where I simply take each proto and coerce to str. The function call is able to then work properly with the string format.