Merge remote-tracking branch 'origin/chat_and_cache' into websocket
This commit is contained in:
commit
41a0bc0588
2 changed files with 5 additions and 1 deletions
2
Makefile
2
Makefile
|
|
@ -27,7 +27,7 @@ run_frontend:
|
||||||
cd src/frontend && npm start
|
cd src/frontend && npm start
|
||||||
|
|
||||||
run_backend:
|
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:
|
build_frontend:
|
||||||
cd src/frontend && CI='' npm run build
|
cd src/frontend && CI='' npm run build
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ class ChatHistory(Subject):
|
||||||
"""Add a message to the chat history."""
|
"""Add a message to the chat history."""
|
||||||
|
|
||||||
self.history[client_id].append(message)
|
self.history[client_id].append(message)
|
||||||
|
|
||||||
if not isinstance(message, FileResponse):
|
if not isinstance(message, FileResponse):
|
||||||
self.notify()
|
self.notify()
|
||||||
|
|
||||||
|
|
@ -127,6 +128,9 @@ class ChatManager:
|
||||||
# Iterate backwards through the history
|
# Iterate backwards through the history
|
||||||
for msg in reversed(history):
|
for msg in reversed(history):
|
||||||
if isinstance(msg, FileResponse):
|
if isinstance(msg, FileResponse):
|
||||||
|
if msg.data_type == "image":
|
||||||
|
# Base64 encode the image
|
||||||
|
msg.data = pil_to_base64(msg.data)
|
||||||
file_responses.append(msg)
|
file_responses.append(msg)
|
||||||
if msg.type == "start":
|
if msg.type == "start":
|
||||||
break
|
break
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue