mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-07 07:58:09 +00:00
Strategies, pre-call checks, cooldown and fallback helpers, and the auto, complexity and quality sub-routers now take a RoutingContext instead of the Router, and read the router only through registry(), settings(), health() and the context's forwarding methods. Router-free helpers move from router_utils to litellm_core_utils, outside callers of router state switch to entry points, and the surface allowlist shrinks to the endpoint methods plus the entry points
16 lines
760 B
Python
16 lines
760 B
Python
from typing import Final
|
|
|
|
from litellm.litellm_core_utils.add_retry_fallback_headers import get_hidden_params_dict
|
|
from tests.test_litellm_rust.support.recording_server import RecordingServer
|
|
|
|
|
|
def assert_served_natively(server: RecordingServer, *responses: object, count: int = 1) -> None:
|
|
assert len(server.requests) == (len(responses) or count)
|
|
if not responses:
|
|
assert not any(
|
|
request.headers.get("user-agent", "").startswith("python-httpx") for request in server.requests
|
|
)
|
|
for response in responses:
|
|
additional_headers: Final = get_hidden_params_dict(response).get("additional_headers")
|
|
assert isinstance(additional_headers, dict)
|
|
assert additional_headers.get("x-litellm-rust") == "true"
|