reasoning-deployment-service 0.4.3__tar.gz → 0.4.6__tar.gz
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-0.4.3 → reasoning_deployment_service-0.4.6}/PKG-INFO +1 -1
- {reasoning_deployment_service-0.4.3 → reasoning_deployment_service-0.4.6}/pyproject.toml +1 -1
- {reasoning_deployment_service-0.4.3 → reasoning_deployment_service-0.4.6}/reasoning_deployment_service/reasoning_deployment_service.py +106 -53
- {reasoning_deployment_service-0.4.3 → reasoning_deployment_service-0.4.6}/reasoning_deployment_service/runner.py +4 -2
- {reasoning_deployment_service-0.4.3 → reasoning_deployment_service-0.4.6}/reasoning_deployment_service.egg-info/PKG-INFO +1 -1
- {reasoning_deployment_service-0.4.3 → reasoning_deployment_service-0.4.6}/README.md +0 -0
- {reasoning_deployment_service-0.4.3 → reasoning_deployment_service-0.4.6}/reasoning_deployment_service/__init__.py +0 -0
- {reasoning_deployment_service-0.4.3 → reasoning_deployment_service-0.4.6}/reasoning_deployment_service/cli_editor/__init__.py +0 -0
- {reasoning_deployment_service-0.4.3 → reasoning_deployment_service-0.4.6}/reasoning_deployment_service/cli_editor/api_client.py +0 -0
- {reasoning_deployment_service-0.4.3 → reasoning_deployment_service-0.4.6}/reasoning_deployment_service/cli_editor/cli_runner.py +0 -0
- {reasoning_deployment_service-0.4.3 → reasoning_deployment_service-0.4.6}/reasoning_deployment_service/cli_editor/config.py +0 -0
- {reasoning_deployment_service-0.4.3 → reasoning_deployment_service-0.4.6}/reasoning_deployment_service/cli_editor/google_deps.py +0 -0
- {reasoning_deployment_service-0.4.3 → reasoning_deployment_service-0.4.6}/reasoning_deployment_service/cli_editor/reasoning_engine_creator.py +0 -0
- {reasoning_deployment_service-0.4.3 → reasoning_deployment_service-0.4.6}/reasoning_deployment_service/gui_editor/__init__.py +0 -0
- {reasoning_deployment_service-0.4.3 → reasoning_deployment_service-0.4.6}/reasoning_deployment_service/gui_editor/agent_checkbox_list.py +0 -0
- {reasoning_deployment_service-0.4.3 → reasoning_deployment_service-0.4.6}/reasoning_deployment_service/gui_editor/main.py +0 -0
- {reasoning_deployment_service-0.4.3 → reasoning_deployment_service-0.4.6}/reasoning_deployment_service/gui_editor/src/__init__.py +0 -0
- {reasoning_deployment_service-0.4.3 → reasoning_deployment_service-0.4.6}/reasoning_deployment_service/gui_editor/src/core/__init__.py +0 -0
- {reasoning_deployment_service-0.4.3 → reasoning_deployment_service-0.4.6}/reasoning_deployment_service/gui_editor/src/core/api_client.py +0 -0
- {reasoning_deployment_service-0.4.3 → reasoning_deployment_service-0.4.6}/reasoning_deployment_service/gui_editor/src/core/config.py +0 -0
- {reasoning_deployment_service-0.4.3 → reasoning_deployment_service-0.4.6}/reasoning_deployment_service/gui_editor/src/core/google_deps.py +0 -0
- {reasoning_deployment_service-0.4.3 → reasoning_deployment_service-0.4.6}/reasoning_deployment_service/gui_editor/src/core/reasoning_engine_creator.py +0 -0
- {reasoning_deployment_service-0.4.3 → reasoning_deployment_service-0.4.6}/reasoning_deployment_service/gui_editor/src/ui/__init__.py +0 -0
- {reasoning_deployment_service-0.4.3 → reasoning_deployment_service-0.4.6}/reasoning_deployment_service/gui_editor/src/ui/agent_space_view.py +0 -0
- {reasoning_deployment_service-0.4.3 → reasoning_deployment_service-0.4.6}/reasoning_deployment_service/gui_editor/src/ui/authorization_view.py +0 -0
- {reasoning_deployment_service-0.4.3 → reasoning_deployment_service-0.4.6}/reasoning_deployment_service/gui_editor/src/ui/reasoning_engine_view.py +0 -0
- {reasoning_deployment_service-0.4.3 → reasoning_deployment_service-0.4.6}/reasoning_deployment_service/gui_editor/src/ui/reasoning_engines_view.py +0 -0
- {reasoning_deployment_service-0.4.3 → reasoning_deployment_service-0.4.6}/reasoning_deployment_service/gui_editor/src/ui/ui_components.py +0 -0
- {reasoning_deployment_service-0.4.3 → reasoning_deployment_service-0.4.6}/reasoning_deployment_service.egg-info/SOURCES.txt +0 -0
- {reasoning_deployment_service-0.4.3 → reasoning_deployment_service-0.4.6}/reasoning_deployment_service.egg-info/dependency_links.txt +0 -0
- {reasoning_deployment_service-0.4.3 → reasoning_deployment_service-0.4.6}/reasoning_deployment_service.egg-info/entry_points.txt +0 -0
- {reasoning_deployment_service-0.4.3 → reasoning_deployment_service-0.4.6}/reasoning_deployment_service.egg-info/requires.txt +0 -0
- {reasoning_deployment_service-0.4.3 → reasoning_deployment_service-0.4.6}/reasoning_deployment_service.egg-info/top_level.txt +0 -0
- {reasoning_deployment_service-0.4.3 → reasoning_deployment_service-0.4.6}/setup.cfg +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "reasoning-deployment-service"
|
|
7
|
-
version = "0.4.
|
|
7
|
+
version = "0.4.6"
|
|
8
8
|
description = "Deployment helper for Vertex AI Reasoning Engines & Agent Spaces"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "Apache-2.0" }
|
|
@@ -766,8 +766,82 @@ class ReasoningEngineDeploymentService:
|
|
|
766
766
|
)
|
|
767
767
|
|
|
768
768
|
return matches[0]
|
|
769
|
+
|
|
770
|
+
def patch_agent_space_metadata_and_auth(
|
|
771
|
+
self,
|
|
772
|
+
agent_id: str,
|
|
773
|
+
new_display_name: Optional[str] = None,
|
|
774
|
+
new_description: Optional[str] = None,
|
|
775
|
+
new_reasoning_engine: Optional[str] = None,
|
|
776
|
+
new_authorizations: Optional[list[str]] = None,
|
|
777
|
+
) -> dict:
|
|
778
|
+
"""
|
|
779
|
+
Patch only metadata (displayName, description) and linkage fields
|
|
780
|
+
(reasoningEngine, authorizations) for an existing Agent Space agent.
|
|
781
|
+
"""
|
|
782
|
+
url = (
|
|
783
|
+
f"{DISCOVERY_ENGINE_URL}/projects/{self._project_id}/locations/global/"
|
|
784
|
+
f"collections/default_collection/engines/{self._agent_space_engine}/"
|
|
785
|
+
f"assistants/default_assistant/agents/{agent_id}"
|
|
786
|
+
)
|
|
787
|
+
headers = self._get_headers()
|
|
788
|
+
|
|
789
|
+
# GET current agent
|
|
790
|
+
resp = self._http.get(url, headers=headers, timeout=60)
|
|
791
|
+
resp.raise_for_status()
|
|
792
|
+
agent_data = resp.json()
|
|
793
|
+
|
|
794
|
+
# Prepare PATCH payload
|
|
795
|
+
patch_payload = {}
|
|
796
|
+
|
|
797
|
+
if new_display_name:
|
|
798
|
+
patch_payload["displayName"] = new_display_name
|
|
799
|
+
if new_description:
|
|
800
|
+
patch_payload["description"] = new_description
|
|
801
|
+
|
|
802
|
+
adk_def = agent_data.get("adkAgentDefinition", {})
|
|
803
|
+
patch_adk_def = {}
|
|
804
|
+
|
|
805
|
+
if new_reasoning_engine:
|
|
806
|
+
patch_adk_def.setdefault("provisionedReasoningEngine", {})[
|
|
807
|
+
"reasoningEngine"
|
|
808
|
+
] = new_reasoning_engine
|
|
809
|
+
|
|
810
|
+
if new_authorizations is not None:
|
|
811
|
+
patch_adk_def["authorizations"] = new_authorizations
|
|
769
812
|
|
|
770
|
-
|
|
813
|
+
if patch_adk_def:
|
|
814
|
+
patch_payload["adkAgentDefinition"] = patch_adk_def
|
|
815
|
+
|
|
816
|
+
# Build updateMask
|
|
817
|
+
update_mask = []
|
|
818
|
+
if "displayName" in patch_payload:
|
|
819
|
+
update_mask.append("display_name")
|
|
820
|
+
if "description" in patch_payload:
|
|
821
|
+
update_mask.append("description")
|
|
822
|
+
if "adkAgentDefinition" in patch_payload:
|
|
823
|
+
if "provisionedReasoningEngine" in patch_payload["adkAgentDefinition"]:
|
|
824
|
+
update_mask.append("adk_agent_definition.provisioned_reasoning_engine")
|
|
825
|
+
if "authorizations" in patch_payload["adkAgentDefinition"]:
|
|
826
|
+
update_mask.append("adk_agent_definition.authorizations")
|
|
827
|
+
|
|
828
|
+
if not update_mask:
|
|
829
|
+
self.info("[AGENT PATCH] Nothing to update.")
|
|
830
|
+
return agent_data
|
|
831
|
+
|
|
832
|
+
patch_url = f"{url}"
|
|
833
|
+
self.info(f"[AGENT PATCH] PATCH {patch_url} with payload={json.dumps(patch_payload, indent=2)}")
|
|
834
|
+
|
|
835
|
+
patch_resp = self._http.patch(patch_url, headers=headers, json=patch_payload, timeout=60)
|
|
836
|
+
patch_resp.raise_for_status()
|
|
837
|
+
|
|
838
|
+
return patch_resp.json()
|
|
839
|
+
|
|
840
|
+
def one_githhub_deployment_to_go_with_skip(self):
|
|
841
|
+
return self.one_github_deployment_to_go(skip_engine=True)
|
|
842
|
+
|
|
843
|
+
|
|
844
|
+
def one_github_deployment_to_go(self, skip_engine=False):
|
|
771
845
|
"""
|
|
772
846
|
CI-friendly deploy:
|
|
773
847
|
- Engine: create or update by display_name.
|
|
@@ -800,19 +874,20 @@ class ReasoningEngineDeploymentService:
|
|
|
800
874
|
engine_rn = self.find_engine_by_name(self._reasoning_engine_name)
|
|
801
875
|
self.info(f"[ENGINE] find_engine_by_name -> {engine_rn}")
|
|
802
876
|
|
|
803
|
-
if not
|
|
804
|
-
self.info(f"[ENGINE] '{self._reasoning_engine_name}' not found. Creating...")
|
|
805
|
-
self.create_reasoning_engine()
|
|
806
|
-
rec_after_create = self._read_engine_deployment_record()
|
|
807
|
-
self.info(f"[ENGINE] record after create -> {json.dumps(rec_after_create, indent=2)}")
|
|
808
|
-
engine_rn = rec_after_create.get("reasoning_engine_id") or self.find_engine_by_name(self._reasoning_engine_name)
|
|
809
|
-
self.info(f"[ENGINE] post-create resolution -> {engine_rn}")
|
|
877
|
+
if not skip_engine:
|
|
810
878
|
if not engine_rn:
|
|
811
|
-
self.
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
879
|
+
self.info(f"[ENGINE] '{self._reasoning_engine_name}' not found. Creating...")
|
|
880
|
+
self.create_reasoning_engine()
|
|
881
|
+
rec_after_create = self._read_engine_deployment_record()
|
|
882
|
+
self.info(f"[ENGINE] record after create -> {json.dumps(rec_after_create, indent=2)}")
|
|
883
|
+
engine_rn = rec_after_create.get("reasoning_engine_id") or self.find_engine_by_name(self._reasoning_engine_name)
|
|
884
|
+
self.info(f"[ENGINE] post-create resolution -> {engine_rn}")
|
|
885
|
+
if not engine_rn:
|
|
886
|
+
self.error("[ENGINE] Creation did not yield a resource name.")
|
|
887
|
+
raise RuntimeError("Engine creation failed.")
|
|
888
|
+
else:
|
|
889
|
+
self.info(f"[ENGINE] '{self._reasoning_engine_name}' exists. Updating...")
|
|
890
|
+
self.update_reasoning_engine(engine_rn)
|
|
816
891
|
|
|
817
892
|
self.info(f"[ENGINE] final engine_rn={engine_rn}")
|
|
818
893
|
|
|
@@ -877,7 +952,6 @@ class ReasoningEngineDeploymentService:
|
|
|
877
952
|
"tokenUri": "https://oauth2.googleapis.com/token",
|
|
878
953
|
}
|
|
879
954
|
}
|
|
880
|
-
# remove None to keep payload clean
|
|
881
955
|
if patch_payload["serverSideOauth2"]["clientSecret"] is None:
|
|
882
956
|
patch_payload["serverSideOauth2"].pop("clientSecret", None)
|
|
883
957
|
|
|
@@ -899,59 +973,38 @@ class ReasoningEngineDeploymentService:
|
|
|
899
973
|
self.info("[AUTH] No authorization_id configured; skipping authorization step.")
|
|
900
974
|
|
|
901
975
|
# -----------------------------
|
|
902
|
-
# 3) Agent Space Agent (create or update
|
|
976
|
+
# 3) Agent Space Agent (create or update)
|
|
903
977
|
# -----------------------------
|
|
904
978
|
self.info(f"[AGENT] Resolving by display_name={self._agent_space_name}")
|
|
905
979
|
existing_agent = self.find_agent_space_agents_by_display(self._agent_space_name)
|
|
906
980
|
self.info(f"[AGENT] find_agent_space_agents_by_display -> {json.dumps(existing_agent, indent=2)}")
|
|
907
981
|
|
|
908
|
-
headers, payload = self._get_agent_space_payload(engine_rn)
|
|
909
|
-
headers_log = headers.copy()
|
|
910
|
-
if "Authorization" in headers_log:
|
|
911
|
-
headers_log["Authorization"] = "Bearer ***"
|
|
912
|
-
self.info(f"[AGENT] request headers={json.dumps(headers_log)}")
|
|
913
|
-
self.info(f"[AGENT] payload={json.dumps(payload, indent=2)}")
|
|
914
|
-
|
|
915
982
|
if not existing_agent:
|
|
916
|
-
|
|
983
|
+
# Fresh create
|
|
984
|
+
headers, payload = self._get_agent_space_payload(engine_rn)
|
|
917
985
|
create_url = self._get_agent_space_agent_url_new()
|
|
918
986
|
self.info(f"[AGENT] POST {create_url}")
|
|
919
987
|
cr = self._http.post(create_url, headers=headers, json=payload, timeout=90)
|
|
920
|
-
self.info(f"[AGENT] POST status={cr.status_code}
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
except Exception:
|
|
924
|
-
self.info(f"[AGENT] POST text={(cr.text or '')[:1000]}")
|
|
925
|
-
if cr.status_code >= 400:
|
|
926
|
-
self.error(f"[AGENT] Creation failed [{cr.status_code}].")
|
|
927
|
-
cr.raise_for_status()
|
|
928
|
-
|
|
929
|
-
try:
|
|
930
|
-
j = cr.json() or {}
|
|
931
|
-
except Exception:
|
|
932
|
-
j = {}
|
|
933
|
-
agent_name = j.get("name")
|
|
934
|
-
self.info(f"[AGENT] create response name={agent_name}")
|
|
988
|
+
self.info(f"[AGENT] POST status={cr.status_code}")
|
|
989
|
+
cr.raise_for_status()
|
|
990
|
+
agent_name = (cr.json() or {}).get("name")
|
|
935
991
|
if agent_name:
|
|
936
992
|
self._write_engine_deployment({"agent_space_id": agent_name})
|
|
937
993
|
self.info(f"[AGENT] Created: {agent_name}")
|
|
938
994
|
else:
|
|
939
995
|
self.warning("[AGENT] Created but response missing name. Verify in console.")
|
|
940
996
|
else:
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
self.
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
self.error(f"[AGENT] Update failed [{ur.status_code}].")
|
|
954
|
-
ur.raise_for_status()
|
|
955
|
-
self.info("[AGENT] Agent Space agent updated.")
|
|
997
|
+
# Safe patch using our new helper
|
|
998
|
+
self.info(f"[AGENT] '{self._agent_space_name}' exists. Patching metadata and auth only...")
|
|
999
|
+
patched = self.patch_agent_space_metadata_and_auth(
|
|
1000
|
+
agent_id=existing_agent["id"],
|
|
1001
|
+
new_display_name=self._agent_space_name,
|
|
1002
|
+
new_description=self._agent_space_description,
|
|
1003
|
+
new_reasoning_engine=engine_rn,
|
|
1004
|
+
new_authorizations=[
|
|
1005
|
+
f"projects/{self._project_id}/locations/global/authorizations/{self._authorization_id}"
|
|
1006
|
+
] if self._authorization_id else None,
|
|
1007
|
+
)
|
|
1008
|
+
self.info(f"[AGENT] PATCH result -> {json.dumps(patched, indent=2)[:2000]}")
|
|
956
1009
|
|
|
957
1010
|
self.info("GitHub deployment completed successfully.")
|
|
@@ -13,7 +13,7 @@ class Runner:
|
|
|
13
13
|
parser = argparse.ArgumentParser(description="Reasoning Engine Deployment Runner")
|
|
14
14
|
parser.add_argument(
|
|
15
15
|
"--mode",
|
|
16
|
-
choices=["create", "auth", "cli", "gui", "populate_files", "github_deployment"],
|
|
16
|
+
choices=["create", "auth", "cli", "gui", "populate_files", "github_deployment", "github_deployment_without_engine"],
|
|
17
17
|
help="Operation mode to run",
|
|
18
18
|
)
|
|
19
19
|
parser.add_argument(
|
|
@@ -133,12 +133,14 @@ class Runner:
|
|
|
133
133
|
svc._check_required_files_exist()
|
|
134
134
|
elif mode == "github_deployment":
|
|
135
135
|
svc.one_github_deployment_to_go()
|
|
136
|
+
elif mode == "github_deployment_without_engine":
|
|
137
|
+
svc.one_githhub_deployment_to_go_with_skip()
|
|
136
138
|
|
|
137
139
|
@staticmethod
|
|
138
140
|
def _menu(root_agent):
|
|
139
141
|
print("Choose an operation:\n1) Create/Update\n2) Auth only\n3) CLI\n4) GUI\nq) Quit")
|
|
140
142
|
choice = input("Enter choice: ").strip().lower()
|
|
141
|
-
mapping = {"1": "create", "2": "auth", "3": "cli", "4": "gui", "5": "github_deployment"}
|
|
143
|
+
mapping = {"1": "create", "2": "auth", "3": "cli", "4": "gui", "5": "github_deployment", "6": "github_deployment_without_engine"}
|
|
142
144
|
if choice == "q":
|
|
143
145
|
sys.exit(0)
|
|
144
146
|
Runner._dispatch(mapping.get(choice, ""), root_agent)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|