mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-16 04:29:31 +00:00
* test(integration): follow #44788 and #46101 in the openrouter translation and cache mark census expectations Expect prompt_cache_breakpoint for opted-in OpenAI and omit assistant tool-call marks from the capped census Match OpenRouter refusal, logprobs, and system fingerprint nulls Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test(integration): follow #46341 blank env and guardrail param handling in keepalive and scope expectations Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(router): read the first stream chunk through the stream's iterator so MCP streams keep working Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test(integration): follow #46493 retry and fallback semantics for streams that fail before content Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test(integration): drop the openrouter expectations #46510 already landed on main Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test(integration): restore blank lines lost in the main merge Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
314f17986a
commit
bbd58931fe
1 changed files with 16 additions and 5 deletions
|
|
@ -467,14 +467,25 @@ def _openai_message_marks(message: dict[str, JsonValue]) -> list[str]:
|
|||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"options",
|
||||
"options, expected_marks",
|
||||
(
|
||||
pytest.param({"prompt_cache_options": {"mode": "explicit"}}, id="breakpoint-dialect"),
|
||||
pytest.param({}, id="plain"),
|
||||
pytest.param(
|
||||
{"prompt_cache_options": {"mode": "explicit"}},
|
||||
[f"prompt_cache_breakpoint@user:text:{ASK}"],
|
||||
id="breakpoint-dialect",
|
||||
),
|
||||
pytest.param(
|
||||
{},
|
||||
[
|
||||
f"cache_control@user:text:{ASK}",
|
||||
*(f"cache_control@tool_call:{call_id(city)}" for city in CITIES),
|
||||
],
|
||||
id="plain",
|
||||
),
|
||||
),
|
||||
)
|
||||
def test_openai_points_skip_injection_when_client_marks_fill_the_cap(
|
||||
gateway: Gateway, options: dict[str, JsonValue]
|
||||
gateway: Gateway, options: dict[str, JsonValue], expected_marks: list[str]
|
||||
) -> None:
|
||||
marker: Final = new_marker()
|
||||
with wire_server(lambda request: Reply(body=_OPENAI_REPLY)) as wire, gateway.scenario() as scenario:
|
||||
|
|
@ -488,7 +499,7 @@ def test_openai_points_skip_injection_when_client_marks_fill_the_cap(
|
|||
status, _, text = post_chat(gateway, chat_body(model, conversation(marker, marked_calls())))
|
||||
assert status == 200, text
|
||||
marks: Final = _openai_marks(_only_request(wire))
|
||||
assert marks == [f"cache_control@user:text:{ASK}", *(f"cache_control@tool_call:{call_id(city)}" for city in CITIES)]
|
||||
assert marks == expected_marks
|
||||
|
||||
|
||||
@pytest.mark.parametrize("stream", (False, True), ids=("json", "stream"))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue