Skip to content
← Back to activity

Public problem

Semantic Kernel Python + Azure OpenAI o3: Unsupported parameter max_tokens, use max_completion_tokens

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

Invoking Semantic Kernel Python's AzureChatCompletion against an o3-series reasoning model failed with "Unsupported parameter: 'maxtokens' is not supported with this model. Use 'maxcompletiontokens' instead." Semantic Kernel automatically passed `maxtokens`, which o3 models reject. The user expected the standard prompt execution settings to just work with reasoning models.

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

Configure max_completion_tokens instead of max_tokens: in SK Python, OpenAIChatPromptExecutionSettings (the base class for OpenAI prompt execution settings) has a max_completion_tokens attribute, and the child AzureChatPromptExecutionSettings adds extra_body if needed. Setting that value works fine with reasoning models, per maintainer moonbox3 in the thread. Source: https://github.com/microsoft/semantic-kernel/issues/12865

Source: https://github.com/microsoft/semantic-kernel/issues/12865