max_completion_tokens (and max_tokens) param in ChatOpenAI() can't be processed by OpenAI() object #28943
Open
5 tasks done
Labels
🤖:bug
Related to a bug, vulnerability, unexpected error with an existing feature
investigate
Flagged for investigation.
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
Description
I'm trying to use langchain ChatOpenAI() object with max_completion_tokens parameter initialized. Since September 2024, the max_tokens parameter is deprecated in favor of max_completion_tokens. The change was made in langchain but for now, it has not been done in the OpenAI Python library.
When I pass max_completion_tokens parameter, an error is raised because extra parameter is forbidden when we create OpenAI() object (from the OpenAI Python library).
I know, it's not a bug from the langchain library strictly speaking. But while waiting for the OpenAI library to make the change, is it possible to mitigate the problem? Because, for now, the feature is unavailable.
System Info
System Information
Package Information
Optional packages not installed
Other Dependencies
The text was updated successfully, but these errors were encountered: