def _get_max_vectorise_batch_size() -> int:
    """Gets MARQO_MAX_VECTORISE_BATCH_SIZE from the environment, validates it before returning it."""

    max_batch_size_value = read_env_vars_and_defaults(EnvVars.MARQO_MAX_VECTORISE_BATCH_SIZE)
    validation_error_msg = (
        "Could not properly read env var `MARQO_MAX_VECTORISE_BATCH_SIZE`. "
        "`MARQO_MAX_VECTORISE_BATCH_SIZE` must be an int greater than or equal to 1."
    )
    try:
        batch_size = int(max_batch_size_value)
    except (ValueError, TypeError) as e:
        value_error_msg = f"`{validation_error_msg} Current value: `{max_batch_size_value}`. Reason: {e}"
        logger.error(value_error_msg)
        raise ConfigurationError(value_error_msg) from e
    if batch_size < 1:
        batch_size_too_small_msg = f"`{validation_error_msg} Current value: `{max_batch_size_value}`."
        logger.error(batch_size_too_small_msg)
        raise ConfigurationError(batch_size_too_small_msg)
    return batch_size
Gets MARQO_MAX_VECTORISE_BATCH_SIZE from the environment, validates it before returning it.
src/marqo/s2_inference/s2_inference.py