Skip to content

Commit

Permalink
Improve Any decoding-error.
Browse files Browse the repository at this point in the history
Was:

TypeError: Could not convert Any to PredictLongRunningResponse

Now:

TypeError: Could not convert
   Any[google.ai.generativelanguage.v1main.PredictLongRunningResponse] to
       google.ai.generativelanguage.v1beta.PredictLongRunningResponse
  • Loading branch information
MarkDaoust committed Oct 1, 2024
1 parent 84bf637 commit 9e01e2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions google/api_core/protobuf_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ def from_any_pb(pb_type, any_pb):
# Unpack the Any object and populate the protobuf message instance.
if not any_pb.Unpack(msg_pb):
raise TypeError(
"Could not convert {} to {}".format(
any_pb.__class__.__name__, pb_type.__name__
"Could not convert\n Any[{}] to\n {}".format(
any_pb.TypeName(), msg_pb.DESCRIPTOR.full_name
)
)

Expand Down

0 comments on commit 9e01e2e

Please sign in to comment.