Quellcode durchsuchen

准备提交到服务器

wangxq vor 2 Wochen
Ursprung
Commit
68c2b0475f
2 geänderte Dateien mit 11 neuen und 2 gelöschten Zeilen
  1. 8 1
      asgi_app.py
  2. 3 1
      unified_api.py

+ 8 - 1
asgi_app.py

@@ -17,4 +17,11 @@ asgi_app = WsgiToAsgi(app)
 # uvicorn asgi_app:asgi_app --host 127.0.0.1 --port 8084 --reload
 
 # 生产环境(多进程 + 性能优化):
-# uvicorn asgi_app:asgi_app --host 0.0.0.0 --port 8084 --workers 4 --limit-concurrency 100 --limit-max-requests 1000 --access-log
+# uvicorn asgi_app:asgi_app --host 0.0.0.0 --port 8084 --workers 4 --limit-concurrency 100 --limit-max-requests 1000 --access-log
+
+# uvicorn asgi_app:asgi_app --host 0.0.0.0 --port 8084 --workers 4 --limit-concurrency 100 --limit-max-requests 1000
+
+#在 Ubuntu 上安装 uvloop、httptools 没坏处,建议保留,不必显式加 --loop uvloop,Uvicorn 默认 --loop auto
+
+
+# uvicorn asgi_app:asgi_app --host 0.0.0.0 --port 8084 --workers 4 --limit-concurrency 12 --limit-max-requests 5000 --timeout-graceful-shutdown 30

+ 3 - 1
unified_api.py

@@ -720,6 +720,7 @@ def ask_react_agent_stream():
             question = request.args.get('question')
             user_id_input = request.args.get('user_id')
             thread_id_input = request.args.get('thread_id')
+            conversation_id_input = request.args.get('conversation_id')
             
             # 参数验证(复用现有validate_request_data逻辑)
             if not question:
@@ -731,7 +732,8 @@ def ask_react_agent_stream():
                 validated_data = validate_request_data({
                     'question': question,
                     'user_id': user_id_input,
-                    'thread_id': thread_id_input
+                    'thread_id': thread_id_input,
+                    'conversation_id': conversation_id_input
                 })
             except ValueError as ve:
                 yield format_sse_error(f"参数验证失败: {str(ve)}")