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:
coveralls: ## Pull Request Test Coverage Report for [Build 9664861598](https://coveralls.io/builds/68289454)


### Details

* **0** of **0**   changed or added relevant lines in **0** files are covered.
* **2** unchanged lines in **1** file lost coverage.
* Overall coverage remained the same at **89.968%**

---


|  Files with Coverage Reduction | New Missed Lines | % |
| :-----|--------------|--: |
| [components/generators/openai.py](https://coveralls.io/builds/68289454/source?filename=components%2Fgenerators%2Fopenai.py#L189) | 2 | 96.34% |
<!-- | **Total:** | **2** |  | -->

|  Totals | [![Coverage Status](https://coveralls.io/builds/68289454/badge)](https://coveralls.io/builds/68289454) |
| :-- | --: |
| Change from base [Build 9664851641](https://coveralls.io/builds/68289438): |  0.0% |
| Covered Lines: | 6717 |
| Relevant Lines: | 7466 |

---
##### 💛  - [Coveralls](https://coveralls.io)

coveralls: ## Pull Request Test Coverage Report for [Build 9665120183](https://coveralls.io/builds/68289846)


### Details

* **0** of **0**   changed or added relevant lines in **0** files are covered.
* **2** unchanged lines in **1** file lost coverage.
* Overall coverage remained the same at **89.968%**

---


|  Files with Coverage Reduction | New Missed Lines | % |
| :-----|--------------|--: |
| [components/generators/openai.py](https://coveralls.io/builds/68289846/source?filename=components%2Fgenerators%2Fopenai.py#L189) | 2 | 96.34% |
<!-- | **Total:** | **2** |  | -->

|  Totals | [![Coverage Status](https://coveralls.io/builds/68289846/badge)](https://coveralls.io/builds/68289846) |
| :-- | --: |
| Change from base [Build 9664851641](https://coveralls.io/builds/68289438): |  0.0% |
| Covered Lines: | 6717 |
| Relevant Lines: | 7466 |

---
##### 💛  - [Coveralls](https://coveralls.io)


Patch:
diff --git a/haystack/components/generators/openai.py b/haystack/components/generators/openai.py
index 8604a1db..f364ce15 100644
--- a/haystack/components/generators/openai.py
+++ b/haystack/components/generators/openai.py
@@ -146,6 +146,7 @@ class OpenAIGenerator:
             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(),
diff --git a/releasenotes/notes/fix-serialization-openai-generator-cf7e9a04562dde75.yaml b/releasenotes/notes/fix-serialization-openai-generator-cf7e9a04562dde75.yaml
new file mode 100644
index 00000000..5e815b68
--- /dev/null
+++ b/releasenotes/notes/fix-serialization-openai-generator-cf7e9a04562dde75.yaml
@@ -0,0 +1,3 @@
+fixes:
+  - |
+    Adds the missing 'organization' parameter to the serialization function.


Test patch:
diff --git a/test/components/generators/test_openai.py b/test/components/generators/test_openai.py
index 6fe80721..b34a5399 100644
--- a/test/components/generators/test_openai.py
+++ b/test/components/generators/test_openai.py
@@ -78,6 +78,7 @@ class TestOpenAIGenerator:
                 "streaming_callback": None,
                 "system_prompt": None,
                 "api_base_url": None,
+                "organization": None,
                 "generation_kwargs": {},
             },
         }
@@ -89,6 +90,7 @@ class TestOpenAIGenerator:
             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 @@ class TestOpenAIGenerator:
                 "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 @@ class TestOpenAIGenerator:
                 "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 @@ class TestOpenAIGenerator:
                 "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"},