Repository navigation
Python: OpenAI Chat Client - fix max tokens trasnslation and extra int test - #3037
Merged
Eduard van Valkenburg (eavanvalkenburg) merged 1 commit intoJan 5, 2026
Conversation
Eduard van Valkenburg (eavanvalkenburg)
enabled auto-merge
December 24, 2025 15:24
Copilot started reviewing on behalf of
Eduard van Valkenburg (eavanvalkenburg)
December 24, 2025 15:25
Contributor
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request fixes issue #3025 by correcting the translation of the max_tokens parameter in the OpenAI chat client implementation. The key change updates the parameter mapping from max_output_tokens to max_completion_tokens to align with the OpenAI API specification.
Key Changes:
- Corrected parameter translation from
max_output_tokenstomax_completion_tokensin the chat client - Added an integration test to validate chat completion with custom chat options including max_tokens
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
python/packages/core/agent_framework/openai/_chat_client.py |
Fixed the translation mapping for max_tokens parameter from max_output_tokens to max_completion_tokens |
python/packages/core/tests/openai/test_openai_chat_client.py |
Added new integration test test_openai_chat_completion_response_params to validate chat completions with custom options (max_tokens, temperature, top_p) |
Dmytro Struk (dmytrostruk)
approved these changes
Dec 26, 2025
Eduard van Valkenburg (eavanvalkenburg)
force-pushed
the
fix_oai
branch
from
January 4, 2026 10:42
1005b4b to
ff8b4a5
Compare
Evan Mattson (moonbox3)
approved these changes
Jan 5, 2026
Motivation and Context
Fixes #3025
Correctly translates
max_tokensto the newmax_completion_tokensvariable and adds a integration test that validates that.Description
Contribution Checklist