Describe the Bug
It seems for these models a breaking change happened sillently and the correct key would be max_completion_tokens
https://github.com/langchain-ai/langchainjs/blob/main/libs/langchain-openai/src/chat_models.ts#L2355
(permanent link: https://github.com/langchain-ai/langchainjs/blob/b8ffc1e613cf5a469127ed57195053f18d29b297/libs/langchain-openai/src/chat_models.ts#L2363)
Also noticed that these models seem to treat roles differently
https://github.com/langchain-ai/langchainjs/blob/main/libs/langchain-openai/src/chat_models.ts#L363
(permanent link: https://github.com/langchain-ai/langchainjs/blob/b8ffc1e613cf5a469127ed57195053f18d29b297/libs/langchain-openai/src/chat_models.ts#L366C4-L369C1)
Steps to Reproduce
n/a
Expected Behavior
max_tokens to be forwarded under the correct key
Screenshots
No response
Used Versions
- Node version via
node -v: ...
- NPM version via `npm -v: ...
- SAP Cloud SDK for AI version:
Code Examples
No response
Log File
No response
Region
EU10
Affected Development Phase
Getting Started
Impact
No Impact
Timeline
No response
Additional Context
No response
Describe the Bug
It seems for these models a breaking change happened sillently and the correct key would be max_completion_tokens
https://github.com/langchain-ai/langchainjs/blob/main/libs/langchain-openai/src/chat_models.ts#L2355(permanent link: https://github.com/langchain-ai/langchainjs/blob/b8ffc1e613cf5a469127ed57195053f18d29b297/libs/langchain-openai/src/chat_models.ts#L2363)
Also noticed that these models seem to treat roles differently
https://github.com/langchain-ai/langchainjs/blob/main/libs/langchain-openai/src/chat_models.ts#L363(permanent link: https://github.com/langchain-ai/langchainjs/blob/b8ffc1e613cf5a469127ed57195053f18d29b297/libs/langchain-openai/src/chat_models.ts#L366C4-L369C1)
Steps to Reproduce
n/a
Expected Behavior
max_tokens to be forwarded under the correct key
Screenshots
No response
Used Versions
node -v: ...Code Examples
No response
Log File
No response
Region
EU10
Affected Development Phase
Getting Started
Impact
No Impact
Timeline
No response
Additional Context
No response