class_docstr: Tests are in order with the design doc.
code: def test_chat_error_in_stream(self):
      def throw():
          for c in "123":
              yield simple_response(c)
          raise ValueError()
  
      def no_throw():
          for c in "abc":
              yield simple_response(c)
  
      self.responses["stream_generate_content"] = [
          no_throw(),
          throw(),
          no_throw(),
      ]
  
      model = generative_models.GenerativeModel("gemini-mm-m")
      chat = model.start_chat()
  
      # Send a message, the response is okay..
      chat.send_message("hello1", stream=True).resolve()
  
      # Send a second message, it fails
      response = chat.send_message("hello2", stream=True)
      with self.assertRaises(ValueError):
          # Iteration fails
          for chunk in response:
              pass
  
      # Since the response broke, we can't access the history
      with self.assertRaises(generation_types.BrokenResponseError):
          chat.history
  
      # or send another message.
      with self.assertRaises(generation_types.BrokenResponseError):
          chat.send_message("hello")
  
      # Rewind a step to before the error
      chat.rewind()
  
      self.assertLen(chat.history, 2)
      self.assertEqual(chat.history[0].parts[0].text, "hello1")
      self.assertEqual(chat.history[1].parts[0].text, "abc")
  
      # And continue
      chat.send_message("hello3", stream=True).resolve()
      self.assertLen(chat.history, 4)
      self.assertEqual(chat.history[2].parts[0].text, "hello3")
      self.assertEqual(chat.history[3].parts[0].text, "abc")
  
imports: import collections
  from collections.abc import Iterable
  import copy
  import pathlib
  import unittest.mock
  from absl.testing import absltest
  from absl.testing import parameterized
  import google.ai.generativelanguage
  from google.generativeai import client
  from google.generativeai import generative_models
  from google.generativeai.types import content_types
  from google.generativeai.types import generation_types
  import PIL.Image
label_desc: Use image node_id 17 for calling the CUJTests obj's underlying member method code with example usage: obj.test_chat_error_in_stream() without return types