Update deprecated max_tokens to max_completion_tokens#170
Open
GitPaulo wants to merge 2 commits intoactions:mainfrom
Open
Update deprecated max_tokens to max_completion_tokens#170GitPaulo wants to merge 2 commits intoactions:mainfrom
GitPaulo wants to merge 2 commits intoactions:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the OpenAI API parameter name from max_tokens to max_completion_tokens to support newer models like gpt-5-nano that require this updated parameter name according to OpenAI's latest API specifications.
Changes:
- Updated OpenAI chat completion request parameter from
max_tokenstomax_completion_tokensin both simple and MCP inference functions - Updated corresponding test expectations to verify the correct parameter name is used
- Regenerated compiled distribution file
Reviewed changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/inference.ts | Updated chat completion request parameters in simpleInference and mcpInference functions to use max_completion_tokens instead of max_tokens |
| dist/index.js | Updated compiled JavaScript output to reflect the parameter name change |
| tests/inference.test.ts | Updated test assertions to expect max_completion_tokens parameter in API call verifications |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Description
This PR updates the naming of the
max_tokensparameter tomax_completion_tokensthroughout the codebase and related tests to align with the latest OpenAI API changes.Related Issues: #116