reasoning-deployment-service 0.3.4__py3-none-any.whl → 0.3.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of reasoning-deployment-service might be problematic. Click here for more details.
- reasoning_deployment_service/runner.py +45 -7
- {reasoning_deployment_service-0.3.4.dist-info → reasoning_deployment_service-0.3.5.dist-info}/METADATA +1 -1
- {reasoning_deployment_service-0.3.4.dist-info → reasoning_deployment_service-0.3.5.dist-info}/RECORD +6 -6
- {reasoning_deployment_service-0.3.4.dist-info → reasoning_deployment_service-0.3.5.dist-info}/WHEEL +0 -0
- {reasoning_deployment_service-0.3.4.dist-info → reasoning_deployment_service-0.3.5.dist-info}/entry_points.txt +0 -0
- {reasoning_deployment_service-0.3.4.dist-info → reasoning_deployment_service-0.3.5.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import sys
|
|
1
|
+
import sys, os
|
|
2
2
|
import argparse
|
|
3
3
|
from pathlib import Path
|
|
4
|
+
from dotenv import load_dotenv
|
|
4
5
|
from reasoning_deployment_service import ReasoningEngineDeploymentService
|
|
5
6
|
from reasoning_deployment_service.gui_editor import GUIEditor
|
|
6
7
|
from reasoning_deployment_service.cli_editor import CLIRunner
|
|
@@ -27,7 +28,7 @@ class Runner:
|
|
|
27
28
|
# --- Load root_agent dynamically ---
|
|
28
29
|
root_agent = Runner._load_agent(args.agent_path)
|
|
29
30
|
|
|
30
|
-
# ---
|
|
31
|
+
# --- Require config files ---
|
|
31
32
|
if not Path(".env.agent").exists() or not Path("aix_agent.yaml").exists():
|
|
32
33
|
print("Missing .env.agent or aix_agent.yaml.")
|
|
33
34
|
print("Options:\n 5) Generate placeholder config\n q) Quit")
|
|
@@ -37,6 +38,11 @@ class Runner:
|
|
|
37
38
|
svc._check_required_files_exist()
|
|
38
39
|
sys.exit(0)
|
|
39
40
|
|
|
41
|
+
# --- Sanity check env vars ---
|
|
42
|
+
if not Runner._check_proper_configuration():
|
|
43
|
+
print("Error: Missing required environment variables in .env.agent")
|
|
44
|
+
sys.exit(1)
|
|
45
|
+
|
|
40
46
|
# --- Run mode or menu ---
|
|
41
47
|
if args.mode:
|
|
42
48
|
Runner._dispatch(args.mode, root_agent)
|
|
@@ -61,11 +67,12 @@ class Runner:
|
|
|
61
67
|
|
|
62
68
|
@staticmethod
|
|
63
69
|
def _load_agent(agent_path_arg: str):
|
|
64
|
-
"""Load root_agent either from --agent-path or your_agent_import.py."""
|
|
70
|
+
"""Load root_agent either from --agent-path or your_agent_import.py, bootstrapping if needed."""
|
|
65
71
|
sys.path.insert(0, str(Path.cwd())) # ensure project root on sys.path
|
|
72
|
+
import importlib
|
|
66
73
|
|
|
74
|
+
# Case 1: explicit --agent-path (power user / devs only)
|
|
67
75
|
if agent_path_arg:
|
|
68
|
-
import importlib
|
|
69
76
|
if ":" in agent_path_arg:
|
|
70
77
|
module_path, attr = agent_path_arg.split(":")
|
|
71
78
|
else:
|
|
@@ -73,12 +80,43 @@ class Runner:
|
|
|
73
80
|
module = importlib.import_module(module_path)
|
|
74
81
|
return getattr(module, attr)
|
|
75
82
|
|
|
76
|
-
|
|
83
|
+
# Case 2: shim already exists
|
|
84
|
+
shim = Path("your_agent_import.py")
|
|
85
|
+
if shim.exists():
|
|
77
86
|
from your_agent_import import root_agent
|
|
78
87
|
return root_agent
|
|
79
88
|
|
|
80
|
-
|
|
81
|
-
|
|
89
|
+
# Case 3: bootstrap (first run)
|
|
90
|
+
print("No agent path configured. Let's set it up once.")
|
|
91
|
+
agent_dir = input("Enter the directory where your root_agent (agent.py) lives: ").strip()
|
|
92
|
+
agent_dir = agent_dir.rstrip("/")
|
|
93
|
+
|
|
94
|
+
if not Path(agent_dir, "agent.py").exists():
|
|
95
|
+
print(f"Error: {agent_dir}/agent.py not found")
|
|
96
|
+
sys.exit(1)
|
|
97
|
+
|
|
98
|
+
import_path = agent_dir.replace("/", ".") + ".agent"
|
|
99
|
+
shim.write_text(f"from {import_path} import root_agent\n")
|
|
100
|
+
print(f"Created {shim} pointing to {agent_dir}/agent.py")
|
|
101
|
+
|
|
102
|
+
from your_agent_import import root_agent
|
|
103
|
+
return root_agent
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
@staticmethod
|
|
107
|
+
def _check_proper_configuration():
|
|
108
|
+
"""Ensure required environment variables are set in .env.agent."""
|
|
109
|
+
required_vars = ['PROJECT_ID', 'PROJECT_NUMBER', 'PROJECT_LOCATION', 'AGENT_SPACE_ENGINE']
|
|
110
|
+
load_dotenv(dotenv_path=".env.agent")
|
|
111
|
+
|
|
112
|
+
ok = True
|
|
113
|
+
for var in required_vars:
|
|
114
|
+
dev_var = f"DEV_{var}"
|
|
115
|
+
prod_var = f"PROD_{var}"
|
|
116
|
+
if not (Path(".env.agent").exists() and (os.getenv(dev_var) or os.getenv(prod_var))):
|
|
117
|
+
print(f"Missing: {dev_var} or {prod_var}")
|
|
118
|
+
ok = False
|
|
119
|
+
return ok
|
|
82
120
|
|
|
83
121
|
@staticmethod
|
|
84
122
|
def _dispatch(mode, root_agent):
|
{reasoning_deployment_service-0.3.4.dist-info → reasoning_deployment_service-0.3.5.dist-info}/RECORD
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
reasoning_deployment_service/__init__.py,sha256=xDuKt9gGviQiTV6vXBdkBvygnlAOIrwnUjVaMGZy0L4,670
|
|
2
2
|
reasoning_deployment_service/reasoning_deployment_service.py,sha256=0QHU2IqqojwFI2wPJ0izrskiHiwBfxdBEB9I_YxYbSA,29133
|
|
3
|
-
reasoning_deployment_service/runner.py,sha256=
|
|
3
|
+
reasoning_deployment_service/runner.py,sha256=e2Uu4DdRWuCHQI4H1x8Q6s1eMbBNoWFkBTnAaspK1tk,5413
|
|
4
4
|
reasoning_deployment_service/cli_editor/__init__.py,sha256=bN8NPkw8riB92pj2lAwJZuEMOQIO_RRuge0ehnJTW1I,118
|
|
5
5
|
reasoning_deployment_service/cli_editor/api_client.py,sha256=PUXPWUslFOksKMrcKjJSK_gVJkTI0bO_bqtCEYeM85g,27897
|
|
6
6
|
reasoning_deployment_service/cli_editor/cli_runner.py,sha256=w8jv2ep6TiYfpc_KnlvDOJ9hsCSuZcix4Rv4GQcZO4g,15729
|
|
@@ -21,8 +21,8 @@ reasoning_deployment_service/gui_editor/src/ui/authorization_view.py,sha256=uiyN
|
|
|
21
21
|
reasoning_deployment_service/gui_editor/src/ui/reasoning_engine_view.py,sha256=tCvSPEf4dW0NRdAqfs3yT5Pa873gYeLzCMMIt2r2T4o,14644
|
|
22
22
|
reasoning_deployment_service/gui_editor/src/ui/reasoning_engines_view.py,sha256=IRjFlBbY98usAZa0roOonjvWQOsF6NBW4bBg_k8KnKI,7860
|
|
23
23
|
reasoning_deployment_service/gui_editor/src/ui/ui_components.py,sha256=HdQHy-oSZ3GobQ3FNdH7y_w3ANbFiuf2rMoflAmff0A,55366
|
|
24
|
-
reasoning_deployment_service-0.3.
|
|
25
|
-
reasoning_deployment_service-0.3.
|
|
26
|
-
reasoning_deployment_service-0.3.
|
|
27
|
-
reasoning_deployment_service-0.3.
|
|
28
|
-
reasoning_deployment_service-0.3.
|
|
24
|
+
reasoning_deployment_service-0.3.5.dist-info/METADATA,sha256=t6j6T_kXXQuzStSR53_2h1WUfB_wDyvxOLT27Gmpr6s,4991
|
|
25
|
+
reasoning_deployment_service-0.3.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
26
|
+
reasoning_deployment_service-0.3.5.dist-info/entry_points.txt,sha256=onGKjR5ONTtRv3aqEtK863iw9Ty1kLcjfZlsplkRZrA,84
|
|
27
|
+
reasoning_deployment_service-0.3.5.dist-info/top_level.txt,sha256=GKuQS1xHUYLZbatw9DmcYdBxxLhWhhGkV4FmFxgKdp0,29
|
|
28
|
+
reasoning_deployment_service-0.3.5.dist-info/RECORD,,
|
{reasoning_deployment_service-0.3.4.dist-info → reasoning_deployment_service-0.3.5.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|