code: def test_from_dict(self, mock_check_valid_model):
      generator = HuggingFaceTGIChatGenerator(
          model="NousResearch/Llama-2-7b-chat-hf",
          generation_kwargs={"n": 5},
          stop_words=["stop", "words"],
          streaming_callback=streaming_callback_handler,
      )
      # Call the to_dict method
      result = generator.to_dict()
  
      generator_2 = HuggingFaceTGIChatGenerator.from_dict(result)
      assert generator_2.model == "NousResearch/Llama-2-7b-chat-hf"
      assert generator_2.generation_kwargs == {
          "n": 5,
          "stop_sequences": ["stop", "words"],
      }
      assert (
          generator_2.streaming_callback is streaming_callback_handler
      )
  
imports: from unittest.mock import patch, MagicMock, Mock
  import pytest
  from huggingface_hub.inference._text_generation import TextGenerationStreamResponse, Token, StreamDetails, FinishReason
  from huggingface_hub.utils import RepositoryNotFoundError
  from haystack.components.generators.chat import HuggingFaceTGIChatGenerator
  from haystack.dataclasses import StreamingChunk, ChatMessage
label_desc: Use image node_id 3 for calling the TestHuggingFaceTGIChatGenerator obj's underlying member method code with example usage: obj.test_from_dict(mock_check_valid_model) without return types