reasoning-deployment-service 0.3.3__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.

@@ -1,13 +1,8 @@
1
- import os
2
- import sys
3
- import subprocess
1
+ import sys, os
2
+ import argparse
4
3
  from pathlib import Path
5
4
  from dotenv import load_dotenv
6
- import argparse
7
-
8
- from reasoning_deployment_service import (
9
- ReasoningEngineDeploymentService,
10
- )
5
+ from reasoning_deployment_service import ReasoningEngineDeploymentService
11
6
  from reasoning_deployment_service.gui_editor import GUIEditor
12
7
  from reasoning_deployment_service.cli_editor import CLIRunner
13
8
 
@@ -19,40 +14,40 @@ class Runner:
19
14
  parser.add_argument(
20
15
  "--mode",
21
16
  choices=["create", "auth", "cli", "gui", "populate_files"],
22
- required=False,
23
17
  help="Operation mode to run",
24
18
  )
19
+ parser.add_argument(
20
+ "--agent-path",
21
+ help="Dotted path to your agent (e.g. Invoice_agent.agent:root_agent). "
22
+ "If omitted, falls back to your_agent_import.py in project root."
23
+ )
25
24
  args = parser.parse_args()
26
25
 
27
- # --- Ensure .gitignore covers junk ---
28
26
  Runner._ensure_gitignore()
29
27
 
30
- # --- Ensure your_agent_import.py exists ---
31
- if not Path("your_agent_import.py").exists():
32
- Runner._create_agent_import()
28
+ # --- Load root_agent dynamically ---
29
+ root_agent = Runner._load_agent(args.agent_path)
33
30
 
34
- # --- Always ensure venv exists & is up to date ---
35
- venv_python = Runner._ensure_venv()
36
-
37
- # --- Install dependencies into venv ---
38
- Runner._install_deps(venv_python)
39
-
40
- # --- If no config files, restrict menu ---
31
+ # --- Require config files ---
41
32
  if not Path(".env.agent").exists() or not Path("aix_agent.yaml").exists():
42
33
  print("Missing .env.agent or aix_agent.yaml.")
43
34
  print("Options:\n 5) Generate placeholder config\n q) Quit")
44
35
  choice = input("Enter choice: ").strip()
45
36
  if choice == "5":
46
- subprocess.check_call([venv_python, "deploy.py", "--mode", "populate_files"])
47
- else:
48
- sys.exit(0)
49
- return
37
+ svc = ReasoningEngineDeploymentService(root_agent, deployment_environment="DEV")
38
+ svc._check_required_files_exist()
39
+ sys.exit(0)
50
40
 
51
- # --- Dispatch based on mode or menu ---
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
+
46
+ # --- Run mode or menu ---
52
47
  if args.mode:
53
- Runner._dispatch(args.mode, venv_python)
48
+ Runner._dispatch(args.mode, root_agent)
54
49
  else:
55
- Runner._menu(venv_python)
50
+ Runner._menu(root_agent)
56
51
 
57
52
  # ------------------ HELPERS ------------------
58
53
 
@@ -61,44 +56,70 @@ class Runner:
61
56
  gi = Path(".gitignore")
62
57
  if not gi.exists():
63
58
  gi.write_text("# Generated by Runner\n")
64
- patterns = [".venv", ".venv_deploy", "venv", "__pycache__", "deploy_env", "your_agent_import.py"]
59
+ patterns = [
60
+ ".venv", ".venv_deploy", "venv", "__pycache__",
61
+ "deploy_env", "your_agent_import.py"
62
+ ]
65
63
  content = gi.read_text().splitlines()
66
64
  for p in patterns:
67
65
  if p not in content:
68
- with gi.open("a") as f:
69
- f.write(f"{p}\n")
66
+ gi.write_text(gi.read_text() + f"\n{p}\n")
70
67
 
71
68
  @staticmethod
72
- def _create_agent_import():
69
+ def _load_agent(agent_path_arg: str):
70
+ """Load root_agent either from --agent-path or your_agent_import.py, bootstrapping if needed."""
71
+ sys.path.insert(0, str(Path.cwd())) # ensure project root on sys.path
72
+ import importlib
73
+
74
+ # Case 1: explicit --agent-path (power user / devs only)
75
+ if agent_path_arg:
76
+ if ":" in agent_path_arg:
77
+ module_path, attr = agent_path_arg.split(":")
78
+ else:
79
+ module_path, attr = agent_path_arg, "root_agent"
80
+ module = importlib.import_module(module_path)
81
+ return getattr(module, attr)
82
+
83
+ # Case 2: shim already exists
84
+ shim = Path("your_agent_import.py")
85
+ if shim.exists():
86
+ from your_agent_import import root_agent
87
+ return root_agent
88
+
89
+ # Case 3: bootstrap (first run)
90
+ print("No agent path configured. Let's set it up once.")
73
91
  agent_dir = input("Enter the directory where your root_agent (agent.py) lives: ").strip()
92
+ agent_dir = agent_dir.rstrip("/")
93
+
74
94
  if not Path(agent_dir, "agent.py").exists():
75
95
  print(f"Error: {agent_dir}/agent.py not found")
76
96
  sys.exit(1)
97
+
77
98
  import_path = agent_dir.replace("/", ".") + ".agent"
78
- Path("your_agent_import.py").write_text(f"from {import_path} import root_agent\n")
79
- print(f"Created your_agent_import.py pointing to {agent_dir}/agent.py")
99
+ shim.write_text(f"from {import_path} import root_agent\n")
100
+ print(f"Created {shim} pointing to {agent_dir}/agent.py")
80
101
 
81
- @staticmethod
82
- def _ensure_venv():
83
- venv_dir = Path("deploy_env")
84
- if not venv_dir.exists():
85
- subprocess.check_call([sys.executable, "-m", "venv", str(venv_dir)])
86
- print("Created venv at ./deploy_env")
87
- return str(venv_dir / "bin" / "python")
102
+ from your_agent_import import root_agent
103
+ return root_agent
88
104
 
89
- @staticmethod
90
- def _install_deps(venv_python):
91
- subprocess.check_call([venv_python, "-m", "pip", "install", "--upgrade", "pip"])
92
- subprocess.check_call([venv_python, "-m", "pip", "install", "keyring", "keyrings.google-artifactregistry-auth"])
93
- # Install reasoning-deployment-service itself (current package)
94
- subprocess.check_call([venv_python, "-m", "pip", "install", "reasoning-deployment-service"])
95
105
 
96
- if Path("requirements.txt").exists():
97
- subprocess.check_call([venv_python, "-m", "pip", "install", "-r", "requirements.txt"])
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
98
120
 
99
121
  @staticmethod
100
- def _dispatch(mode, venv_python):
101
- from your_agent_import import root_agent
122
+ def _dispatch(mode, root_agent):
102
123
  svc = ReasoningEngineDeploymentService(root_agent, deployment_environment="DEV")
103
124
 
104
125
  if mode == "create":
@@ -113,10 +134,10 @@ class Runner:
113
134
  svc._check_required_files_exist()
114
135
 
115
136
  @staticmethod
116
- def _menu(venv_python):
137
+ def _menu(root_agent):
117
138
  print("Choose an operation:\n1) Create/Update\n2) Auth only\n3) CLI\n4) GUI\nq) Quit")
118
- choice = input("Enter choice: ").strip()
139
+ choice = input("Enter choice: ").strip().lower()
119
140
  mapping = {"1": "create", "2": "auth", "3": "cli", "4": "gui"}
120
- if choice.lower() == "q":
141
+ if choice == "q":
121
142
  sys.exit(0)
122
- Runner._dispatch(mapping.get(choice, ""), venv_python)
143
+ Runner._dispatch(mapping.get(choice, ""), root_agent)
@@ -1,23 +1,23 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: reasoning-deployment-service
3
- Version: 0.3.3
3
+ Version: 0.3.5
4
4
  Summary: Deployment helper for Vertex AI Reasoning Engines & Agent Spaces
5
- Author: AxG-AI-Exchange-GenAI-Initiative
6
5
  Author-email: Sergio Estrada <sergio.estrada@accenture.com>
7
6
  License: Apache-2.0
8
7
  Project-URL: Homepage, https://github.com/AxG-AI-Exchange-GenAI-Initiative/AIXAgentDeploymentService
9
8
  Project-URL: Repository, https://github.com/AxG-AI-Exchange-GenAI-Initiative/AIXAgentDeploymentService
10
9
  Project-URL: Issues, https://github.com/AxG-AI-Exchange-GenAI-Initiative/AIXAgentDeploymentService/issues
11
- Requires-Python: >=3.7
10
+ Requires-Python: >=3.9
12
11
  Description-Content-Type: text/markdown
13
12
  Requires-Dist: requests>=2.28
14
13
  Requires-Dist: python-dotenv>=1.0
15
14
  Requires-Dist: google-auth>=2.20
16
15
  Requires-Dist: google-cloud-storage>=2.16
16
+ Requires-Dist: google-cloud-aiplatform[adk,agent-engines]>=1.88.0
17
+ Requires-Dist: protobuf<7.0.0,>=4.21
17
18
  Requires-Dist: keyring>=24.0
18
19
  Requires-Dist: keyrings.google-artifactregistry-auth>=1.1
19
- Requires-Dist: google-cloud-aiplatform>=1.50.0
20
- Requires-Dist: protobuf<7.0.0,>=4.21
20
+ Requires-Dist: PyYAML>=6.0
21
21
  Requires-Dist: click>=8.0
22
22
  Provides-Extra: dev
23
23
  Requires-Dist: pytest; extra == "dev"
@@ -25,8 +25,6 @@ Requires-Dist: build; extra == "dev"
25
25
  Requires-Dist: twine; extra == "dev"
26
26
  Requires-Dist: black; extra == "dev"
27
27
  Requires-Dist: ruff; extra == "dev"
28
- Dynamic: author
29
- Dynamic: requires-python
30
28
 
31
29
  # Reasoning Deployment Service
32
30
 
@@ -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=V3JDWeVaP0q6Xd2iwk8co0Nio8lzQQU2tHbX9VlsrCc,4684
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
@@ -9,8 +9,6 @@ reasoning_deployment_service/cli_editor/google_deps.py,sha256=PhGwdKEC96GdlFHkQr
9
9
  reasoning_deployment_service/cli_editor/reasoning_engine_creator.py,sha256=6QC8Y9yZAT8SYNkT_R00g_SSOYuwEkIxAN9lBG3br2k,19564
10
10
  reasoning_deployment_service/gui_editor/__init__.py,sha256=e5e88iNTk1GC243DRsQFi5E7PqMaT2SXmqOez9FbYzo,128
11
11
  reasoning_deployment_service/gui_editor/main.py,sha256=4UzgGUga_xIYIWRVo-80PzhJ1Dlou8PaUXoRiLcLhp8,10914
12
- reasoning_deployment_service/gui_editor/requirements_minimal.txt,sha256=tiv36KUcIx496Ewuh_FqXyhMhGOrtqsYfKEdn85XXYQ,1179
13
- reasoning_deployment_service/gui_editor/run_program.sh,sha256=xfim6JJiDc7KtGckcVl_K732WtZYfvBogLfslYBXb0Q,1489
14
12
  reasoning_deployment_service/gui_editor/src/__init__.py,sha256=q4YBECQGHtHV_TF4MyL36ElWe6tdVgmoNchN1lQU7z4,25
15
13
  reasoning_deployment_service/gui_editor/src/core/__init__.py,sha256=kH-6PxUQ-uVn79ihXN3eLyv_oFhReVsVz-f-kEK_qUo,46
16
14
  reasoning_deployment_service/gui_editor/src/core/api_client.py,sha256=rGyFKRyBY_MjRsnWxVI1IX1WAYTEfM1V5X3l1iR8GaI,26845
@@ -23,8 +21,8 @@ reasoning_deployment_service/gui_editor/src/ui/authorization_view.py,sha256=uiyN
23
21
  reasoning_deployment_service/gui_editor/src/ui/reasoning_engine_view.py,sha256=tCvSPEf4dW0NRdAqfs3yT5Pa873gYeLzCMMIt2r2T4o,14644
24
22
  reasoning_deployment_service/gui_editor/src/ui/reasoning_engines_view.py,sha256=IRjFlBbY98usAZa0roOonjvWQOsF6NBW4bBg_k8KnKI,7860
25
23
  reasoning_deployment_service/gui_editor/src/ui/ui_components.py,sha256=HdQHy-oSZ3GobQ3FNdH7y_w3ANbFiuf2rMoflAmff0A,55366
26
- reasoning_deployment_service-0.3.3.dist-info/METADATA,sha256=N3ghPq44EwdOol9Bq8c081Yn4orT0TB4GlB4whU_gUs,5027
27
- reasoning_deployment_service-0.3.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
28
- reasoning_deployment_service-0.3.3.dist-info/entry_points.txt,sha256=onGKjR5ONTtRv3aqEtK863iw9Ty1kLcjfZlsplkRZrA,84
29
- reasoning_deployment_service-0.3.3.dist-info/top_level.txt,sha256=GKuQS1xHUYLZbatw9DmcYdBxxLhWhhGkV4FmFxgKdp0,29
30
- reasoning_deployment_service-0.3.3.dist-info/RECORD,,
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,,
@@ -1,54 +0,0 @@
1
- # Bare minimum requirements for Agent Space Deployment Service
2
- # Core functionality dependencies only
3
-
4
- # Google Cloud & Vertex AI (CORE REQUIREMENT)
5
- google-cloud-aiplatform==1.108.0
6
- vertexai==1.43.0
7
- google-auth==2.40.3
8
- google-auth-oauthlib==1.2.2
9
- google-api-python-client==2.178.0
10
-
11
- # Environment management (CORE REQUIREMENT)
12
- python-dotenv==1.1.1
13
-
14
- # HTTP requests (CORE REQUIREMENT)
15
- requests==2.32.4
16
-
17
- # Google Cloud dependencies (CORE REQUIREMENT)
18
- google-api-core==2.25.1
19
- googleapis-common-protos==1.70.0
20
- grpcio==1.74.0
21
- protobuf==6.31.1
22
-
23
- # Authentication dependencies (CORE REQUIREMENT)
24
- google-auth-httplib2==0.2.0
25
- cachetools==5.5.2
26
- pyasn1==0.6.1
27
- pyasn1_modules==0.4.2
28
- rsa==4.9.1
29
-
30
- # Core Python utilities (CORE REQUIREMENT)
31
- certifi==2025.8.3
32
- urllib3==2.5.0
33
- six==1.17.0
34
-
35
- # OPTIONAL: For enhanced functionality
36
- # Uncomment if you need these features:
37
-
38
- # For MCP server support:
39
- # mcp==1.12.4
40
-
41
- # For FastAPI endpoints (if you plan to add web interface):
42
- # fastapi==0.116.1
43
- # uvicorn==0.35.0
44
- # pydantic==2.11.7
45
-
46
- # For document processing in agents:
47
- # PyPDF2==3.0.1
48
- # python-docx==1.2.0
49
-
50
- # For web scraping/HTTP in agents:
51
- # httpx==0.28.1
52
-
53
- # For YAML configuration:
54
- # PyYAML==6.0.2
@@ -1,55 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -e
3
-
4
- VENV_DIR=".venv"
5
-
6
- # Detect Python executable
7
- if command -v python3 &>/dev/null; then
8
- PYTHON=python3
9
- elif command -v python &>/dev/null; then
10
- PYTHON=python
11
- else
12
- echo "❌ Python is not installed. Please install Python 3.9+."
13
- exit 1
14
- fi
15
-
16
- # Create venv if missing
17
- if [ ! -d "$VENV_DIR" ]; then
18
- echo "🔧 Creating virtual environment..."
19
- $PYTHON -m venv "$VENV_DIR"
20
- fi
21
-
22
- # Activate venv (POSIX)
23
- if [ -f "$VENV_DIR/bin/activate" ]; then
24
- source "$VENV_DIR/bin/activate"
25
- # Activate venv (Windows Git Bash or Cygwin)
26
- elif [ -f "$VENV_DIR/Scripts/activate" ]; then
27
- source "$VENV_DIR/Scripts/activate"
28
- else
29
- echo "❌ Could not find venv activation script."
30
- exit 1
31
- fi
32
-
33
- # Install Tkinter if on Linux
34
- if [[ "$OSTYPE" == "linux-gnu"* ]]; then
35
- echo "🖼 Installing Tkinter for Linux..."
36
- if command -v apt-get &>/dev/null; then
37
- sudo apt-get update && sudo apt-get install -y python3-tk
38
- elif command -v dnf &>/dev/null; then
39
- sudo dnf install -y python3-tkinter
40
- elif command -v pacman &>/dev/null; then
41
- sudo pacman -S --noconfirm tk
42
- else
43
- echo "⚠️ Could not determine package manager. Install python3-tk manually."
44
- fi
45
- fi
46
-
47
- # Install dependencies
48
- echo "📦 Installing dependencies..."
49
- pip3 install --upgrade pip
50
- # Install the reasoning deployment service with GUI extras
51
- pip3 install "reasoning-deployment-service[gui]"
52
-
53
- # Run your app
54
- echo "🚀 Starting app..."
55
- $PYTHON main.py