Skip to content

Support default_headers for AzureOpenAIDocumentEmbedder and AzureOpenAITextEmbedder #8534

@nuernber

Description

@nuernber

Is your feature request related to a problem? Please describe.
Currently AzureOpenAIChatGenerator supports setting the default_headers to send in the Azure request, but AzureOpenAIDocumentEmbedder and AzureOpenAITextEmbedder do not. This breaks Azure set ups that require subscription keys, which will give you this error if you can't modify the headers and send the subscription key: openai.AuthenticationError: Error code: 401 - {'statusCode': 401, 'message': 'Access denied due to missing subscription key. Make sure to include subscription key when making requests to an API.'}

Describe the solution you'd like
It should be very simple to add this default_headers parameter similarly to the Generator for Azure:

default_headers: Optional[Dict[str, str]] = None,

and
default_headers=self.default_headers,

Describe alternatives you've considered
Just skip using Haystack's Azure wrapper classes for embeddings

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low priority, leave it in the backlog

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions