You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 16, 2025. It is now read-only.
calling session.send_message returns a GenerateContentResponse object, and when this response includes a function call, response.text raises the following error:
File ".../.virtualenvs/cai/lib/python3.11/site-packages/google/generativeai/types/generation_types.py", line 538, in text
part_type = protos.Part.pb(part).whichOneof("data")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: whichOneof
Actual vs expected behavior:
response.text should return the text part of the response rather than throwing error. Related but separate of an issue, there should ideally be a convenience accessor for response.function_call