The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
Ensure detector-id is passed as header to IBM detector server (#16649)
Rob Geadad35d9008c961
diff --git a/litellm/proxy/guardrails/guardrail_hooks/ibm_guardrails/ibm_detector.py b/litellm/proxy/guardrails/guardrail_hooks/ibm_guardrails/ibm_detector.pyindex 72e0b3f013c..c61ef3334cb 100644--- a/litellm/proxy/guardrails/guardrail_hooks/ibm_guardrails/ibm_detector.py+++ b/litellm/proxy/guardrails/guardrail_hooks/ibm_guardrails/ibm_detector.py@@ -127,13 +127,9 @@ class IBMGuardrailDetector(CustomGuardrail):headers = {"Authorization": f"Bearer {self.auth_token}","content-type": "application/json",+ "detector-id": self.detector_id,}- query_params = {"detector_id": self.detector_id}-- # update the api_url with the query params- self.api_url = f"{self.api_url}?{urlencode(query_params)}"-verbose_proxy_logger.debug("IBM Detector Server request to %s with payload: %s",self.api_url,diff --git a/scripts/mock_ibm_guardrails_server.py b/scripts/mock_ibm_guardrails_server.pyindex 9850b62747d..a9251c14cef 100644--- a/scripts/mock_ibm_guardrails_server.py+++ b/scripts/mock_ibm_guardrails_server.py@@ -234,8 +234,8 @@ async def root():@app.post("/api/v1/text/contents")async def text_detection(- detector_id: str, # query parameterrequest: TextDetectionRequest,+ detector_id: str = Header(None), # query parameterauthorization: Optional[str] = Header(None),):"""@@ -243,6 +243,7 @@ async def text_detection(Args:request: Detection request with content and detector ID+ detector_id: ID of detectorauthorization: Bearer token for authenticationReturns: