Skip to content

.Net: Bug: Property 'max_completion_tokens' not found on type 'Microsoft.SemanticKernel.Prompty.Core.PromptyModelParameters'. #12966

@sundium

Description

@sundium

Describe the bug
Using Prompty module with GPT 5o models that does not support max_tokens parameter anymore. The new parameter is max_completion_token.

Property 'max_comUnhandled exception. (Line: 12, Col: 5, Idx: 290) - (Line: 12, Col: 26, Idx: 311): Property 'max_completion_tokens' not found on type 'Microsoft.SemanticKernel.Prompty.Core.PromptyModelParameters'.

To Reproduce
Steps to reproduce the behavior:

  1. Specify max_completion_tokens as a model parameter in a prompty file.
    e.g.
    configuration: type: azure_openai azure_endpoint: ${env:AZURE_OPENAI_ENDPOINT} azure_deployment: ${env:AZURE_OPENAI_DEPLOYMENT} parameters: temperature: 1

  2. Create function from prompty.
    `
    var kernel = Kernel.CreateBuilder()
    .AddAzureOpenAIChatCompletion(deployment, endpoint, key)
    .Build();

var function = kernel.CreateFunctionFromPromptyFile("../basic.prompty");
3. Invoke function.var result = await function.InvokeAsync(kernel, kernelArguments);`

Expected behavior
Can invoke a GPT 5o series models.

Screenshots

Image

Platform

  • Language: C#
  • Source: Top-level Package
    `dotnet list package
    Requested Resolved

    Microsoft.SemanticKernel 1.22.0 1.22.0
    Microsoft.SemanticKernel.Prompty 1.23.0-alpha 1.23.0-alpha
    `

  • AI model: [e.g. OpenAI:GPT-5o-mini(2024-07-18)]
  • IDE: VS Code
  • OS: Windows, Mac

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

.NETIssue or Pull requests regarding .NET codebugSomething isn't workingneeds more infoAny issue that is requires more information from contributors

Type

Projects

Status

Bug

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions