mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-14 23:21:35 +00:00
fix(guardrails): address greptile review - guard input_type kwarg presence, add str to guardrail_mode type
This commit is contained in:
parent
e30870c262
commit
bb81b1dae0
2 changed files with 2 additions and 2 deletions
|
|
@ -1129,7 +1129,7 @@ def log_guardrail_information(func):
|
|||
"async_post_call_streaming_hook",
|
||||
):
|
||||
return GuardrailEventHooks.post_call
|
||||
elif func_name == "apply_guardrail" and kwargs:
|
||||
elif func_name == "apply_guardrail" and kwargs and "input_type" in kwargs:
|
||||
input_type = kwargs.get("input_type")
|
||||
if input_type == "request":
|
||||
return GuardrailEventHooks.pre_call
|
||||
|
|
|
|||
|
|
@ -2698,7 +2698,7 @@ GuardrailStatus = Literal["success", "guardrail_intervened", "guardrail_failed_t
|
|||
class StandardLoggingGuardrailInformation(TypedDict, total=False):
|
||||
guardrail_name: Optional[str]
|
||||
guardrail_provider: Optional[str]
|
||||
guardrail_mode: Optional[Union[GuardrailEventHooks, List[GuardrailEventHooks], GuardrailMode]]
|
||||
guardrail_mode: Optional[Union[GuardrailEventHooks, List[GuardrailEventHooks], GuardrailMode, str]]
|
||||
guardrail_request: Optional[Union[str, dict]]
|
||||
guardrail_response: Optional[Union[dict, str, List[dict]]]
|
||||
guardrail_status: GuardrailStatus
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue