Skip to content

fix: OpenAIChatCompletionClient fails with Enum-based Structured Outputs on DeepSeek-Chat - #8058

Open
wooyongbin3-cpu wants to merge 1 commit into
microsoft:mainfrom
wooyongbin3-cpu:pr-bot/fix-7201
Open

fix: OpenAIChatCompletionClient fails with Enum-based Structured Outputs on DeepSeek-Chat#8058
wooyongbin3-cpu wants to merge 1 commit into
microsoft:mainfrom
wooyongbin3-cpu:pr-bot/fix-7201

Conversation

@wooyongbin3-cpu

Copy link
Copy Markdown

Auto-generated fix for #7201

What happened?

Describe the bug

OpenAIChatCompletionClient fails to handle structured outputs containing Enum fields when using the DeepSeek API, despite the same schema working in other frameworks like LangChain.

The failure results in an OpenAI BadRequestError (400), indicating a mismatch in how the response_format is constructed for compatible providers.

To Reproduce

Execute the following code

from enum import Enum
from pydantic import BaseModel, Field  
from autogen_agentchat.agents import AssistantAgent  
from autogen_ext.models.openai import OpenAIChatCompletionClient  
from autogen_core.models import ModelInfo 
import asyncio
import os
  
class CustomStatus(Enum):
    TODO = "To Do"
    SUCCESSFUL = "Successful"
    FAILED = "Failed"
    
    

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant