mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-15 18:21:44 +00:00
* [Feat] Add model parameter to Generic Guardrail API Add model information to guardrail requests, allowing guardrails to make model-specific security decisions. Changes: - Add `model` field to GenericGuardrailAPIInputs TypedDict - Add `model` field to GenericGuardrailAPIRequest Pydantic model - Update OpenAI and Anthropic handlers to pass model from request/response - Add unit tests for model parameter handling * [Feat] Add model parameter to all guardrail_translation handlers Extend model parameter support to all guardrail handlers for consistent implementation across all endpoint types: - OpenAI Responses API (input/output + streaming) - OpenAI Image Generation (input only) - OpenAI Text Completion (input/output) - OpenAI Text-to-Speech (input only) - OpenAI Audio Transcription (output only) - Cohere Rerank (input only) - Pass-through Endpoints (input/output) - MCP Server (input only) This addresses the review feedback requesting consistent model parameter handling across all guardrail_translation/handler.py files. --------- Co-authored-by: Igal Boxerman <igal@pillar.security>