mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-13 03:59:12 +00:00
* Add user field to AI Guard execute-policy payload for dashboard attribution Send the top-level OpenAI request `user` field in the execute-policy JSON payload so AI Guard can surface usernames on its dashboard. This is independent of the existing user_api_key_* headers which remain unchanged. The upstream guardrail framework already passes the original request_data (containing the `user` field) through to response-path guardrail calls, so this works for both IN and OUT directions including streaming. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Apply suggestion from @greptile-apps[bot] Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Add type annotations and tests for user field in execute-policy payload - Add Final annotation to user_for_payload - Add str | None type to user parameter in make_zscaler_ai_guard_api_call - Add 3 tests: user included when present, omitted when absent, and user in/out of JSON body sent to AI Guard Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * test(zscaler_ai_guard): inject the http client in user field tests Pass an AsyncHTTPHandler into ZscalerAIGuard so the user field tests read the real execute-policy body off a MockTransport instead of patching class methods, and drop the comments that restated the lookup * fix(zscaler_ai_guard): forward only non-empty string users Read the request user through a typed helper and type the execute-policy call params so basedpyright stays under the merge-base count, and skip non-string values the vendor rejects with a 500 * test(zscaler_ai_guard): drop the test-only http_client Run the user field tests against an in-process aiohttp server through api_base so the guardrail keeps its original constructor --------- Co-authored-by: Syamala Keerthana Chegu <schegu@zscaler.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: yucheng-berri <293926326+yucheng-berri@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| _support | ||
| base_sdk_tests | ||
| benchmarks | ||
| code_coverage_tests | ||
| documentation_tests | ||
| e2e | ||
| e2e_harness | ||
| fixtures | ||
| harness_e2e | ||
| integration | ||
| rust-python-harness | ||
| test_litellm_rust | ||
| typing | ||
| unit | ||
| windows_tests | ||
| __init__.py | ||
| _fake_openai_endpoint_server.py | ||
| _flush_vcr_cache.py | ||
| _live_test_helpers.py | ||
| _master_key.py | ||
| _openai_record_replay_proxy.py | ||
| _process_helpers.py | ||
| _vcr_conftest_common.py | ||
| _vcr_redis_persister.py | ||
| _wait_helpers.py | ||
| _ws_vcr.py | ||
| AGENTS.md | ||
| capturing_transport.py | ||
| eval_swe_bench.py | ||
| fake_openai_endpoint.py | ||
| gettysburg.wav | ||
| large_text.py | ||
| openai_batch_completions.jsonl | ||
| pyrightconfig.json | ||
| README.MD | ||
| test_logging.conf | ||
| test_rust_python_harness.py | ||
| VCR_TESTING.md | ||
| white_100x100.png | ||
In total litellm runs 1000+ tests
[02/20/2025] Update:
To make it easier to contribute and map what behavior is tested,
we've started mapping the litellm directory in tests/unit
This folder can only run mock tests.