feat: support multiple images in conversations and add PDF-to-image utility#313
feat: support multiple images in conversations and add PDF-to-image utility#313fcarli wants to merge 8 commits into
Conversation
| text: str, | ||
| image_url: str | None = None, | ||
| image_url: str | list[str] | None = None, | ||
| local: bool = False, |
There was a problem hiding this comment.
Maybe the param name should refer to the image-related function, otherwise could be unclear (this is the generic query function, and params typically refer to the purpose of the method). Call it image_local or similar?
|
@fcarli looks good; only one comment on the param name. As it seems a minor update, do you suppose we bump patch? |
|
@fcarli bump |
|
@fcarli, the architecture can be improved a bit because the current approach with the
|
| self, | ||
| message: str, | ||
| image_url: str, | ||
| image_url: str | list[str], |
There was a problem hiding this comment.
enforce accepting only image_urls: str | list[str] (either web urls or base64 encoded0, and also raise errors if incorrect. The whole concept of "local files" shouldn't exist at this level and providing the correct url should be handled by the UI layer.
Summary
This PR enhances BioChatter's multimodal capabilities by adding support for multiple images in conversations and introducing PDF-to-image conversion functionality.
Key Changes:
Multiple Image Support:
append_image_message()andquery()methods to accept either a single image URL or a list of image URLslocalparameter to thequery()method for proper handling of local vs remote imagesPDF-to-Image Conversion:
pdf_pages_to_images()utility function inbiochatter/utils.pyDocumentation & Testing:
Benefits:
The changes are fully backward compatible and extend BioChatter's multimodal functionality for more complex use cases involving multiple images and PDF documents.