Repository navigation
fix(py): simulate unsupported structured output constraints - #6523
harbinresearcher wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request implements a fallback mechanism for structured output generation when the underlying model does not natively support constraints, or when constraints are unsupported in the presence of tools. If native constraints are unavailable, it injects formatting instructions directly into the prompt messages and disables the native constraint flag. A comprehensive test suite has been added to verify this fallback behavior across various configurations. There are no review comments to address, and the changes look correct.
|
Closing as already resolved: Python SDK development has moved to https://github.com/genkit-ai/genkit-python, where simulated vs native constrained output handling landed in genkit-ai/genkit-python#85. |
Summary
Fixes genkit-ai/genkit-python#217.
supports.constrained='none', or'no-tools'with tools, simulate requested schema constraints using the formatter's instructions.False, and explicitoutput_constrained=False. Models with unknown capabilities keep their current behavior.Validation
test_transport_failure_logs_one_errorforce-flush timeout also fails on pristine main in this environment, including with localhost proxy bypass enabled. No telemetry or CI changes were made.git diff --checkpassed.Prepared with Codex assistance. The diff received a read-only review, and the checks above were run locally with Python 3.13 and locked dependencies.