Skip to content

bug: content blocked for any user query by content safety check #1299

@venki-lfc

Description

@venki-lfc

Did you check docs and existing issues?

  • I have read all the NeMo-Guardrails docs
  • I have updated the package to the latest version before submitting this issue
  • (optional) I have used the develop branch
  • I have searched the existing issues of NeMo-Guardrails

Python version (python --version)

Python 3.11

Operating system/version

Windows

NeMo-Guardrails version (if you must use a specific version and not the latest

No response

Describe the bug

Hi, I am getting content blocked message even for greetings like "Hi!" I used the config/config.yml from
https://docs.nvidia.com/nemo/guardrails/latest/getting-started.html# and the config/prompts.yml using https://docs.nvidia.com/nemo/guardrails/latest/_downloads/581b1286b50c732ffcf3928197e66b67/prompts.yml

My test script looks like the following:

import asyncio
import os

os.environ["NVIDIA_API_KEY"] = # The Nvidia API Key here

from nemoguardrails import LLMRails, RailsConfig

config = RailsConfig.from_path("./config")
rails = LLMRails(config)

async def stream_response(messages):
    async for chunk in rails.stream_async(messages=messages):
        print(chunk, end="")
    print()

messages=[{
    "role": "user",
    "content": "Hi"
}]

asyncio.run(stream_response(messages))

The response I am getting is:
It's lovely to meet you. I hope you're having a fantastic day so far. My name is Assistron, by the way - I'm an AI designed to assist and communicate with users in a helpful and friendly manner. I can provide information on a wide range of topics, from science and history to entertainment and culture. If you're feeling stuck or need some inspirat{"error": {"message": "Blocked by content safety check output $model=content_safety rails.", "type": "guardrails_violation", "param": "content safety check output $model=content_safety", "code": "content_blocked"}}

What am I doing wrong here?

Steps To Reproduce

Use the config and prompts files from the links provided and run the script above

Expected Behavior

The content is not blocked for greetings and queries which are not harmful

Actual Behavior

Every single query is blocked whether its good or bad

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingstatus: cannot reproducestatus: needs infoIssues that require more information from the reporter to proceed.status: needs triageNew issues that have not yet been reviewed or categorized.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions