Fix: Resolve Content Safety Model Resolution Issue #1368
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.
🐛 Problem Description
The content safety actions were failing with the following error:
🔍 Root Cause Analysis
The issue occurred in the
get_task_model
function innemoguardrails/llm/prompts.py
. When content safety actions were called with task names likecontent_safety_check_input $model=content_safety
, the system was:nvidia/llama-3_3-nemotron-super-49b-v1_5
) instead of the specified content safety model$model=content_safety
part of the task name🛠️ Solution
Updated the
get_task_model
function to properly handle task names with model specifications:$model=
specificationscontent_safety
fromcontent_safety_check_input $model=content_safety
)✅ Changes Made
🧪 Testing
🔧 Configuration Example
This fix enables proper functioning of configurations like:
🚀 Impact
Before: Content safety actions failed with confusing error messages
After: Content safety actions work as expected with proper model resolution
This is a non-breaking bug fix that improves the user experience for content safety workflows.