mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-05 07:37:50 +00:00
Merge 81a5dc0ae2 into b9e3587721
This commit is contained in:
commit
799a3032a7
2 changed files with 21 additions and 0 deletions
|
|
@ -130,6 +130,15 @@ class GenericGuardrailAPIConfigModel(
|
|||
):
|
||||
"""Configuration parameters for the Generic Guardrail API guardrail"""
|
||||
|
||||
api_base: str | None = Field(
|
||||
default=None,
|
||||
description="Base URL of the guardrail service. Defaults to GENERIC_GUARDRAIL_API_BASE when omitted",
|
||||
)
|
||||
api_key: str | None = Field(
|
||||
default=None,
|
||||
description="API key sent to the guardrail service in the x-api-key header",
|
||||
)
|
||||
|
||||
optional_params: GenericGuardrailAPIOptionalParams | None = Field(
|
||||
default_factory=GenericGuardrailAPIOptionalParams,
|
||||
description="Optional parameters for the Generic Guardrail API guardrail",
|
||||
|
|
|
|||
|
|
@ -956,6 +956,18 @@ async def test_provider_specific_params_includes_embedding_toggle():
|
|||
assert field["default_value"] is False
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.parametrize("field_name", ("api_base", "api_key"))
|
||||
async def test_provider_specific_params_exposes_generic_guardrail_connection_fields(field_name: str) -> None:
|
||||
from litellm.proxy.guardrails.guardrail_endpoints import get_provider_specific_params
|
||||
|
||||
provider_params: Final = await get_provider_specific_params()
|
||||
field: Final = provider_params["generic_guardrail_api"][field_name]
|
||||
|
||||
assert field["type"] == "string"
|
||||
assert field["required"] is False
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_provider_specific_params_offers_forward_messages_as_sent_off_by_default():
|
||||
from litellm.proxy.guardrails.guardrail_endpoints import get_provider_specific_params
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue