-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add detailed explanations for failed assertions (#7)
* Add detailed explanations for failed assertions Fixes #2 Add detailed explanations for failed assertions using LLM. * Modify `intentguard/intentguard.py` to include a `_generate_explanation` method that generates detailed explanations for failed assertions using the LLM. * Update the `assert_code` method to call `_generate_explanation` when an assertion fails and include the explanation in the `AssertionError`. * Add a new prompt template `explanation_prompt` in `intentguard/prompts.py` for generating detailed explanations for failed assertions. * Update the existing test case `test_assert_code_false` in `tests/test_intentguard.py` to check for the presence of the explanation in the `AssertionError`. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/kdunee/intentguard/issues/2?shareId=XXXX-XXXX-XXXX-XXXX). * Update `explanation_prompt` template for failed condition * Correct the order of methods in the failed condition message * Update the output message to reflect the corrected order of methods * Add explanation generation for failed assertions * Add `_generate_explanation` method to generate detailed explanations for failed assertions using the LLM. * Modify `assert_code` method to call `_generate_explanation` when an assertion fails and include the explanation in the `AssertionError`. * Update `_send_completion_request` method to handle the new explanation generation prompt. * Import `explanation_prompt` from `prompts.py`. * code reformat * Mark the "Failed Assertion Explanations" task as completed in the roadmap.
- Loading branch information
Showing
4 changed files
with
79 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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