Skip to content

Commit 4c6a5d4

Browse files
authored
Python: fix: GroupChat ManagerSelectionResponse JSON Schema for OpenAI Structured Outpu… (#2750)
* fix: ManagerSelectionResponse JSON Schema for OpenAI Structured Output Strict Mode * refactor: install pre-commit then commit again
1 parent 191779c commit 4c6a5d4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

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

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

137141
selected_participant: str | None = None
138142
instruction: str | None = None

0 commit comments

Comments
 (0)