You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f33d492
Browse filesBrowse the repository at this point in the historyBrowse files
refactor: unify output_schema routing and avoid duplicate validation
Previously, `basic.py` and `_schema.py` maintained mirrored boolean checks to decide whether `output_schema` could be passed natively in `LlmRequest.config` or required the `set_model_response` tool workaround. Additionally, structured model outputs were validated and deserialized up to three times across `check_and_handle_output_schema`, `LlmAgent.__maybe_save_output_to_state`, and `Workflow` node execution (`process_llm_agent_output`).
- Extract `can_set_native_output_schema` in `flows/llm_flows/prompt/_schema.py` as the single source of truth for both `basic.py` and `_OutputSchemaRequestProcessor`.
- Preserve the already-validated payload via `_validated_output` on the `Event` across `create_final_model_response_event`, `LlmAgent.__maybe_save_output_to_state`, and `process_llm_agent_output` so `output_schema` validation is not duplicated on the same response event.
Co-authored-by: Shangjie Chen <[email protected]>
PiperOrigin-RevId: 983562218
0 commit comments