Closed
Description
Description of the bug:
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
Any other information you'd like to share?
No response