mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
Fix pipeline executor: inject guardrail name into metadata so should_run_guardrail allows execution
This commit is contained in:
parent
d74542a78a
commit
7269d9a612
1 changed files with 5 additions and 0 deletions
|
|
@ -148,6 +148,11 @@ class PipelineExecutor:
|
|||
return ("error", None, f"Guardrail '{step.guardrail}' not found")
|
||||
|
||||
try:
|
||||
# Inject guardrail name into metadata so should_run_guardrail() allows it
|
||||
if "metadata" not in data:
|
||||
data["metadata"] = {}
|
||||
data["metadata"]["guardrails"] = [step.guardrail]
|
||||
|
||||
# Use unified_guardrail path if callback implements apply_guardrail
|
||||
target = callback
|
||||
use_unified = "apply_guardrail" in type(callback).__dict__
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue