ignatz 1 year ago
parent
commit
211ef85ba2

+ 2 - 2
api/core/file/helpers.py

@@ -8,8 +8,8 @@ from configs import dify_config
 
 
 def get_signed_file_url(upload_file_id: str) -> str:
-    # url = f"{dify_config.FILES_URL}/files/{upload_file_id}/file-preview"
-    url = f"/docfile/{upload_file_id}/file-preview"
+    url = f"{dify_config.FILES_URL}/files/{upload_file_id}/file-preview"
+    # url = f"/docfile/{upload_file_id}/file-preview"
     return url
 
     timestamp = str(int(time.time()))

+ 2 - 1
api/core/rag/extractor/powerpoint_extractor.py

@@ -245,7 +245,8 @@ class PowerPointExtractor(BaseExtractor):
                     
                     shape_info.update({
                         "type": "image",
-                        "content": f"![image](/docfile/{upload_file.id}/file-preview)"
+                        "content": f"![image](/files/{upload_file.id}/file-preview)"
+                        # "content": f"![image](/docfile/{upload_file.id}/file-preview)"
                     })
                 # 提取表格
                 elif shape.shape_type == MSO_SHAPE_TYPE.TABLE:

+ 2 - 1
api/core/rag/extractor/word_extractor.py

@@ -127,7 +127,8 @@ class WordExtractor(BaseExtractor):
                 db.session.add(upload_file)
                 db.session.commit()
                 image_map[rel.target_part] = (
-                    f"![image](/docfile/{upload_file.id}/file-preview)"
+                    f"![image](/files/{upload_file.id}/file-preview)"
+                    # f"![image](/docfile/{upload_file.id}/file-preview)"
                 )
 
         return image_map

+ 1 - 0
api/nohup_celery.sh

@@ -0,0 +1 @@
+nohup celery -A app.celery worker -P gevent -c 1 -Q dataset,generation,mail,ops_trace --loglevel INFO > celery.log 2>&1 &

File diff suppressed because it is too large
+ 342 - 48
api/poetry.lock


+ 1 - 0
api/start_api.sh

@@ -0,0 +1 @@
+gunicorn --bind 0.0.0.0:5001 --workers 9 --worker-class gevent --worker-connections 10 --timeout 200 app:app

+ 3 - 3
docker/docker-compose.middleware.yaml

@@ -4,7 +4,7 @@ services:
     image: postgres:15-alpine
     restart: always
     env_file:
-      - ./.env
+      - ./middleware.env
     environment:
       POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-difyai123456}
       POSTGRES_DB: ${POSTGRES_DB:-dify}
@@ -99,7 +99,7 @@ services:
       # Mount the Weaviate data directory to the container.
       - ${WEAVIATE_HOST_VOLUME:-./volumes/weaviate}:/var/lib/weaviate
     env_file:
-      - ./.env
+      - ./middleware.env
     environment:
       # The Weaviate configurations
       # You can refer to the [Weaviate](https://weaviate.io/developers/weaviate/config-refs/env-vars) documentation for more information.
@@ -120,4 +120,4 @@ networks:
   # create a network between sandbox, api and ssrf_proxy, and can not access outside.
   ssrf_proxy_network:
     driver: bridge
-    internal: true
+    internal: true

Some files were not shown because too many files changed in this diff