Update litellm/proxy/guardrails/guardrail_hooks/hiddenlayer/hiddenlayer.py

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
Ashton Sidhu 2026-03-18 15:26:27 -04:00 committed by GitHub
parent fcb16d91af
commit 7afa6a01cc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -406,7 +406,7 @@ class HiddenlayerGuardrailV2(CustomGuardrail):
inputs["texts"] = new_texts
elif input_type == "response" and inputs.get("texts"):
inputs["texts"] = [output["choices"][-1]["message"]["content"]]
inputs["texts"] = [output.get("choices", [{}])[-1].get("message", {}).get("content", "")]
elif input_type == "response" and inputs.get("tool_calls"):
inputs["tool_calls"] = output