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
fromchatlasimportChatGoogle, ToolDefchat=ChatGoogle(system_prompt="Be very terse, not even punctuation.")
chat.register_tool(
ToolDef(lambda: "2024-01-01", name="get_date", description="Gets the current date")
)
chat.chat("What's the current date in YMD format?", stream=True)
Traceback (most recent call last):
File "/Users/cpsievert/github/chatlas/sandbox/assert_google.py", line 19, in <module>
chat.chat(
File "/Users/cpsievert/github/chatlas/chatlas/_chat.py", line 235, in chat
self._chat_emit(user_turn(*args), stream=stream, kwargs=kwargs)
File "/Users/cpsievert/github/chatlas/chatlas/_chat.py", line 351, in _chat_emit
for part in response:
File "/Users/cpsievert/github/chatlas/chatlas/_chat.py", line 387, in _chat_impl
for chunk in self._submit_turns(user_turn_result, stream, kwargs=kwargs):
File "/Users/cpsievert/github/chatlas/chatlas/_chat.py", line 424, in _submit_turns
text = self.provider.stream_text(chunk)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/cpsievert/github/chatlas/chatlas/_google.py", line 201, in stream_text
return chunk.text
^^^^^^^^^^
File "/Users/cpsievert/github/chatlas/.venv/lib/python3.12/site-packages/google/generativeai/types/generation_types.py", line 536, in text
part_type = protos.Part.pb(part).whichOneof("data")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: whichOneof. Did you mean: 'WhichOneof'?
The text was updated successfully, but these errors were encountered:
This seems like a current limitation in Google Gemini itself -- see google-gemini/generative-ai-python#446
The text was updated successfully, but these errors were encountered: