handle switching to gpt4-vision-preview

This commit is contained in:
Joshua Vial 2023-12-11 21:13:07 +13:00
parent 90fb538015
commit c919f9f0c6
4 changed files with 14 additions and 12 deletions

View file

@ -1,7 +1,19 @@
from pathlib import Path
# Set of image file extensions
IMAGE_EXTENSIONS = {'.png', '.jpg', '.jpeg', '.gif', '.bmp', '.tiff', '.webp'}
from .dump import dump # noqa: F401
def is_image_file(file_name):
"""
Check if the given file name has an image file extension.
:param file_name: The name of the file to check.
:return: True if the file is an image, False otherwise.
"""
return any(file_name.endswith(ext) for ext in IMAGE_EXTENSIONS)
def safe_abs_path(res):
"Gives an abs path, which safely returns a full (not 8.3) windows path"