Skip to main content

Module binary_detect

Module binary_detect 

Source

Constants§

IMAGE_MAX_BYTES
Maximum file size for image passthrough (20 MB).

Functions§

binary_file_message
Returns a helpful error message for binary files, including file type and suggestions.
image_mime_type
Returns the MIME type for an LLM-viewable image, or None if not viewable.
is_binary_file
Returns true if the file is likely a binary file. Checks extension first (zero I/O), falls back to content inspection.
is_llm_viewable_image
Returns true if the file is an image format that LLMs can view visually.