-
Notifications
You must be signed in to change notification settings - Fork 568
docs: add multilingual refusal messages documentation #1541
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
base: develop
Are you sure you want to change the base?
Conversation
Add documentation for the multilingual refusal messages feature in content safety rails, including: - Supported languages table with default messages - Basic and advanced configuration examples - Language detection behavior and accuracy benchmarks - Cold start behavior and caching details - Production considerations for container environments
Documentation preview |
Greptile OverviewGreptile SummaryAdds comprehensive documentation for a new multilingual refusal messages feature in content safety rails. The documentation includes:
Key Concern: This documentation references code that does not yet exist in the codebase:
This PR appears to document PR #1530's feature before that PR has been merged. Ensure the feature implementation is merged first, or merge both PRs together.
|
| Filename | Score | Overview |
|---|---|---|
| docs/configure-rails/yaml-schema/guardrails-configuration/built-in-guardrails.md | 3/5 | Adds documentation for multilingual refusal messages feature with supported languages table, configuration examples, and cold start behavior. References pip install nemoguardrails[multilingual] extra that is not yet defined in pyproject.toml. |
Sequence Diagram
sequenceDiagram
participant User
participant Config as config.yml
participant NeMo as NeMo Guardrails
participant LangDetect as fast-langdetect
participant SafetyModel as Content Safety Model
User->>NeMo: Send message (any language)
NeMo->>Config: Check multilingual.enabled
alt multilingual enabled
NeMo->>LangDetect: detect_language(user_input)
LangDetect-->>NeMo: language code (e.g., "es")
end
NeMo->>SafetyModel: content_safety_check_input
SafetyModel-->>NeMo: {allowed: false, policy_violations: [...]}
alt content blocked & multilingual enabled
NeMo->>NeMo: Get refusal_message[detected_language]
NeMo-->>User: Localized refusal message
else content blocked & multilingual disabled
NeMo-->>User: Default English refusal
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 file reviewed, 1 comment
Add documentation for (#1530) the multilingual refusal messages feature in content safety rails, including: