Skip to content

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

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

fix: generate openai compliant response_format payload with json_schema method#351
ktzsh wants to merge 2 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

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 missing name, additionalProperties, and required mismatch in response format

2 participants