generative-ai-python icon indicating copy to clipboard operation
generative-ai-python copied to clipboard

Unable to Coerce return values when they are Protos

Open kmaphoenix opened this issue 1 year ago • 0 comments

TLDR

When calling a function that returns a proto (or list of protos), a ValueError is thrown because it cannot coerce the results.

image

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.

image

kmaphoenix avatar Apr 17 '24 20:04 kmaphoenix