pass in auth_key
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
from typing import List
|
from typing import Dict, List, Optional
|
||||||
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
def build_route(pipeline_id:str,
|
def build_route(pipeline_id:str,
|
||||||
@@ -6,6 +7,7 @@ def build_route(pipeline_id:str,
|
|||||||
tool_keys:List[str],
|
tool_keys:List[str],
|
||||||
port:str,
|
port:str,
|
||||||
api_key: str,
|
api_key: str,
|
||||||
|
fast_auth_keys: Optional[str] = None,
|
||||||
entry_pnt:str="fastapi_server/server_dashscope.py",
|
entry_pnt:str="fastapi_server/server_dashscope.py",
|
||||||
llm_name:str="qwen-plus"):
|
llm_name:str="qwen-plus"):
|
||||||
cmd = [
|
cmd = [
|
||||||
@@ -26,7 +28,10 @@ def build_route(pipeline_id:str,
|
|||||||
cmd.extend(
|
cmd.extend(
|
||||||
["--tool-manager-config.client-tool-manager.tool-keys", *tool_keys]
|
["--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}"
|
return sv_prc, f"http://0.0.0.0:{port}"
|
||||||
|
|
||||||
@@ -36,6 +41,7 @@ def build_react(pipeline_id:str,
|
|||||||
tool_keys:List[str],
|
tool_keys:List[str],
|
||||||
port:str,
|
port:str,
|
||||||
api_key: str,
|
api_key: str,
|
||||||
|
fast_auth_keys: Optional[str] = None,
|
||||||
entry_pnt:str="fastapi_server/server_dashscope.py",
|
entry_pnt:str="fastapi_server/server_dashscope.py",
|
||||||
llm_name:str="qwen-plus"):
|
llm_name:str="qwen-plus"):
|
||||||
cmd = [
|
cmd = [
|
||||||
@@ -51,7 +57,10 @@ def build_react(pipeline_id:str,
|
|||||||
cmd.extend(
|
cmd.extend(
|
||||||
["--tool-manager-config.client-tool-manager.tool-keys", *tool_keys]
|
["--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}"
|
return sv_prc, f"http://0.0.0.0:{port}"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user