Error when trying to create a completion with GPT4-preview-vision

In my code, I wanted to add the possibility to use the vision version. When I use gpt4 it works fine, but when I use vision version. I get this error:

openai.BadRequestError: Error code: 400 - {‘error’: {‘message’: ‘1 validation error for Request\nbody → stop\n none is not an allowed value (type=type_error.none.not_allowed)’, ‘type’: ‘invalid_request_error’, ‘param’: None, ‘code’: None}}

Here is a snippet of my code:

            if "vision" in self.config.model_name:
                messages = [
                                "role": "user", 
                                "content": [
                messages = [{"role": "user", "content": prompt}]
            chat_completion =
                            model=self.config["model_name"],  # Choose the engine according to your OpenAI plan
                            max_tokens=n_predict,  # Adjust the desired length of the generated response
                            n=1,  # Specify the number of responses you want
                            stop=None,  # Define a stop sequence if needed
                            temperature=gpt_params["temperature"],  # Adjust the temperature for more or less randomness in the output

OK, it turns out the problem comes from the stop=None. It is not supported on vusion models.