Skip to content

fix: generate openai compliant response_format payload with json_schema method#351

Open
ktzsh wants to merge 4 commits intodatabricks:mainfrom
ktzsh:main
Open

fix: generate openai compliant response_format payload with json_schema method#351
ktzsh wants to merge 4 commits intodatabricks:mainfrom
ktzsh:main

Conversation

@ktzsh
Copy link

@ktzsh ktzsh commented Feb 27, 2026

Attempts to fix #350

Copy link
Contributor

@jennsun jennsun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi thanks sm for the fix! Core changes look good, ran unit tests locally and saw failures (would have been caught by CI but also good to test on own first) -- could we revert the raw json schema definition and instead update the test to validate structural properties (see comments)?

can you also add test coverage to cover:

  • pydantic schema produces a valid response_format
  • raw dict schema produces a valid response_format
  • nested Pydantic model to validate $ref dereferencing?

@ktzsh
Copy link
Author

ktzsh commented Mar 2, 2026

@jennsun The test should now cover all nested, pydantic or raw json schema

@jennsun
Copy link
Contributor

jennsun commented Mar 2, 2026

@ktzsh ran workflow checks again

@ktzsh
Copy link
Author

ktzsh commented Mar 4, 2026

@jennsun can we please rerun the workflow checks

@ktzsh
Copy link
Author

ktzsh commented Mar 5, 2026

@jennsun these should pass now - we can try again please

@ktzsh ktzsh requested a review from jennsun March 5, 2026 03:35
@sunishsheth2009 sunishsheth2009 enabled auto-merge (squash) March 6, 2026 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: with_structured_output(method="json_schema") fails due to incorrect repsonse_format schema and hanlding of content for reasoning models

3 participants