Repository navigation
Python: Honor injected Foundry embedding clients without endpoint settings - #1
Closed
ZedingZhang wants to merge 1 commit into
Closed
ZedingZhang wants to merge 1 commit into
ZedingZhang wants to merge 1 commit into
Conversation
ZedingZhang
had a problem deploying
to
github-app-auth
November 2, 2026 18:41 — with
GitHub Actions
Failure
ZedingZhang
had a problem deploying
to
github-app-auth
November 2, 2026 18:41 — with
GitHub Actions
Failure
ZedingZhang
had a problem deploying
to
integration
November 2, 2026 18:42 — with
GitHub Actions
Error
ZedingZhang
had a problem deploying
to
integration
November 2, 2026 18:42 — with
GitHub Actions
Error
ZedingZhang
had a problem deploying
to
integration
November 2, 2026 18:42 — with
GitHub Actions
Error
ZedingZhang
had a problem deploying
to
github-app-auth
November 2, 2026 18:42 — with
GitHub Actions
Failure
…tings An injected text or image SDK client is the transport for that modality, so construction no longer requires a Foundry endpoint, API key, or credential. Ambient endpoint settings cannot replace or block that client. The other modality is created only when a request needs it and connection settings exist. Co-authored-by: ZedingZhang <[email protected]>
cursor
Bot
force-pushed
the
cursor/foundry-injected-embedding-client-f900
branch
from
November 2, 2026 18:43
2c6a646 to
9342a84
Compare
2 tasks done
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation & Context
RawFoundryEmbeddingClientandFoundryEmbeddingClientrejected a caller-supplied embeddings SDK client unless a Foundry project or Models endpoint was also configured. Construction raisedValueError: Either 'project_endpoint', 'project_client', or 'endpoint' is required...even whentext_clientorimage_clientwas already a working transport. AmbientFOUNDRY_MODELS_ENDPOINTcould also become the wrapper service URL while requests still went to the injected client.Callers who already own a configured
EmbeddingsClientorImageEmbeddingsClientshould be able to embed with that client without also supplying an endpoint, API key, credential, dotenv file, or Foundry environment variables.Description & Review Guide
An injected text or image SDK client is the transport for that modality. It takes precedence over constructor connection settings, environment settings, and framework defaults, so those settings are not required and are not used to replace the injected client.
modelandimage_modelkeep the existing explicit-argument, environment, then default resolution.When one modality is injected, the other is created only if a later request needs it and endpoint plus credential settings are available. Client factories are not called for a transport the caller already supplied. A missing modality with insufficient settings raises a focused
ValueErrorat request time, before any partial request is sent.service_url()reads the endpoint stored on an injected Azure AI Inference client when that value is a string. Otherwise it uses an explicitendpointargument, or reports an empty URL instead of substituting an ambient endpoint.Caller-owned client cleanup is unchanged and remains covered by microsoft#9627.
text_client/image_clientvalues are sufficient transports inRawFoundryEmbeddingClient(and thereforeFoundryEmbeddingClient). Connection settings are required only when a requested modality still has to be created.endpoint, and ambient Foundry endpoint settings, includingservice_url()when the SDK client does not expose a string endpoint.Related Issue
Fixes microsoft#9950
AI Assistance
AI assistance details: implementation, tests, documentation, and this PR description.
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.