mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-22 01:55:27 -04:00
OpenAI deprecated parameters #10
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @alterxyz on GitHub (Feb 19, 2025).
As per the official OpenAI API documentation, the
max_tokensparameter for chat completion is now deprecated in favor ofmax_completion_tokens. Furthermore,max_tokensis 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.pyfile within the OpenAI provider card (dify-official-plugins/models/openai/llm.py) to replace the usage of the deprecatedmax_tokensparameter withmax_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_compatibleis 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_tokensParameter@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:
max_tokensparameter is deprecated in favor ofmax_completion_tokensfor o1 series and future models.llm.py) to replace deprecated parameters.openai_api_compatibleand Azure provider cards to handle different parameter support across models.Next Steps:
Thank you for your understanding and contribution!