mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-13 18:23:20 +00:00
[Test] mark bedrock gpt-oss function-calling stream test flaky
Bedrock GPT-OSS occasionally emits truncated toolUse.input deltas
(e.g. accumulated args of '{"":"'), which causes
test_function_calling_with_tool_response to hard-fail on json.loads.
Other overrides in TestBedrockGPTOSS already handle similar
model-side flakiness; apply retries=6 delay=5 scoped to this subclass
so other providers keep strict behavior.
This commit is contained in:
@@ -16,11 +16,16 @@ class TestBedrockGPTOSS(BaseLLMChatTest):
|
||||
return {
|
||||
"model": "bedrock/converse/openai.gpt-oss-20b-1:0",
|
||||
}
|
||||
|
||||
|
||||
def test_tool_call_no_arguments(self, tool_call_no_arguments):
|
||||
"""Test that tool calls with no arguments is translated correctly. Relevant issue: https://github.com/BerriAI/litellm/issues/6833"""
|
||||
pass
|
||||
|
||||
@pytest.mark.flaky(retries=6, delay=5)
|
||||
def test_function_calling_with_tool_response(self):
|
||||
"""Bedrock GPT-OSS intermittently streams truncated toolUse.input deltas, producing malformed JSON args. Retry to tolerate model flakiness."""
|
||||
super().test_function_calling_with_tool_response()
|
||||
|
||||
def test_prompt_caching(self):
|
||||
"""
|
||||
Remove override once we have access to Bedrock prompt caching
|
||||
@@ -33,10 +38,13 @@ class TestBedrockGPTOSS(BaseLLMChatTest):
|
||||
"""
|
||||
pass
|
||||
|
||||
@pytest.mark.parametrize("model", [
|
||||
"bedrock/openai.gpt-oss-20b-1:0",
|
||||
"bedrock/openai.gpt-oss-120b-1:0",
|
||||
])
|
||||
@pytest.mark.parametrize(
|
||||
"model",
|
||||
[
|
||||
"bedrock/openai.gpt-oss-20b-1:0",
|
||||
"bedrock/openai.gpt-oss-120b-1:0",
|
||||
],
|
||||
)
|
||||
def test_reasoning_effort_transformation_gpt_oss(self, model):
|
||||
"""Test that reasoning_effort is handled correctly for GPT-OSS models."""
|
||||
config = AmazonConverseConfig()
|
||||
@@ -51,7 +59,7 @@ class TestBedrockGPTOSS(BaseLLMChatTest):
|
||||
model=model,
|
||||
drop_params=False,
|
||||
)
|
||||
|
||||
|
||||
# GPT-OSS should have reasoning_effort in result, not thinking
|
||||
assert "reasoning_effort" in result
|
||||
assert result["reasoning_effort"] == "low"
|
||||
|
||||
Reference in New Issue
Block a user