haystack icon indicating copy to clipboard operation
haystack copied to clipboard

feat: Expose default_headers and add kwargs for Azure Client

Open lbux opened this issue 1 year ago • 1 comments

Related Issues

  • fixes #8243

Proposed Changes:

I explicitly chose to expose default_headers and add an optional azure_kwargs for the other more niche parameters that some users might find useful. This can be condensed into azure_kwargs if preferred.

How did you test it?

Tested with empty dictionary as we would need someone that uses an Azure Organizational Project with APIM to test.

Notes for the reviewer

As noted above, let me know whether exposing default_headers is the preferred way.

Checklist

lbux avatar Aug 15 '24 19:08 lbux

Pull Request Test Coverage Report for Build 10790357564

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 76 unchanged lines in 18 files lost coverage.
  • Overall coverage increased (+0.2%) to 90.332%

Files with Coverage Reduction New Missed Lines %
components/builders/chat_prompt_builder.py 1 98.51%
components/converters/output_adapter.py 1 98.48%
components/embedders/sentence_transformers_document_embedder.py 1 96.67%
components/embedders/sentence_transformers_text_embedder.py 1 96.15%
components/preprocessors/document_splitter.py 1 98.96%
components/routers/zero_shot_text_router.py 1 93.88%
components/routers/conditional_router.py 2 97.78%
core/component/component.py 2 97.93%
components/generators/azure.py 3 92.68%
components/generators/chat/azure.py 3 92.5%
<!-- Total: 76
Totals Coverage Status
Change from base Build 10388624662: 0.2%
Covered Lines: 7148
Relevant Lines: 7913

💛 - Coveralls

coveralls avatar Aug 15 '24 20:08 coveralls

@lbux sorry for the late review. I decided to remove the kwargs argument as most of the AzureOpenAI arguments are already exposed, if we need to expose the others we can do it explicitly in future PRs.

silvanocerza avatar Sep 10 '24 10:09 silvanocerza