Skip to content
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

Python: Bug: Chat Completion Agent with Open AI reasoning models is not working out of the box #11105

Closed
wmaciek opened this issue Mar 21, 2025 · 1 comment · May be fixed by #11110
Closed
Assignees
Labels
python Pull requests for the Python Semantic Kernel

Comments

@wmaciek
Copy link

wmaciek commented Mar 21, 2025

Describe the bug
Can't use Open AI o1-preview model with ChatCompletionAgent, just like in issue #10272, because it fails with the following exception.

Microsoft.SemanticKernel.HttpOperationException: HTTP 400 (invalid_request_error: unsupported_value)

Microsoft.SemanticKernel.HttpOperationException
HTTP 400 (invalid_request_error: unsupported_value)
Parameter: messages[0].role

Unsupported value: 'messages[0].role' does not support 'system' with this model.

To Reproduce
Steps to reproduce the behavior:

  1. Create ChatCompletionAgent from semantic_kernel.agents with o1/o3-mini model deployment:
agent = ChatCompletionAgent(
            service_id=...,
            kernel=...,
            name=...,
            instructions=...,
            description=...,
            arguments=...,
        )
  1. Invoke created agent:
    agent.invoke(...)

Expected behavior
It should work, like in corrected .NET version

Screenshots

Platform

  • Language: Python
  • Source: semantic-kernel==1.20.0, openai==1.66.2
  • AI model: OpenAI:GPT o-.. reasoning models
  • OS: any

Additional context

@wmaciek wmaciek added the bug Something isn't working label Mar 21, 2025
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code python Pull requests for the Python Semantic Kernel triage labels Mar 21, 2025
@github-actions github-actions bot changed the title Python: Bug: Chat Completion Agent with Open AI reasoning models is not working out of the box .Net: Python: Bug: Chat Completion Agent with Open AI reasoning models is not working out of the box Mar 21, 2025
@eavanvalkenburg
Copy link
Member

@wmaciek It does require a specific setup, so created a sample to demonstrate, see the linked PR.

@eavanvalkenburg eavanvalkenburg removed bug Something isn't working .NET Issue or Pull requests regarding .NET code triage labels Mar 21, 2025
@eavanvalkenburg eavanvalkenburg self-assigned this Mar 21, 2025
@eavanvalkenburg eavanvalkenburg changed the title .Net: Python: Bug: Chat Completion Agent with Open AI reasoning models is not working out of the box Python: Bug: Chat Completion Agent with Open AI reasoning models is not working out of the box Mar 21, 2025
@wmaciek wmaciek closed this as completed Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Pull requests for the Python Semantic Kernel
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants