fix: allow reasoning traces when embeddings_only is True#1170
Merged
fix: allow reasoning traces when embeddings_only is True#1170
Conversation
Refactors the dialog rails validation logic to properly respect the embeddings_only flag, allowing reasoning traces to be enabled when this flag is set to True. Adds tests to verify this behavior.
3e92060 to
a5ae1ca
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1170 +/- ##
========================================
Coverage 68.05% 68.06%
========================================
Files 161 161
Lines 15820 15822 +2
========================================
+ Hits 10767 10769 +2
Misses 5053 5053
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the reasoning traces validation logic to allow reasoning traces when the embeddings_only flag is True and adds tests to verify this behavior.
- Updates validation in RailsConfig to bypass dialog rails checks when embeddings_only is enabled.
- Adds new tests for scenarios where embeddings_only is set for both user and bot message flows.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/test_config_validation.py | Updates tests and adds new test cases to verify embeddings_only behavior. |
| nemoguardrails/rails/llm/config.py | Refactors dialog rails validation logic to respect the embeddings_only flag. |
Comments suppressed due to low confidence (2)
tests/test_config_validation.py:619
- [nitpick] The test function's docstring mentions bot messages, but the YAML configuration only specifies 'user_messages' with embeddings_only set. Clarify the test either by updating the YAML to include bot_messages or revising the docstring to match the configuration.
def test_reasoning_traces_with_bot_messages_embeddings_only():
nemoguardrails/rails/llm/config.py:1210
- [nitpick] The embeddings_only flag is only retrieved from the user_messages configuration. If there is an intention to support embeddings_only for bot messages as well, consider updating the logic accordingly or documenting the limitation.
embeddings_only = dialog_rails.get("user_messages", {}).get("embeddings_only", False)
Collaborator
Author
Thank you @trebedea ! |
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.
Refactors the dialog rails validation logic to properly respect the embeddings_only flag, allowing reasoning traces to be enabled when this flag is set to True. Adds tests to verify this behavior.
related to #1161 and #1137