diff --git a/tests/integration/inference/test_openai_completion.py b/tests/integration/inference/test_openai_completion.py index 3f0cffb2d..65f773889 100644 --- a/tests/integration/inference/test_openai_completion.py +++ b/tests/integration/inference/test_openai_completion.py @@ -58,7 +58,6 @@ def skip_if_model_doesnt_support_openai_completion(client_with_models, model_id) # does not work with the specified model, gpt-5-mini. Please choose different model and try # again. You can learn more about which models can be used with each operation here: # https://go.microsoft.com/fwlink/?linkid=2197993.'}}"} - "remote::watsonx", # return 404 when hitting the /openai/v1 endpoint "remote::llama-openai-compat", ): pytest.skip(f"Model {model_id} hosted by {provider.provider_type} doesn't support OpenAI completions.") @@ -68,6 +67,7 @@ def skip_if_doesnt_support_completions_logprobs(client_with_models, model_id): provider_type = provider_from_model(client_with_models, model_id).provider_type if provider_type in ( "remote::ollama", # logprobs is ignored + "remote::watsonx", ): pytest.skip(f"Model {model_id} hosted by {provider_type} doesn't support /v1/completions logprobs.") @@ -110,6 +110,7 @@ def skip_if_doesnt_support_n(client_with_models, model_id): # Error code 400 - {'message': '"n" > 1 is not currently supported', 'type': 'invalid_request_error', 'param': 'n', 'code': 'wrong_api_format'} "remote::cerebras", "remote::databricks", # Bad request: parameter "n" must be equal to 1 for streaming mode + "remote::watsonx", ): pytest.skip(f"Model {model_id} hosted by {provider.provider_type} doesn't support n param.") @@ -124,7 +125,6 @@ def skip_if_model_doesnt_support_openai_chat_completion(client_with_models, mode "remote::databricks", "remote::cerebras", "remote::runpod", - "remote::watsonx", # watsonx returns 404 when hitting the /openai/v1 endpoint ): pytest.skip(f"Model {model_id} hosted by {provider.provider_type} doesn't support OpenAI chat completions.") @@ -508,6 +508,12 @@ def test_openai_chat_completion_non_streaming_with_file(openai_client, client_wi assert "hello world" in normalized_content +def skip_if_doesnt_support_completions_stop_sequence(client_with_models, model_id): + provider_type = provider_from_model(client_with_models, model_id).provider_type + if provider_type in ("remote::watsonx",): # openai.BadRequestError: Error code: 400 + pytest.skip(f"Model {model_id} hosted by {provider_type} doesn't support /v1/completions stop sequence.") + + @pytest.mark.parametrize( "test_case", [ @@ -516,6 +522,7 @@ def test_openai_chat_completion_non_streaming_with_file(openai_client, client_wi ) def test_openai_completion_stop_sequence(client_with_models, openai_client, text_model_id, test_case): skip_if_model_doesnt_support_openai_completion(client_with_models, text_model_id) + skip_if_doesnt_support_completions_stop_sequence(client_with_models, text_model_id) tc = TestCase(test_case)