Repository: deepset-ai/haystack

Issue:
Weaviate: Allow custom HTTP headers to pass to weaviate client
**Is your feature request related to a problem? Please describe.**
The weaviate client supports passing custom HTTP headers by passing the additional_headers parameter on creation since version 3.9.0. This interface is not exposed in Haystack.

**Describe the solution you'd like**
The WeaviateDocumentStore [constructor](https://github.com/deepset-ai/haystack/blob/0d6c7a2a2cb2e1440c4e3f514935e4e3f344c8e4/haystack/document_stores/weaviate.py#L60-L80) should take a parameter named `additional_headers` that gets passed to the [weaviate client on construction](https://github.com/hsm207/haystack/blob/0d6c7a2a2cb2e1440c4e3f514935e4e3f344c8e4/haystack/document_stores/weaviate.py#L121-L127).

**Describe alternatives you've considered**
NA

**Additional context**
* Documentation on the [additional_headers](https://github.com/weaviate/weaviate-python-client/blob/7a512ea1177fa839b79335fc62daa6ecac53c995/docs/changelog.rst#version-390) parameter
* A [use case](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-openai#example) of using the additional_headers parameter




Discussion:

Resolving patch:
diff --git a/haystack/document_stores/weaviate.py b/haystack/document_stores/weaviate.py
--- a/haystack/document_stores/weaviate.py
+++ b/haystack/document_stores/weaviate.py
@@ -64,6 +64,7 @@ def __init__(
         timeout_config: tuple = (5, 15),
         username: Optional[str] = None,
         password: Optional[str] = None,
+        additional_headers: Optional[Dict[str, Any]] = None,
         index: str = "Document",
         embedding_dim: int = 768,
         content_field: str = "content",
@@ -85,6 +86,7 @@ def __init__(
         :param timeout_config: Weaviate Timeout config as a tuple of (retries, time out seconds).
         :param username: username (standard authentication via http_auth)
         :param password: password (standard authentication via http_auth)
+        :param additional_headers: additional headers to be included in the requests sent to Weaviate e.g. bearer token
         :param index: Index name for document text, embedding and metadata (in Weaviate terminology, this is a "Class" in Weaviate schema).
         :param embedding_dim: The embedding vector size. Default: 768.
         :param content_field: Name of field that might contain the answer and will therefore be passed to the Reader Model (e.g. "full_text").
@@ -121,10 +123,15 @@ def __init__(
         if username and password:
             secret = AuthClientPassword(username, password)
             self.weaviate_client = client.Client(
-                url=weaviate_url, auth_client_secret=secret, timeout_config=timeout_config
+                url=weaviate_url,
+                auth_client_secret=secret,
+                timeout_config=timeout_config,
+                additional_headers=additional_headers,
             )
         else:
-            self.weaviate_client = client.Client(url=weaviate_url, timeout_config=timeout_config)
+            self.weaviate_client = client.Client(
+                url=weaviate_url, timeout_config=timeout_config, additional_headers=additional_headers
+            )
 
         # Test Weaviate connection
         try:


Test patch: