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
This commit is contained in:
Kurt
2025-12-11 10:34:12 +08:00
committed by GitHub
Unverified
parent 191779ce80
commit 4c6a5d4aa1
@@ -132,7 +132,11 @@ class ManagerSelectionResponse(BaseModel):
final_message: Optional final message string when finishing conversation (will be converted to ChatMessage)
"""
model_config = {"extra": "forbid"}
model_config = {
"extra": "forbid",
# OpenAI strict mode requires all properties to be in required array
"json_schema_extra": {"required": ["selected_participant", "instruction", "finish", "final_message"]},
}
selected_participant: str | None = None
instruction: str | None = None