From 0298e0a4015686887a751e8ead3408243765dccb Mon Sep 17 00:00:00 2001 From: samueljohnsiby <66901393+samueljohnsiby@users.noreply.github.com> Date: Thu, 18 Dec 2025 14:12:00 +0530 Subject: [PATCH] =?UTF-8?q?Python:=20fix:=20correct=20BadRequestError=20wh?= =?UTF-8?q?en=20using=20Pydantic=20model=20in=20response=5Ffo=E2=80=A6=20(?= =?UTF-8?q?#1843)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: correct BadRequestError when using Pydantic model in response_format * Fix lint --------- Co-authored-by: Evan Mattson --- .../core/agent_framework/openai/_assistants_client.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/packages/core/agent_framework/openai/_assistants_client.py b/python/packages/core/agent_framework/openai/_assistants_client.py index 319ad95231..38ad9eabb3 100644 --- a/python/packages/core/agent_framework/openai/_assistants_client.py +++ b/python/packages/core/agent_framework/openai/_assistants_client.py @@ -437,7 +437,10 @@ class OpenAIAssistantsClient(OpenAIConfigMixin, BaseChatClient): if chat_options.response_format is not None: run_options["response_format"] = { "type": "json_schema", - "json_schema": chat_options.response_format.model_json_schema(), + "json_schema": { + "name": chat_options.response_format.__name__, + "schema": chat_options.response_format.model_json_schema(), + }, } instructions: list[str] = []