Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for max_completion_tokens in OpenAI chat options request #1411

Closed
dafriz opened this issue Sep 25, 2024 · 2 comments
Closed

Add support for max_completion_tokens in OpenAI chat options request #1411

dafriz opened this issue Sep 25, 2024 · 2 comments

Comments

@dafriz
Copy link
Contributor

dafriz commented Sep 25, 2024

New field max_completion_tokens added by OpenAI, is to set an upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens. Replaces max_tokens field which is now deprecated.

max_completion_tokens works on all models but max_tokens doesn't work on the new models - o1-mini etc

https://platform.openai.com/docs/api-reference/chat/create#chat-create-max_completion_tokens

@markpollack
Copy link
Member

max_tokens
Deprecated
integer or null

Optional
The maximum number of [tokens](https://platform.openai.com/tokenizer) that can be generated in the chat completion. This value can be used to control [costs](https://openai.com/api/pricing/) for text generated via API.

This value is now deprecated in favor of max_completion_tokens, and is not compatible with [o1 series models](https://platform.openai.com/docs/guides/reasoning).

for reference

@tzolov
Copy link
Contributor

tzolov commented Oct 1, 2024

resolved by f56ce20

@tzolov tzolov closed this as completed Oct 1, 2024
tzolov added a commit that referenced this issue Oct 1, 2024
…chat options

 - Add new option 'maxCompletionTokens' to spring.ai.openai.chat.options
 - Mark 'maxTokens' as deprecated
 - Update documentation to reflect these changes in OpenAI chat configuration

 Related to #1411 and #1412
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 a pull request may close this issue.

3 participants