We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a59921 commit cc2c33fCopy full SHA for cc2c33f
src/oss/langchain/guardrails.mdx
@@ -484,13 +484,7 @@ class SafetyGuardrailMiddleware(AgentMiddleware):
484
result = self.safety_model.invoke([{"role": "user", "content": safety_prompt}])
485
486
if "UNSAFE" in result.content:
487
- return {
488
- "messages": [{
489
- "role": "assistant",
490
- "content": "I cannot provide that response. Please rephrase your request."
491
- }],
492
- "jump_to": "end"
493
- }
+ last_message.content = "I cannot provide that response. Please rephrase your request."
494
495
return None
496
0 commit comments