8000 fix(config): correct dialog rails activation logic by Pouyanpi · Pull Request #1161 · NVIDIA/NeMo-Guardrails · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix(config): correct dialog rails activation logic #1161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 5, 2025

Conversation

Pouyanpi
Copy link
Collaborator

Description

Fixed the has_dialog_rails logic in RailsConfig to require both user_messages and bot_messages for implicit activation. Removed flows from the condition to align with expected behavior.

test(config): adjust tests for updated dialog rails logic

Modified test cases to reflect the corrected dialog rails activation logic.

Related PR

#1137

Fixed the `has_dialog_rails` logic in `RailsConfig` to require both
`user_messages` and `bot_messages` for implicit activation. Removed
`flows` from the condition to align with expected behavior.

test(config): adjust tests for updated dialog rails logic

Modified test cases to reflect the corrected dialog rails activation
logic.
@Pouyanpi Pouyanpi self-assigned this Apr 29, 2025
@Pouyanpi Pouyanpi added this to the v0.14.0 milestone Apr 29, 2025
@Pouyanpi Pouyanpi requested a review from tgasser-nv April 29, 2025 19:38
@Pouyanpi Pouyanpi requested a review from trebedea May 1, 2025 09:09
@Pouyanpi Pouyanpi added bug Something isn't working enhancement New feature or request refactoring labels May 1, 2025
Copy link
Collaborator
@trebedea trebedea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Just a quick question. If we have only user canonical forms (user messages), don't we trigger the generate intent task if embeddings_only is not set to True? This would activate the dialogue rails.

@Pouyanpi
Copy link
Collaborator Author
Pouyanpi commented May 1, 2025

Looks good!

Just a quick question. If we have only user canonical forms (user messages), don't we trigger the generate intent task if embeddings_only is not set to True? This would activate the dialogue rails.

Thank you, @trebedea , for the review.

I ran into some issues because the generate_user_intent action doesn’t just generate the user intent (it also produces the bot message and passthrough). So, I wasn’t able to identify the correct mapping from the config to the dialog rails tasks to prevent this behavior while still allowing it when it’s explicitly removed at the task level.

Please let me know if there’s a way we can fix/improve this validation. We can also add tests in #1145 to ensure all scenarios are handled correctly. Thanks!

@Pouyanpi Pouyanpi force-pushed the fix/reasoning-traces-validation branch from 63a18a9 to 836008d Compare May 1, 2025 11:14
@trebedea
Copy link
Collaborator
trebedea commented May 2, 2025

Looks good!
Just a quick question. If we have only user canonical forms (user messages), don't we trigger the generate intent task if embeddings_only is not set to True? This would activate the dialogue rails.

Thank you, @trebedea , for the review.

I ran into some issues because the generate_user_intent action doesn’t just generate the user intent (it also produces the bot message and passthrough). So, I wasn’t able to identify the correct mapping from the config to the dialog rails tasks to prevent this behavior while still allowing it when it’s explicitly removed at the task level.

Please let me know if there’s a way we can fix/improve this validation. We can also add tests in #1145 to ensure all scenarios are handled correctly. Thanks!

Whenever we have any of user_messages, flows, or bot_messages in the config, we can consider has_dialog_rails is potentially True. In some cases, dialogue rails will not be triggered, e.g. if we have user_messages and embeddings_only is set to True.

@Pouyanpi Pouyanpi merged commit 9a70fca into develop May 5, 2025
10 checks passed
@Pouyanpi Pouyanpi deleted the fix/reasoning-traces-validation branch May 5, 2025 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0