Python: Properly configure structured outputs based on new options dict (#3213)

* Properly configure structured outputs based on new options dict

* Fix mypy
This commit is contained in:
Evan Mattson
2026-01-15 11:41:46 +09:00
committed by GitHub
Unverified
parent 620da7a829
commit 15d0c34d9f
18 changed files with 56 additions and 55 deletions
@@ -162,7 +162,7 @@ def create_spam_detection_agent() -> ChatAgent:
"You are a spam detection assistant that identifies spam emails. "
"Always return JSON with fields is_spam (bool) and reason (string)."
),
response_format=DetectionResultAgent,
default_options={"response_format": DetectionResultAgent},
# response_format enforces structured JSON from each agent.
name="spam_detection_agent",
)
@@ -176,7 +176,7 @@ def create_email_assistant_agent() -> ChatAgent:
"Return JSON with a single field 'response' containing the drafted reply."
),
# response_format enforces structured JSON from each agent.
response_format=EmailResponse,
default_options={"response_format": EmailResponse},
name="email_assistant_agent",
)