pass in auth_key

This commit is contained in:
2026-02-12 16:38:32 +08:00
parent 05bcf884c5
commit c87c883313

View File

@@ -1,4 +1,5 @@
from typing import List
from typing import Dict, List, Optional
import os
import subprocess
def build_route(pipeline_id:str,
@@ -6,6 +7,7 @@ def build_route(pipeline_id:str,
tool_keys:List[str],
port:str,
api_key: str,
fast_auth_keys: Optional[str] = None,
entry_pnt:str="fastapi_server/server_dashscope.py",
llm_name:str="qwen-plus"):
cmd = [
@@ -26,7 +28,10 @@ def build_route(pipeline_id:str,
cmd.extend(
["--tool-manager-config.client-tool-manager.tool-keys", *tool_keys]
)
sv_prc = subprocess.Popen(cmd)
env: Dict[str, str] = os.environ.copy()
if fast_auth_keys:
env["FAST_AUTH_KEYS"] = fast_auth_keys
sv_prc = subprocess.Popen(cmd, env=env)
return sv_prc, f"http://0.0.0.0:{port}"
@@ -36,6 +41,7 @@ def build_react(pipeline_id:str,
tool_keys:List[str],
port:str,
api_key: str,
fast_auth_keys: Optional[str] = None,
entry_pnt:str="fastapi_server/server_dashscope.py",
llm_name:str="qwen-plus"):
cmd = [
@@ -51,7 +57,10 @@ def build_react(pipeline_id:str,
cmd.extend(
["--tool-manager-config.client-tool-manager.tool-keys", *tool_keys]
)
sv_prc = subprocess.Popen(cmd)
env: Dict[str, str] = os.environ.copy()
if fast_auth_keys:
env["FAST_AUTH_KEYS"] = fast_auth_keys
sv_prc = subprocess.Popen(cmd, env=env)
return sv_prc, f"http://0.0.0.0:{port}"