|
@@ -435,6 +435,7 @@ async def handle_client(websocket: WebSocket,
|
|
|
receive_message = await websocket.receive_json()
|
|
receive_message = await websocket.receive_json()
|
|
|
print(f"Received from client {chat_id}: {receive_message}")
|
|
print(f"Received from client {chat_id}: {receive_message}")
|
|
|
upload_files = receive_message.get('upload_files', [])
|
|
upload_files = receive_message.get('upload_files', [])
|
|
|
|
|
+ upload_filenames = receive_message.get('upload_filenames', [])
|
|
|
title = receive_message.get('title', "")
|
|
title = receive_message.get('title', "")
|
|
|
sub_titles = receive_message.get('sub_titles', "")
|
|
sub_titles = receive_message.get('sub_titles', "")
|
|
|
workflow_type = receive_message.get('workflow', 1)
|
|
workflow_type = receive_message.get('workflow', 1)
|
|
@@ -458,7 +459,7 @@ async def handle_client(websocket: WebSocket,
|
|
|
AgentType.DIFY,
|
|
AgentType.DIFY,
|
|
|
current_user.id,
|
|
current_user.id,
|
|
|
{"role": "user", "content": title if title else title_query, "type": workflow_type,
|
|
{"role": "user", "content": title if title else title_query, "type": workflow_type,
|
|
|
- "is_clean": is_clean},
|
|
|
|
|
|
|
+ "is_clean": is_clean, "upload_filenames":upload_filenames},
|
|
|
workflow_type
|
|
workflow_type
|
|
|
)
|
|
)
|
|
|
conversation_id = session.conversation_id
|
|
conversation_id = session.conversation_id
|
|
@@ -823,6 +824,7 @@ async def handle_client(websocket: WebSocket,
|
|
|
receive_message = await websocket.receive_json()
|
|
receive_message = await websocket.receive_json()
|
|
|
print(f"Received from client {chat_id}: {receive_message}")
|
|
print(f"Received from client {chat_id}: {receive_message}")
|
|
|
upload_file_id = receive_message.get('upload_file_id', [])
|
|
upload_file_id = receive_message.get('upload_file_id', [])
|
|
|
|
|
+ upload_filenames = receive_message.get('upload_filenames', [])
|
|
|
question = receive_message.get('message', "")
|
|
question = receive_message.get('message', "")
|
|
|
if not question and not image_url:
|
|
if not question and not image_url:
|
|
|
await websocket.send_json({"message": "Invalid request", "type": "error"})
|
|
await websocket.send_json({"message": "Invalid request", "type": "error"})
|
|
@@ -834,7 +836,7 @@ async def handle_client(websocket: WebSocket,
|
|
|
agent_id,
|
|
agent_id,
|
|
|
AgentType.DIFY,
|
|
AgentType.DIFY,
|
|
|
current_user.id,
|
|
current_user.id,
|
|
|
- {"role": "user", "content": question}
|
|
|
|
|
|
|
+ {"role": "user", "content": question, "upload_filenames": upload_filenames}
|
|
|
)
|
|
)
|
|
|
conversation_id = session.conversation_id
|
|
conversation_id = session.conversation_id
|
|
|
except Exception as e:
|
|
except Exception as e:
|