-
Notifications
You must be signed in to change notification settings - Fork 15.5k
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
openai[patch]: use max_completion_tokens in place of max_tokens #26917
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
Integration tests pass: https://github.com/langchain-ai/langchain/actions/runs/11060036967 |
How soon should we expect these changes? |
@@ -435,7 +435,7 @@ class BaseChatOpenAI(BaseChatModel): | |||
"""Number of chat completions to generate for each prompt.""" | |||
top_p: Optional[float] = None | |||
"""Total probability mass of tokens to consider at each step.""" | |||
max_tokens: Optional[int] = None | |||
max_tokens: Optional[int] = Field(default=None, alias="max_completion_tokens") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to update azure openai as well? if someone is passing in max_completion_tokens to azure today this change will update so instead max_tokens is passed in
max_tokens
is deprecated: https://platform.openai.com/docs/api-reference/chat/create#chat-create-max_tokens