Merge branch 'hiddenlayer-guardrail-integration-update' of https://github.com/Ashton-Sidhu/litellm into hiddenlayer-guardrail-integration-update

This commit is contained in:
Ashton Sidhu 2026-03-19 10:25:47 -04:00
commit b3a489825c

View file

@ -409,7 +409,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