feat: Expose default_headers and add kwargs for Azure Client
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
- I have read the contributors guidelines and the code of conduct
- I have updated the related issue with new insights and changes
- I added unit tests and updated the docstrings
- 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
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.
- For more information on this, see Tracking coverage changes with pull request builds.
- To avoid this issue with future PRs, see these Recommended CI Configurations.
- For a quick fix, rebase this PR at GitHub. Your next report should be accurate.
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 | |
|---|---|
| Change from base Build 10388624662: | 0.2% |
| Covered Lines: | 7148 |
| Relevant Lines: | 7913 |
💛 - 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.