-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
.Net: Allow HttpClient to be passed in for AzureOpenAI when building from s… #10703
base: main
Are you sure you want to change the base?
.Net: Allow HttpClient to be passed in for AzureOpenAI when building from s… #10703
Conversation
…ervice collection, just like it is from the Kernel Builder
Note: I ran the build.cmd and it did flag API compatibility issues for the extension methods I am adding new optional parameters to. I could understand how this would create a binary incompatibility but I thought clients would get a new nuget package and rebuild? If this is a real incompatibility I could use some advice on fixing. I can't go the method overload route because the new and old method become ambiguous if the last parameter is not provided. |
@microsoft-github-policy-service agree |
@strtdusty Thanks for the contribution. This is welcomed, could you please add Unit Tests ensuring the behavior of the
That's fine, since you are adding the parameter to the end of the method, it is flagged as incompatibility but for a very niche scenario. Regarding the
Use the command below in the solution folder to generate the suppression file:
Thanks! |
Tests updated, build passing locally with the API suppressions @RogerBarreto |
...s/Connectors.AzureOpenAI.UnitTests/Extensions/AzureOpenAIServiceCollectionExtensionsTests.cs
Outdated
Show resolved
Hide resolved
…thods is actually used
Comments/test resolved |
@RogerBarreto comments resolved. I think the PR is ready now. |
...t/src/Connectors/Connectors.AzureOpenAI/Extensions/AzureOpenAIServiceCollectionExtensions.cs
Show resolved
Hide resolved
For some obscure reason this PR says the maintainer allows edit the PR but I'm unable to help. Getting
Anyways, update the order of the usings in the file test, and LGTM. |
@RogerBarreto it looks like your commit made it in to the PR so the usings are ordered. |
I did through the github IDE but unfortunately doing this changed the encoding of the file, I will need you to pull the changes and save with the proper encoding and push a new commit |
Done |
Allow HttpClient to be passed in for AzureOpenAI when building from service collection, just like it is from the Kernel Builder
Motivation and Context
Description
Add an optional HTTPClient to the extension methods and utilize it just like the kernel builder versions. Note that I don't think this is the proper way to handle things. It would likely be better to allow an optional client name to be sent in and then SK could/should use the client factory to fetch it. However, my change makes the interface consistent with what is already there.
Contribution Checklist