code: def run_pipeline_test(self, conversation_agent, _):
      # Simple
      outputs = conversation_agent(Conversation("Hi there!"))
      self.assertEqual(
          outputs,
          Conversation(
              past_user_inputs=["Hi there!"],
              generated_responses=[ANY(str)],
          ),
      )
  
      # Single list
      outputs = conversation_agent([Conversation("Hi there!")])
      self.assertEqual(
          outputs,
          Conversation(
              past_user_inputs=["Hi there!"],
              generated_responses=[ANY(str)],
          ),
      )
  
      # Batch
      conversation_1 = Conversation(
          "Going to the movies tonight - any suggestions?"
      )
      conversation_2 = Conversation(
          "What's the last book you have read?"
      )
      self.assertEqual(len(conversation_1.past_user_inputs), 0)
      self.assertEqual(len(conversation_2.past_user_inputs), 0)
  
      outputs = conversation_agent([conversation_1, conversation_2])
      self.assertEqual(outputs, [conversation_1, conversation_2])
      self.assertEqual(
          outputs,
          [
              Conversation(
                  past_user_inputs=[
                      "Going to the movies tonight - any suggestions?"
                  ],
                  generated_responses=[ANY(str)],
              ),
              Conversation(
                  past_user_inputs=[
                      "What's the last book you have read?"
                  ],
                  generated_responses=[ANY(str)],
              ),
          ],
      )
  
      # One conversation with history
      conversation_2.add_user_input("Why do you recommend it?")
      outputs = conversation_agent(conversation_2)
      self.assertEqual(outputs, conversation_2)
      self.assertEqual(
          outputs,
          Conversation(
              past_user_inputs=[
                  "What's the last book you have read?",
                  "Why do you recommend it?",
              ],
              generated_responses=[ANY(str), ANY(str)],
          ),
      )
      with self.assertRaises(ValueError):
          conversation_agent("Hi there!")
      with self.assertRaises(ValueError):
          conversation_agent(Conversation())
      # Conversation have been consumed and are not valid anymore
      # Inactive conversations passed to the pipeline raise a ValueError
      with self.assertRaises(ValueError):
          conversation_agent(conversation_2)
  
file_path: H2O/h2o_flexgen/benchmark/third_party/transformers/tests/pipelines/test_pipelines_conversational.py
imports: import unittest
  from transformers import MODEL_FOR_CAUSAL_LM_MAPPING, MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING, TF_MODEL_FOR_CAUSAL_LM_MAPPING, TF_MODEL_FOR_SEQ_TO_SEQ_CAUSAL_LM_MAPPING, AutoModelForCausalLM, AutoModelForSeq2SeqLM, AutoTokenizer, BlenderbotSmallForConditionalGeneration, BlenderbotSmallTokenizer, Conversation, ConversationalPipeline, TFAutoModelForCausalLM, pipeline
  from transformers.testing_utils import require_tf, require_torch, slow, torch_device
  from .test_pipelines_common import ANY, PipelineTestCaseMeta
label_desc: Use image node_id 2 for calling the ConversationalPipelineTests obj's underlying member method code with example usage: obj.run_pipeline_test(conversation_agent, _) without return types