Problem/Motivation
When using model o4-mini the following error message is displayed:
Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead.
Steps to reproduce
Go to chat API explore here /admin/config/ai/explorers/chat_generator
Choose o4-mini model
Try to run a request
Proposed resolution
Use the same workaround as for o1 and o3 models
Issue fork ai_provider_openai-3593313
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
a.dmitriiev commentedComment #4
a.dmitriiev commentedAdded the fix to pass the correct parameter. Be aware that o4-mini supports only one value for temperature parameter and it is 1.
Comment #5
ahmad khader commentedComment #6
ahmad khader commentedThanks @a.dmitriiev, Looks good to me.
I updated the comment as well
Comment #8
a.dmitriiev commented