code: def test_from_dict(self):
      data = {
          "type": "haystack.components.generators.chat.openai.OpenAIChatGenerator",
          "init_parameters": {
              "model": "gpt-4",
              "api_base_url": "test-base-url",
              "streaming_callback": "haystack.components.generators.utils.default_streaming_callback",
              "generation_kwargs": {
                  "max_tokens": 10,
                  "some_test_param": "test-params",
              },
          },
      }
      component = OpenAIChatGenerator.from_dict(data)
      assert component.model == "gpt-4"
      assert component.streaming_callback is default_streaming_callback
      assert component.api_base_url == "test-base-url"
      assert component.generation_kwargs == {
          "max_tokens": 10,
          "some_test_param": "test-params",
      }
  
imports: import os
  import pytest
  from openai import OpenAIError
  from haystack.components.generators.chat import OpenAIChatGenerator
  from haystack.components.generators.utils import default_streaming_callback
  from haystack.dataclasses import ChatMessage, StreamingChunk
label_desc: Use image node_id 7 for calling the TestOpenAIChatGenerator obj's underlying member method code with example usage: obj.test_from_dict() without return types