BrokenResponseError: Can not build a coherent char history after a broken streaming response (See the previous Exception fro details). To inspect the last response object, use chat.last
.To remove the last request/response Content
objects from the chat call last_send, last_received = chat.rewind()
and continue without it
#307
Labels
component:python sdk
Issue/PR related to Python SDK
status:triaged
Issue/PR triaged to the corresponding sub-team
type:bug
Something isn't working
Traceback (most recent call last):
File "", line 1, in
File "/home/asahi/Проекты/Python/gemini/gemini/init.py", line 5, in main
run()
File "/home/asahi/Проекты/Python/gemini/gemini/main.py", line 81, in run
process_directory(SRC, DST)
File "/home/asahi/Проекты/Python/gemini/gemini/main.py", line 73, in process_directory
translate_file(src_path=src_path, dst_path=dst_path)
File "/home/asahi/Проекты/Python/gemini/gemini/main.py", line 48, in translate_file
translated = translate(src_path)
^^^^^^^^^^^^^^^^^^^
File "/home/asahi/Проекты/Python/gemini/gemini/main.py", line 36, in translate
second_response = chat.send_message(content=MESSAGE_FOR_SECOND_PART + second_part, stream=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/asahi/.cache/pypoetry/virtualenvs/gemini-UM_oiH3g-py3.12/lib/python3.12/site-packages/google/generativeai/generative_models.py", line 467, in send_message
history = self.history[:]
^^^^^^^^^^^^
File "/home/asahi/.cache/pypoetry/virtualenvs/gemini-UM_oiH3g-py3.12/lib/python3.12/site-packages/google/generativeai/generative_models.py", line 686, in history
raise generation_types.BrokenResponseError(
google.generativeai.types.generation_types.BrokenResponseError: Can not build a coherent char history after a broken streaming response (See the previous Exception fro details). To inspect the last response object, use
chat.last
.To remove the last request/responseContent
objects from the chat calllast_send, last_received = chat.rewind()
and continue without it.code:
The text was updated successfully, but these errors were encountered: