Python: fix: correct BadRequestError when using Pydantic model in response_fo… (#1843)

* fix: correct BadRequestError when using Pydantic model in response_format

* Fix lint

---------

Co-authored-by: Evan Mattson <evan.mattson@microsoft.com>
This commit is contained in:
samueljohnsiby
2025-12-18 14:12:00 +05:30
committed by GitHub
Unverified
parent ca1532cf22
commit 0298e0a401
@@ -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] = []