test(providers): keep reasoning_effort_plugin_api and gemini_thinking_config cutover-safe
This commit is contained in:
committed by
Mark S.
parent
01839c9f2b
commit
153073d9be
@@ -83,6 +83,8 @@ def test_gemini4_maps_effort_to_thinking_level_and_long_decode_budget(reasoning,
|
||||
config = _build_gemini_thinking_config("gemini-4-argon", reasoning)
|
||||
assert config == {"includeThoughts": shown, "thinkingLevel": level} # never thinkingBudget (400 with a level)
|
||||
profile = get_provider_profile("gemini")
|
||||
if profile is None:
|
||||
pytest.skip("google model-provider plugin not installed")
|
||||
native = profile.build_extra_body(model="gemini-4-argon", reasoning_config=reasoning,
|
||||
base_url="https://generativelanguage.googleapis.com/v1beta")
|
||||
assert native.get("max_output_tokens") == budget
|
||||
@@ -110,6 +112,8 @@ def test_gemini_provider_sends_xhigh_only_to_the_models_that_take_it(model, effo
|
||||
from providers import get_provider_profile
|
||||
|
||||
profile = get_provider_profile("gemini")
|
||||
if profile is None:
|
||||
pytest.skip("google model-provider plugin not installed")
|
||||
native = profile.build_extra_body(model=model, reasoning_config={"enabled": True, "effort": effort},
|
||||
base_url="https://generativelanguage.googleapis.com/v1beta")
|
||||
assert native["thinking_config"] == {"includeThoughts": True, "thinkingLevel": level}
|
||||
|
||||
@@ -34,7 +34,10 @@ _CONFIGS = (
|
||||
|
||||
|
||||
def _gemini_profile_thinking_config(model: str, reasoning_config: dict | None) -> dict | None:
|
||||
body = providers.get_provider_profile("gemini").build_extra_body(model=model, reasoning_config=reasoning_config, base_url=_NATIVE)
|
||||
profile = providers.get_provider_profile("gemini")
|
||||
if profile is None:
|
||||
pytest.skip("google model-provider plugin not installed")
|
||||
body = profile.build_extra_body(model=model, reasoning_config=reasoning_config, base_url=_NATIVE)
|
||||
return body.get("thinking_config")
|
||||
|
||||
|
||||
@@ -96,10 +99,10 @@ def test_bare_gemini_model_id(model, expected):
|
||||
assert bare_gemini_model_id(model) == expected
|
||||
|
||||
|
||||
def test_native_adapter_keeps_its_import_name():
|
||||
from agent import gemini_native_adapter
|
||||
def test_model_family_keeps_bare_gemini_model_id_identity():
|
||||
from agent import gemini_model_family
|
||||
|
||||
assert gemini_native_adapter.bare_gemini_model_id is bare_gemini_model_id
|
||||
assert gemini_model_family.bare_gemini_model_id is bare_gemini_model_id
|
||||
|
||||
|
||||
def test_importing_the_helpers_loads_no_http_stack():
|
||||
|
||||
Reference in New Issue
Block a user