Skip to content

Commit e52790b

Browse files
committed
fix: ManagerSelectionResponse JSON Schema for OpenAI Structured Output Strict Mode
1 parent b391088 commit e52790b

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

python/packages/core/agent_framework/_workflows/_group_chat.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,13 @@ class ManagerSelectionResponse(BaseModel):
131131
final_message: Optional final message string when finishing conversation (will be converted to ChatMessage)
132132
"""
133133

134-
model_config = {"extra": "forbid"}
134+
model_config = {
135+
"extra": "forbid",
136+
# OpenAI strict mode requires all properties to be in required array
137+
"json_schema_extra": {
138+
"required": ["selected_participant", "instruction", "finish", "final_message"]
139+
},
140+
}
135141

136142
selected_participant: str | None = None
137143
instruction: str | None = None

0 commit comments

Comments
 (0)