| 1 | # SPDX-License-Identifier: Apache-2.0 |
| 2 | # SPDX-FileCopyrightText: Copyright contributors to the vLLM project |
| 3 | |
| 4 | from vllm.entrypoints.openai.chat_completion.protocol import ChatCompletionRequest |
| 5 | from vllm.entrypoints.openai.completion.protocol import CompletionRequest |
| 6 | from vllm.entrypoints.openai.responses.protocol import ResponsesRequest |
| 7 | |
| 8 | |
| 9 | def test_chat_request_disables_watermarking(): |
| 10 | request = ChatCompletionRequest( |
| 11 | messages=[{"role": "user", "content": "hello"}], watermarking=False |
| 12 | ) |
| 13 | |
| 14 | params = request.to_sampling_params(max_tokens=1, default_sampling_params={}) |
| 15 | |
| 16 | assert not params.watermarking |
| 17 | |
| 18 | |
| 19 | def test_completion_request_disables_watermarking(): |
| 20 | request = CompletionRequest(prompt="hello", watermarking=False) |
| 21 | |
| 22 | params = request.to_sampling_params(max_tokens=1) |
| 23 | |
| 24 | assert not params.watermarking |
| 25 | |
| 26 | |
| 27 | def test_responses_request_disables_watermarking(): |
| 28 | request = ResponsesRequest(input="hello", watermarking=False) |
| 29 | |
| 30 | params = request.to_sampling_params(default_max_tokens=1) |
| 31 | |
| 32 | assert not params.watermarking |