image
Utilities for images.
convert_image_url_to_image_block_param(image_url)
Convert an ImageURL to an ImageBlockParam.
Source code in spark_instructor/utils/image.py
fetch_and_encode_image(url)
Fetch the image from the URL and encode it in base64.
Source code in spark_instructor/utils/image.py
get_media_type(url)
Determine the media type of the image based on its extension using regex.
Source code in spark_instructor/utils/image.py
is_base64_encoded(url)
Check if the given URL is already base64 encoded.