test(interactions): retain optional request field coverage

This commit is contained in:
albertbausili 2026-09-28 12:59:43 +02:00
parent 99fe53ab99
commit 4a709fa924

View file

@ -89,12 +89,17 @@ class TestRequestCompliance:
def test_create_model_interaction_request_schema(self, model_request_schema: Mapping[str, object]) -> None:
config: Final = GoogleAIStudioInteractionsConfig()
payload: Final = config.transform_request(
model="test-model", agent=None, input="test input", optional_params={"stream": True},
model="test-model", agent=None, input="test input",
optional_params={"stream": True, "response_mime_type": "application/json"},
litellm_params=GenericLiteLLMParams(api_key="test-key"), headers={},
)
properties: Final = TypeAdapter(Mapping[str, object]).validate_python(model_request_schema["properties"])
assert payload == {"model": "test-model", "input": "test input", "stream": True}
assert payload == {
"model": "test-model", "input": "test input", "stream": True,
"response_format": {"type": "text", "mime_type": "application/json"},
}
assert payload.keys() <= properties.keys()
assert set(config.get_supported_params("test-model")) - {"agent", "response_mime_type"} <= properties.keys()
@pytest.mark.parametrize("input_value", ["test input", [{"type": "text", "text": "test input"}]])
def test_input_types_match_spec(