Fix(agent-init): replace max_tokens with max_completion_tokens for connection check of Azure OpenAI service#9405
Conversation
️✔️Azure CLI Extensions Breaking Change Test
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
|
cc @yanzhudd |
|
There was a problem hiding this comment.
Pull Request Overview
This PR updates the Azure OpenAI provider to use the newer max_completion_tokens parameter instead of the deprecated max_tokens parameter for connection validation, aligning with the API version 2025-04-01-preview. The version is bumped from 1.0.0b10 to 1.0.0b11.
- Changed API parameter from
max_tokenstomax_completion_tokensin Azure OpenAI connection validation - Added TODO comment about leveraging litellm for connection checks
- Updated version and release history
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/aks-agent/setup.py | Bumps version from 1.0.0b10 to 1.0.0b11 |
| src/aks-agent/azext_aks_agent/agent/llm_providers/base.py | Adds TODO comment for future improvement to use litellm |
| src/aks-agent/azext_aks_agent/agent/llm_providers/azure_provider.py | Updates connection validation to use max_completion_tokens instead of max_tokens |
| src/aks-agent/HISTORY.rst | Documents the fix in release notes and fixes capitalization |
|
[Release] Update index.json for extension [ aks-agent-1.0.0b11 ] : https://dev.azure.com/msazure/One/_build/results?buildId=143173826&view=results |
Before this check, when validating gpt-5, it raises the following error, while it works for gpt-4.1 though.
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install wheel==0.30.0required)For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.jsonautomatically.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json.