Browse Source

Merge remote-tracking branch 'origin/master'

xuyonghao 1 year ago
parent
commit
27e3d6bb4c
2 changed files with 7 additions and 3 deletions
  1. 5 2
      app/api/chat.py
  2. 2 1
      app/api/files.py

+ 5 - 2
app/api/chat.py

@@ -426,16 +426,19 @@ async def handle_client(websocket: WebSocket,
                         except Exception as e:
                             logger.error(e)
                         inputs = {
-                            "input_files": []
                         }
+                        files = []
                         for file in upload_files:
-                            inputs["input_files"].append({
+                            files.append({
                                 "type": "document",
                                 "transfer_method": "local_file",
                                 "url": "",
                                 "upload_file_id": file
                             })
+                        if workflow_type == 1:
+                            inputs["input_files"] = files
                         if workflow_type == 2:
+                            inputs["file_list"] = files
                             inputs["Completion_of_main_indicators"] = title
                             token = settings.dify_workflow_report
                         complete_response = ""

+ 2 - 1
app/api/files.py

@@ -91,7 +91,8 @@ async def upload_files(
             return Response(code=200, msg="", data=result)
 
         elif agent_id == "basic_paper_agent":
-            service = BasicService(base_url=settings.basic_paper_url)
+            ...
+            # service = BasicService(base_url=settings.basic_paper_url)
             # result = await service.paper_file_upload(chat_id, file.filename, file_content)
 
     elif agent.agent_type == AgentType.DIFY: