OpenAI deprecated parameters #10

Closed
opened 2026-02-16 10:17:45 -05:00 by yindo · 1 comment
Owner

Originally created by @alterxyz on GitHub (Feb 19, 2025).

As per the official OpenAI API documentation, the max_tokens parameter for chat completion is now deprecated in favor of max_completion_tokens. Furthermore, max_tokens is explicitly stated as not compatible with o1 series models and future reasoning models.

To ensure compatibility with the latest OpenAI models, including the o1 series and all future reasoning models, we need to update the OpenAI provider card in Dify.

We should modify the llm.py file within the OpenAI provider card (dify-official-plugins/models/openai/llm.py) to replace the usage of the deprecated max_tokens parameter with max_completion_tokens.

This update is crucial for maintaining compatibility and leveraging the full capabilities of OpenAI's evolving model ecosystem within Dify.


In addition, we should think out of some ways and implement both forward and backward compatible for openai_api_compatible provider card and Azure series.

There is more than one parameters are marked as Deprecated. openai_api_compatible is a common standard. Some model providers may or may not support those new parameters. We will need to consider provide options or automatically identify types when initializing the model.


Ref: OpenAI Chat API Documentation - max_tokens Parameter

Originally created by @alterxyz on GitHub (Feb 19, 2025). As per the official OpenAI API documentation, the `max_tokens` parameter for chat completion is now **deprecated** in favor of `max_completion_tokens`. Furthermore, `max_tokens` is explicitly stated as **not compatible with o1 series models and future reasoning models.** To ensure compatibility with the latest OpenAI models, including the o1 series and **all future reasoning models**, we need to update the OpenAI provider card in Dify. We should modify the `llm.py` file within the OpenAI provider card (`dify-official-plugins/models/openai/llm.py`) to replace the usage of the deprecated `max_tokens` parameter with `max_completion_tokens`. This update is crucial for maintaining compatibility and leveraging the full capabilities of OpenAI's evolving model ecosystem within Dify. --- In addition, we should think out of some ways and implement both forward and backward compatible for [openai_api_compatible provider card](https://github.com/langgenius/dify-official-plugins/tree/main/models/openai_api_compatible) and Azure series. There is more than one parameters are marked as `Deprecated`. `openai_api_compatible` is a common standard. Some model providers may or may not support those new parameters. We will need to consider provide options or automatically identify types when initializing the model. --- Ref: [OpenAI Chat API Documentation - `max_tokens` Parameter](https://platform.openai.com/docs/api-reference/chat/create#chat-create-max_tokens)
yindo closed this issue 2026-02-16 10:17:45 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Aug 16, 2025):

Hi, @alterxyz. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported that OpenAI's max_tokens parameter is deprecated in favor of max_completion_tokens for o1 series and future models.
  • You requested updates to Dify's OpenAI provider card (llm.py) to replace deprecated parameters.
  • You also suggested adding forward and backward compatibility in the openai_api_compatible and Azure provider cards to handle different parameter support across models.
  • There has been no further activity or comments on this issue since your initial report.

Next Steps:

  • Please let me know if this issue is still relevant with the latest version of the dify-official-plugins repository by commenting here to keep the discussion open.
  • Otherwise, I will automatically close this issue in 5 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Aug 16, 2025): Hi, @alterxyz. I'm [Dosu](https://dosu.dev), and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported that OpenAI's `max_tokens` parameter is deprecated in favor of `max_completion_tokens` for o1 series and future models. - You requested updates to Dify's OpenAI provider card (`llm.py`) to replace deprecated parameters. - You also suggested adding forward and backward compatibility in the `openai_api_compatible` and Azure provider cards to handle different parameter support across models. - There has been no further activity or comments on this issue since your initial report. **Next Steps:** - Please let me know if this issue is still relevant with the latest version of the dify-official-plugins repository by commenting here to keep the discussion open. - Otherwise, I will automatically close this issue in 5 days. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#10