mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
fix use guardrail for pre call hook
This commit is contained in:
parent
6e3f27cf69
commit
a8e192a868
4 changed files with 30 additions and 54 deletions
|
@ -393,7 +393,7 @@ class ProxyLogging:
|
|||
|
||||
try:
|
||||
for callback in litellm.callbacks:
|
||||
_callback: Optional[CustomLogger] = None
|
||||
_callback = None
|
||||
if isinstance(callback, str):
|
||||
_callback = litellm.litellm_core_utils.litellm_logging.get_custom_logger_compatible_class(
|
||||
callback
|
||||
|
@ -401,11 +401,7 @@ class ProxyLogging:
|
|||
else:
|
||||
_callback = callback # type: ignore
|
||||
|
||||
if (
|
||||
_callback is not None
|
||||
and isinstance(_callback, CustomGuardrail)
|
||||
and "pre_call_hook" in vars(_callback.__class__)
|
||||
):
|
||||
if _callback is not None and isinstance(_callback, CustomGuardrail):
|
||||
from litellm.types.guardrails import GuardrailEventHooks
|
||||
|
||||
if (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue