mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-18 04:44:37 +00:00
* feat(realtime guardrails): end_session_after_n_fails + Endpoint Settings wizard step Adds per-session violation thresholds and an optional endpoint-settings step to the guardrail wizard for /v1/realtime. Backend: - Add end_session_after_n_fails, on_violation, realtime_violation_message fields to BaseLitellmParams (no DB migration — stored in existing JSON column) - Store same fields on CustomGuardrail instance attrs - Pass through in litellm_content_filter initializer - Track _violation_count per RealTimeStreaming session; close backend_ws when on_violation=end_session OR violation count >= end_session_after_n_fails - Use realtime_violation_message as the spoken text (falls back to guardrail error string if not configured) UI (add_guardrail_form.tsx): - Rename "Default Categories" step to "Topics" - Add step 5 "Endpoint Settings (Optional)" for content filter guardrails - Call type dropdown shows /v1/realtime - Settings are in a collapsed accordion (closed by default) - "End session after X violations" + on_violation radio + spoken message field Tests: 2 new tests in test_realtime_streaming.py - test_end_session_after_n_fails_closes_connection - test_on_violation_end_session_closes_on_first_fail * fix(test): move inline imports to module level in realtime streaming tests * Update ui/litellm-dashboard/src/components/guardrails/add_guardrail_form.tsx Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| a2a_protocol | ||
| anthropic_interface | ||
| assistants | ||
| batch_completion | ||
| batches | ||
| caching | ||
| completion_extras | ||
| containers | ||
| endpoints/speech/speech_to_completion_bridge | ||
| evals | ||
| experimental_mcp_client | ||
| files | ||
| fine_tuning | ||
| google_genai | ||
| images | ||
| integrations | ||
| interactions | ||
| litellm_core_utils | ||
| llms | ||
| ocr | ||
| passthrough | ||
| proxy | ||
| proxy_auth | ||
| rag | ||
| realtime_api | ||
| rerank_api | ||
| responses | ||
| router_strategy | ||
| router_utils | ||
| search | ||
| secret_managers | ||
| skills | ||
| types | ||
| vector_store_files | ||
| vector_stores | ||
| videos | ||
| __init__.py | ||
| _lazy_imports.py | ||
| _lazy_imports_registry.py | ||
| _logging.py | ||
| _redis.py | ||
| _service_logger.py | ||
| _uuid.py | ||
| _version.py | ||
| anthropic_beta_headers_config.json | ||
| anthropic_beta_headers_manager.py | ||
| blog_posts.json | ||
| budget_manager.py | ||
| constants.py | ||
| cost.json | ||
| cost_calculator.py | ||
| exceptions.py | ||
| main.py | ||
| model_prices_and_context_window_backup.json | ||
| mypy.ini | ||
| policy_templates_backup.json | ||
| py.typed | ||
| router.py | ||
| scheduler.py | ||
| timeout.py | ||
| utils.py | ||