fix: remove use of ImagePromptTemplate in image handling and adds image utils (#4467)

* remove poetry.lock

* fix: update langchain-core dependency version to 0.3.15

* feat: add functions to convert images to base64 and create data URLs

* refactor: simplify image URL handling by replacing ImagePromptTemplate with create_data_url function

* Fix image URL structure in data schema to use nested dictionary format

* Add unit tests for Data schema message conversion with text and images

* test: add unit tests for image utility functions to validate base64 conversion and data URL creation

* Refactor image URL generation to use `create_data_url` utility function instead of `ImagePromptTemplate`

* Add unit tests for message handling and image processing in schema module

- Introduce fixtures for temporary cache directory and sample image creation.
- Add tests for message creation from human and AI text.
- Implement tests for messages with single and multiple images.
- Include tests for invalid image paths and messages without sender.
- Add message serialization and conversion tests.
- Ensure cleanup of cache directory after tests.

* Use platformdirs to determine cache directory paths in test_schema_message.py
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-11-08 13:24:19 -03:00 • committed by GitHub
commit 98274633db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 889 additions and 12297 deletions

View file

@ -111,7 +111,7 @@ dependencies = [
"uvicorn>=0.30.0",
"gunicorn>=22.0.0",
"langchain~=0.3.3",
"langchain-core~=0.3.10",
"langchain-core~=0.3.15",
"langchainhub~=0.1.15",
"sqlmodel==0.0.18",
"loguru>=0.7.1",