Skip to content

Conversation

@Pouyanpi
Copy link
Collaborator

@Pouyanpi Pouyanpi commented Dec 12, 2025

Add documentation for (#1530) 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

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
@github-actions
Copy link
Contributor

Documentation preview

https://nvidia-nemo.github.io/Guardrails/review/pr-1541

@Pouyanpi Pouyanpi self-assigned this Dec 12, 2025
@Pouyanpi Pouyanpi added the documentation Improvements or additions to documentation label Dec 12, 2025
@Pouyanpi Pouyanpi added this to the 0.20.0 milestone Dec 12, 2025
@Pouyanpi Pouyanpi marked this pull request as ready for review December 12, 2025 15:51
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 12, 2025

Greptile Overview

Greptile Summary

Adds comprehensive documentation for a new multilingual refusal messages feature in content safety rails. The documentation includes:

  • Supported languages table (9 languages with default refusal messages)
  • Installation instructions via pip install nemoguardrails[multilingual]
  • Basic and advanced YAML configuration examples
  • Language detection behavior using the fast-langdetect library
  • Cold start behavior and caching considerations
  • Production deployment notes for containers

Key Concern: This documentation references code that does not yet exist in the codebase:

  • The multilingual pip extra is not defined in pyproject.toml
  • The detect_language action is not implemented
  • No multilingual-related code exists in nemoguardrails/library/content_safety/

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.

Confidence Score: 3/5

  • Documentation-only PR that is safe to merge, but references features not yet in the codebase which will cause user confusion.
  • Score of 3 reflects that while this is a documentation-only change with no runtime risk, the installation instructions (pip install nemoguardrails[multilingual]) will fail because the extra is not defined. The documentation describes functionality that doesn't exist yet.
  • The documentation file references nemoguardrails[multilingual] which doesn't exist. Coordinate with PR feat(content_safety): add support to auto select multilingual refusal bot messages #1530 for the feature implementation.

Important Files Changed

File Analysis

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
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a 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

Edit Code Review Agent Settings | Greptile

Comment on lines +559 to +561
```bash
pip install nemoguardrails[multilingual]
```
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: The multilingual extra is not defined in pyproject.toml. Running pip install nemoguardrails[multilingual] will currently produce a warning (pip 24+) or error because this extra doesn't exist.

Either add the extra to pyproject.toml with fast-langdetect as a dependency, or ensure PR #1530 (which presumably adds the feature implementation) is merged first/together with this documentation.

Prompt To Fix With AI
This is a comment left during a code review.
Path: docs/configure-rails/yaml-schema/guardrails-configuration/built-in-guardrails.md
Line: 559:561

Comment:
**logic:** The `multilingual` extra is not defined in `pyproject.toml`. Running `pip install nemoguardrails[multilingual]` will currently produce a warning (pip 24+) or error because this extra doesn't exist.

Either add the extra to pyproject.toml with `fast-langdetect` as a dependency, or ensure PR #1530 (which presumably adds the feature implementation) is merged first/together with this documentation.

How can I resolve this? If you propose a fix, please make it concise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants