feat: implement structured JSON schema for LLM response #26 - #30
Closed
devangpratap wants to merge 3 commits into
Closed
feat: implement structured JSON schema for LLM response #26#30devangpratap wants to merge 3 commits into
devangpratap wants to merge 3 commits into
Conversation
Expanded Nielsen's Heuristics mapping from H1-H3 to H1-H10 and added detailed descriptions for H4-H10. Updated future enhancements to specify phases for implementation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Following the documentation and roadmap updates in #24, this PR provides the necessary technical refactor to align the LLM evaluation pipeline with modern production standards. It resolves the mismatch between the enforced response format and the internal parsing logic.
Resolved Issue
Technical Changes
1. Structured JSON Enforcement
json_objectformat with a dedicatedjson_schemausingstrict: Truein_evaluate_with_llm().criterion_id,severity(enum),description,recommendation, andaffected_elements.2. Code Simplification & Cleanup
Critical Dependency Check
json_schemastrict mode, which requires OpenAI SDK v1.40.0+.openai>=1.3.7.requirements.txtto1.40.0to prevent runtime errors in older environments.Verification
app/services/heuristic_engine.py.