Repository: deepset-ai/haystack

Issue:
bug: Missing params in `OpenAIGenerator`'s to_dict method
**Describe the bug**
I noticed that the to_dict method of `OpenAIGenerator` https://github.com/deepset-ai/haystack/blob/4c59000c211901d0badaacc18de5b0cb337a88df/haystack/components/generators/openai.py#L144-L152

looks to be missing
https://github.com/deepset-ai/haystack/blob/4c59000c211901d0badaacc18de5b0cb337a88df/haystack/components/generators/openai.py#L61
and
https://github.com/deepset-ai/haystack/blob/4c59000c211901d0badaacc18de5b0cb337a88df/haystack/components/generators/openai.py#L64-L65
from it's init method.

I can understand that max_retries and timeout might be better left as `None` so environment variables are always used, but I think `organization` was missed.

**Expected behavior**
For serialization and deser to return the component with the same settings. 

**To Reproduce**
Initialize a OpenAIGenerator and run serder and see that the components are not equal.



Discussion:

Resolving patch:
diff --git a/haystack/components/generators/openai.py b/haystack/components/generators/openai.py
--- a/haystack/components/generators/openai.py
+++ b/haystack/components/generators/openai.py
@@ -146,6 +146,7 @@ def to_dict(self) -> Dict[str, Any]:
             model=self.model,
             streaming_callback=callback_name,
             api_base_url=self.api_base_url,
+            organization=self.organization,
             generation_kwargs=self.generation_kwargs,
             system_prompt=self.system_prompt,
             api_key=self.api_key.to_dict(),


Test patch:
diff --git a/test/components/generators/test_openai.py b/test/components/generators/test_openai.py
--- a/test/components/generators/test_openai.py
+++ b/test/components/generators/test_openai.py
@@ -78,6 +78,7 @@ def test_to_dict_default(self, monkeypatch):
                 "streaming_callback": None,
                 "system_prompt": None,
                 "api_base_url": None,
+                "organization": None,
                 "generation_kwargs": {},
             },
         }
@@ -89,6 +90,7 @@ def test_to_dict_with_parameters(self, monkeypatch):
             model="gpt-4",
             streaming_callback=print_streaming_chunk,
             api_base_url="test-base-url",
+            organization="org-1234567",
             generation_kwargs={"max_tokens": 10, "some_test_param": "test-params"},
         )
         data = component.to_dict()
@@ -99,6 +101,7 @@ def test_to_dict_with_parameters(self, monkeypatch):
                 "model": "gpt-4",
                 "system_prompt": None,
                 "api_base_url": "test-base-url",
+                "organization": "org-1234567",
                 "streaming_callback": "haystack.components.generators.utils.print_streaming_chunk",
                 "generation_kwargs": {"max_tokens": 10, "some_test_param": "test-params"},
             },
@@ -119,6 +122,7 @@ def test_to_dict_with_lambda_streaming_callback(self, monkeypatch):
                 "api_key": {"env_vars": ["OPENAI_API_KEY"], "strict": True, "type": "env_var"},
                 "model": "gpt-4",
                 "system_prompt": None,
+                "organization": None,
                 "api_base_url": "test-base-url",
                 "streaming_callback": "test_openai.<lambda>",
                 "generation_kwargs": {"max_tokens": 10, "some_test_param": "test-params"},
@@ -133,6 +137,7 @@ def test_from_dict(self, monkeypatch):
                 "api_key": {"env_vars": ["OPENAI_API_KEY"], "strict": True, "type": "env_var"},
                 "model": "gpt-4",
                 "system_prompt": None,
+                "organization": None,
                 "api_base_url": "test-base-url",
                 "streaming_callback": "haystack.components.generators.utils.print_streaming_chunk",
                 "generation_kwargs": {"max_tokens": 10, "some_test_param": "test-params"},