Skip to content

Update deprecated max_tokens to max_completion_tokens#170

Open
GitPaulo wants to merge 2 commits intoactions:mainfrom
GitPaulo:gitpaulo/update-deprecated-max-tokens
Open

Update deprecated max_tokens to max_completion_tokens#170
GitPaulo wants to merge 2 commits intoactions:mainfrom
GitPaulo:gitpaulo/update-deprecated-max-tokens

Conversation

@GitPaulo
Copy link
Contributor

@GitPaulo GitPaulo commented Feb 4, 2026

Description

This PR updates the naming of the max_tokens parameter to max_completion_tokens throughout the codebase and related tests to align with the latest OpenAI API changes.

Related Issues: #116

@GitPaulo GitPaulo requested a review from a team as a code owner February 4, 2026 21:31
Copilot AI review requested due to automatic review settings February 4, 2026 21:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_tokens to max_completion_tokens in 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.

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.

1 participant