diff --git a/lang_agent/front_api/build_server.py b/lang_agent/front_api/build_server.py index 4a8731a..0bfedd0 100644 --- a/lang_agent/front_api/build_server.py +++ b/lang_agent/front_api/build_server.py @@ -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}"