mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-20 05:04:24 +00:00
fix: update comment and add negative-case tests for older gpt-5 models
This commit is contained in:
parent
ce3ff5df0f
commit
1fdcc0c91e
2 changed files with 9 additions and 1 deletions
|
|
@ -1006,7 +1006,8 @@ def responses_api_bridge_check(
|
|||
# ``reasoningSummary`` in ``extra_body``) must be bridged; Chat Completions rejects
|
||||
# those keys.
|
||||
#
|
||||
# - gpt-5.4+: tools + reasoning_effort (original) or any reasoning-summary alias.
|
||||
# - # - gpt-5.4+: tools alone (OpenAI applies reasoning_effort server-side, making
|
||||
# /v1/chat/completions reject tool calls for this family) or reasoning-summary alias.
|
||||
# - Older GPT-5 names (e.g. ``gpt-5``, ``gpt-5.1``): bridge only when a reasoning
|
||||
# summary alias is present with ``reasoning_effort`` (tools alone stay on chat).
|
||||
if (
|
||||
|
|
|
|||
|
|
@ -7,3 +7,10 @@ def test_gpt56_tools_bridged_to_responses_without_reasoning_effort():
|
|||
for model in ["gpt-5.6-sol", "gpt-5.6-luna", "gpt-5.6-terra", "gpt-5.6"]:
|
||||
model_info, _ = responses_api_bridge_check(model=model, custom_llm_provider="openai", tools=tools, reasoning_effort=None)
|
||||
assert model_info.get("mode") == "responses", f"{model} with tools should bridge to responses even without reasoning_effort"
|
||||
|
||||
def test_older_gpt5_with_tools_not_bridged_without_reasoning_effort():
|
||||
"""gpt-5, gpt-5.1, gpt-5.3 with tools should NOT bridge without reasoning_effort."""
|
||||
tools = [{"type": "function", "function": {"name": "get_weather", "description": "test", "parameters": {"type": "object", "properties": {"location": {"type": "string"}}, "required": ["location"]}}}]
|
||||
for model in ["gpt-5", "gpt-5.1", "gpt-5.3"]:
|
||||
model_info, _ = responses_api_bridge_check(model=model, custom_llm_provider="openai", tools=tools, reasoning_effort=None)
|
||||
assert model_info.get("mode") != "responses", f"{model} with tools but no reasoning_effort should NOT bridge"
|
||||
Loading…
Add table
Reference in a new issue