fix: playground img not working (#3980)

* 🐛 (model.py): fix issue where message.files was not being updated correctly when image_paths is empty in MessageBase class

* 🐛 (model.py): simplify condition for checking if image_paths is not empty to improve readability and maintainability

* [autofix.ci] apply automated fixes

* 🔧 (OutputParser.py): refactor error message handling for unsupported or missing parser to improve readability and maintainability

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Cristhian Zanforlin Lousa 2024-10-01 15:54:11 -03:00 committed by GitHub
commit 7f10a2a201
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 2 deletions

View file

@ -37,7 +37,9 @@ class MessageBase(SQLModel):
if hasattr(file, "path") and hasattr(file, "url") and file.path:
session_id = message.session_id
image_paths.append(f"{session_id}{file.path.split(session_id)[1]}")
message.files = image_paths
if image_paths:
message.files = image_paths
if isinstance(message.timestamp, str):
timestamp = datetime.fromisoformat(message.timestamp)
else: