mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-11 03:38:38 +00:00
fix(guardrails): keep AktoGuardrail positional args backward compatible
This commit is contained in:
parent
918336eb01
commit
abf7679a16
2 changed files with 8 additions and 2 deletions
|
|
@ -268,12 +268,13 @@ class AktoGuardrail(CustomGuardrail):
|
|||
akto_api_key: str | None = None,
|
||||
akto_account_id: str | None = None,
|
||||
akto_vxlan_id: str | None = None,
|
||||
unreachable_fallback: Literal["fail_closed", "fail_open"] = "fail_closed",
|
||||
guardrail_timeout: int | None = None,
|
||||
*,
|
||||
context_source: Literal["ENDPOINT", "AGENTIC"] | None = None,
|
||||
akto_metadata: Mapping[str, object] | None = None,
|
||||
streaming_sampling_rate: int | None = None,
|
||||
guardrail_timeout: int | None = None,
|
||||
file_guardrail_timeout: int | None = None,
|
||||
unreachable_fallback: Literal["fail_closed", "fail_open"] = "fail_closed",
|
||||
async_handler: AsyncHTTPHandler | None = None,
|
||||
**kwargs: Unpack[_CustomGuardrailKwargs],
|
||||
) -> None:
|
||||
|
|
|
|||
|
|
@ -156,6 +156,11 @@ def test_init_defaults():
|
|||
assert g.akto_vxlan_id == "0"
|
||||
|
||||
|
||||
def test_positional_args_keep_their_original_meaning():
|
||||
g = AktoGuardrail("http://localhost:9090", "test-token", "7", "8", "fail_open", 9, async_handler=_handler())
|
||||
assert (g.unreachable_fallback, g.guardrail_timeout) == ("fail_open", 9)
|
||||
|
||||
|
||||
def test_build_akto_payload_format(akto_pre_call, sample_inputs, sample_request_data):
|
||||
payload = akto_pre_call.build_akto_payload(sample_inputs, sample_request_data, include_response=False)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue