Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support default_headers for AzureOpenAIDocumentEmbedder and AzureOpenAITextEmbedder #8534

Open
nuernber opened this issue Nov 12, 2024 · 0 comments · May be fixed by #8535
Open

Support default_headers for AzureOpenAIDocumentEmbedder and AzureOpenAITextEmbedder #8534

nuernber opened this issue Nov 12, 2024 · 0 comments · May be fixed by #8535

Comments

@nuernber
Copy link

nuernber commented Nov 12, 2024

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

@nuernber nuernber linked a pull request Nov 12, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant