code: def test_generate_embeddings_batch(self, model, text):
      emb = text_service.generate_embeddings(model=model, text=text)
  
      self.assertIsInstance(emb, dict)
  
      # Check first and last requests.
      self.assertEqual(self.observed_requests[-1].model, model)
      self.assertEqual(self.observed_requests[-1].texts[-1], text[-1])
      self.assertEqual(self.observed_requests[0].texts[0], text[0])
  
      # Check that the list has the right length.
      self.assertIsInstance(emb["embedding"][0], list)
      self.assertLen(emb["embedding"], len(text))
  
      # Check that the right number of requests were sent.
      self.assertLen(
          self.observed_requests,
          math.ceil(len(text) / text_service.EMBEDDING_MAX_BATCH_SIZE),
      )
  
imports: import copy
  import math
  import unittest
  import unittest.mock
  import google.ai.generativelanguage
  from google.generativeai import text
  from google.generativeai import client
  from google.generativeai.types import safety_types
  from google.generativeai.types import model_types
  from absl.testing import absltest
  from absl.testing import parameterized
label_desc: Use image node_id 5 for calling the UnitTests obj's underlying member method code with example usage: obj.test_generate_embeddings_batch(model, text) without return types