Skip to content

.Net: AddOpenAIEmbeddingGenerator now respects HttpClient.BaseAddress for endpoint.#12810

Merged
SergeyMenshykh merged 10 commits into
microsoft:mainfrom
shethaadit:shethaadit/FixBug12806
Aug 12, 2025
Merged

.Net: AddOpenAIEmbeddingGenerator now respects HttpClient.BaseAddress for endpoint.#12810
SergeyMenshykh merged 10 commits into
microsoft:mainfrom
shethaadit:shethaadit/FixBug12806

Conversation

@shethaadit

Copy link
Copy Markdown
Contributor

Description

This PR fixes an issue where AddOpenAIEmbeddingGenerator() ignored the BaseAddress of the provided HttpClient, always using the default OpenAI endpoint. Now, if a custom BaseAddress is set on the HttpClient, it is passed as the endpoint parameter, ensuring requests are sent to the correct server. This aligns the behavior with other OpenAI service registrations and enables proxy or custom endpoint scenarios.

FIxes #12806

@shethaadit shethaadit requested a review from a team as a code owner July 27, 2025 04:03
@moonbox3 moonbox3 added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel labels Jul 27, 2025
@github-actions github-actions Bot changed the title AddOpenAIEmbeddingGenerator now respects HttpClient.BaseAddress for endpoint. .Net: AddOpenAIEmbeddingGenerator now respects HttpClient.BaseAddress for endpoint. Jul 27, 2025

@jbnidev jbnidev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This looks good to me. I can see that your change addresses the issue, and it makes sense. This is the first time I have participated in this repo, so I do not have a good feeling for what beyond that I am looking for, but since you have requested my review, and I see somebody else has also reviewed, I will go ahead and approve it.

@shethaadit

Copy link
Copy Markdown
Contributor Author

Hi @rogerbarreto, @markwallace-microsoft, could you please re-approve and merge?

@rogerbarreto rogerbarreto added this pull request to the merge queue Aug 7, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 7, 2025
@SergeyMenshykh SergeyMenshykh added this pull request to the merge queue Aug 12, 2025
github-merge-queue Bot pushed a commit that referenced this pull request Aug 12, 2025
… for endpoint. (#12810)

### Description

This PR fixes an issue where AddOpenAIEmbeddingGenerator() ignored the
BaseAddress of the provided HttpClient, always using the default OpenAI
endpoint. Now, if a custom BaseAddress is set on the HttpClient, it is
passed as the endpoint parameter, ensuring requests are sent to the
correct server. This aligns the behavior with other OpenAI service
registrations and enables proxy or custom endpoint scenarios.

FIxes #12806

---------

Co-authored-by: Adit Sheth <adsheth@microsoft.com>
Co-authored-by: Roger Barreto <19890735+RogerBarreto@users.noreply.github.com>
Co-authored-by: SergeyMenshykh <68852919+SergeyMenshykh@users.noreply.github.com>
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 12, 2025
@SergeyMenshykh SergeyMenshykh added this pull request to the merge queue Aug 12, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 12, 2025
@SergeyMenshykh SergeyMenshykh added this pull request to the merge queue Aug 12, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 12, 2025
@SergeyMenshykh SergeyMenshykh added this pull request to the merge queue Aug 12, 2025
Merged via the queue into microsoft:main with commit a318659 Aug 12, 2025
19 checks passed
jcruzmot-te pushed a commit to thousandeyes/aia-semantic-kernel that referenced this pull request Sep 15, 2025
… for endpoint. (microsoft#12810)

### Description

This PR fixes an issue where AddOpenAIEmbeddingGenerator() ignored the
BaseAddress of the provided HttpClient, always using the default OpenAI
endpoint. Now, if a custom BaseAddress is set on the HttpClient, it is
passed as the endpoint parameter, ensuring requests are sent to the
correct server. This aligns the behavior with other OpenAI service
registrations and enables proxy or custom endpoint scenarios.

FIxes microsoft#12806

---------

Co-authored-by: Adit Sheth <adsheth@microsoft.com>
Co-authored-by: Roger Barreto <19890735+RogerBarreto@users.noreply.github.com>
Co-authored-by: SergeyMenshykh <68852919+SergeyMenshykh@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.Net: Bug: AddOpenAIEmbeddingGenerator() ignores BaseAddress of httpClient parameter.

6 participants