Merge remote-tracking branch 'origin/chat_and_cache' into websocket

This commit is contained in:
anovazzi1 2023-04-25 22:23:42 -03:00
commit 41a0bc0588
2 changed files with 5 additions and 1 deletions

View file

@ -27,7 +27,7 @@ run_frontend:
cd src/frontend && npm start
run_backend:
poetry run uvicorn langflow.main:app --port 5003 --reload
poetry run uvicorn langflow.main:app --port 5003 --reload --log-level debug
build_frontend:
cd src/frontend && CI='' npm run build

View file

@ -23,6 +23,7 @@ class ChatHistory(Subject):
"""Add a message to the chat history."""
self.history[client_id].append(message)
if not isinstance(message, FileResponse):
self.notify()
@ -127,6 +128,9 @@ class ChatManager:
# Iterate backwards through the history
for msg in reversed(history):
if isinstance(msg, FileResponse):
if msg.data_type == "image":
# Base64 encode the image
msg.data = pil_to_base64(msg.data)
file_responses.append(msg)
if msg.type == "start":
break