Skip to content

Python: Send the NVIDIA nvext setting in extra_body - #14698

Open
Ali Zulfiqar (codewithfourtix) wants to merge 1 commit into
microsoft:mainfrom
codewithfourtix:fix/nvidia-nvext-extra-body
Open

Ali Zulfiqar (codewithfourtix) wants to merge 1 commit into
microsoft:mainfrom
codewithfourtix:fix/nvidia-nvext-extra-body

Conversation

@codewithfourtix

Copy link
Copy Markdown

Motivation and Context

NvidiaChatPromptExecutionSettings.nvext is dumped as a top-level argument of chat.completions.create(), so every request that sets it fails:

ServiceResponseException: ... service failed to complete the chat
caused by: TypeError: AsyncCompletions.create() got an unexpected keyword argument 'nvext'

Description

  • prepare_settings_dict() now sends nvext in extra_body, merged with the guided_json that response_format puts there. On a key clash, extra_body["nvext"] wins.
  • Removed the handler's copy of extra_body["nvext"]. model_dump() already includes extra_body, and the copy would overwrite the merged value.
  • Added two regression tests. The existing tests mock create() with a plain AsyncMock, which accepts any keyword, so they could not catch this.

Contribution Checklist

NvidiaChatPromptExecutionSettings.nvext was dumped as a top-level
argument of chat.completions.create(), which rejects it with a
TypeError, so every request that set nvext failed. Move it into
extra_body and merge it with the guided_json that response_format
puts there, and drop the handler's copy of extra_body["nvext"],
which would overwrite the merged value.
Copilot AI balanced review requested due to automatic review settings October 31, 2026 11:02

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@semantic-kernel-automation semantic-kernel-automation Bot added the python Pull requests for the Python Semantic Kernel label Oct 31, 2026

This branch was successfully deployed

1 active deployment
github-app-auth — 24d10e9e Deployed Oct 31, 2026 by codewithfourtix via add_label #29519
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Pull requests for the Python Semantic Kernel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants