Skip to content

Python: keep NVIDIA embedding input type overrides local - #14858

Open
Twiink wants to merge 1 commit into
microsoft:mainfrom
Twiink:fix/nvidia-embedding-input-type-20261122
Open

Twiink wants to merge 1 commit into
microsoft:mainfrom
Twiink:fix/nvidia-embedding-input-type-20261122

Conversation

@Twiink

@Twiink Twiink commented Nov 22, 2026

Copy link
Copy Markdown

Motivation and Context

A per-call input_type="query" override on NVIDIA embeddings mutates a reusable input_type="passage" settings object and its nested extra body. The next document embedding request is consequently sent as a query. Copy settings before adding model defaults, overrides, and NVIDIA extra-body fields.

Description

The regression makes two requests through a real AsyncOpenAI client with an offline HTTP transport, checks the outgoing input types are query then passage, and verifies the supplied settings remain unchanged.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the SK Contribution Guidelines and applicable formatting checks
  • All relevant unit tests pass, and I have added regression coverage
  • Existing behavior is preserved outside per-call settings isolation

Validation: the unchanged source sends query twice; all 37 NVIDIA connector tests and Ruff lint/format checks pass after the fix. No live provider call was made.

Prepared with AI assistance and verified locally.

Copilot AI balanced review requested due to automatic review settings November 22, 2026 06:27
@Twiink
Twiink requested a review from a team as a code owner November 22, 2026 06:27
@Twiink
Twiink temporarily deployed to github-app-auth November 22, 2026 06:27 — with GitHub Actions Inactive

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the change that isolates per-call NVIDIA embedding settings.

No open issues 🎉

What changed in this PR

This PR prevents per-call NVIDIA embedding overrides from mutating reusable execution settings, keeping query and document requests isolated.

Changes:

  • Deep-copy settings before applying model defaults, overrides, and NVIDIA request fields.
  • Add an offline regression test that checks outgoing input types are query then passage and confirms the original settings remain unchanged.
File Description
python/​tests/​unit/​connectors/​ai/​nvidia/​services/​test_nvidia_text_embedding.py Adds request-level regression coverage using an offline HTTP transport.
python/​semantic_kernel/​connectors/​ai/​nvidia/​services/​nvidia_text_embedding.py Deep-copies execution settings to isolate per-call mutations.

Review effort: Balanced

This branch was previously deployed

1 inactive deployment
github-app-auth — 0ede2d84 Deployed Nov 22, 2026 by Twiink via add_label #29794
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants