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

feat: add support for custom headers #4040

Merged
merged 4 commits into from
Feb 9, 2023
Merged

Conversation

hsm207
Copy link
Contributor

@hsm207 hsm207 commented Feb 2, 2023

allow users to specify additional headers they want to pass when sending
requests to the weavate server

Related Issues

Proposed Changes:

Add additional_headers parameter to the weaviate document store's constructor. This parameter contains a dictionary of headers that the weaviate client will pass to the weaviate server each time a request is time.

For example, users can pass their OpenAI key using:

additional_headers = {'X-OpenAI-Api-Key': 'KEY'}

How did you test it?

I'm not sure how to test this. Please advise.

Notes for the reviewer

Should we remove the raise NotImplementedError("WeaviateDocumentStore does not support headers.") and replace with a warning message saying that the headers will be ignored because in weaviate, the headers are configured when the client is initialized, not when a query is made.

Checklist

  • I have read the contributors guidelines and the code of conduct
  • I have updated the related issue with new insights and changes
  • I added tests that demonstrate the correct behavior of the change
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test:.
  • I documented my code
  • I ran pre-commit hooks and fixed any issue

allow users to specify additional headers they want to pass when sending
requests to the weavate server
@hsm207 hsm207 marked this pull request as ready for review February 2, 2023 13:14
@hsm207 hsm207 requested a review from a team as a code owner February 2, 2023 13:14
@hsm207 hsm207 requested review from vblagoje and removed request for a team February 2, 2023 13:14
Copy link
Member

@vblagoje vblagoje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, let's just wait for another CI run

@vblagoje vblagoje merged commit 508d9f6 into deepset-ai:main Feb 9, 2023
@hsm207 hsm207 deleted the custom-headers branch February 9, 2023 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Weaviate: Allow custom HTTP headers to pass to weaviate client
2 participants