google-cloud-agentplatform 2.0.1__tar.gz → 2.1.3__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.
- {google_cloud_agentplatform-2.0.1/google_cloud_agentplatform.egg-info → google_cloud_agentplatform-2.1.3}/PKG-INFO +12 -8
- google_cloud_agentplatform-2.1.3/README.md +21 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/_evals_common.py +3 -28
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/_gcs_utils.py +12 -2
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/sandbox_templates.py +7 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/sandboxes.py +155 -15
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/types/__init__.py +5 -3
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/types/common.py +124 -112
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/version.py +1 -1
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3/google_cloud_agentplatform.egg-info}/PKG-INFO +12 -8
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/pyproject.toml +4 -4
- google_cloud_agentplatform-2.0.1/README.md +0 -17
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/LICENSE +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/__init__.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/__init__.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/_bigquery_utils.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/_datasets_utils.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/_evals_builtin_tools.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/_evals_constant.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/_evals_data_converters.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/_evals_metric_handlers.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/_evals_metric_loaders.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/_evals_utils.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/_evals_visualization.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/_logging_utils.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/_memory_bank_utils.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/_observability_data_converter.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/_operations_utils.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/_prompt_management_utils.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/_prompt_optimizer_utils.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/_runtimes_utils.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/_skills_utils.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/_transformers.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/a2a_task_events.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/a2a_tasks.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/client.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/datasets.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/endpoints.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/evals.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/example_stores.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/feedback_contexts.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/feedback_entries.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/live.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/live_runtimes.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/memories.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/memory_banks.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/memory_revisions.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/model_garden.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/prompt_optimizer.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/prompts.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/rag.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/runtime_revisions.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/runtimes.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/sandbox_snapshots.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/session_events.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/sessions.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/skill_revisions.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/skills.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/types/agent_engines.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/types/evals.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/types/prompt_optimizer.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/types/prompts.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/frameworks/__init__.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/frameworks/a2a.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/frameworks/adk.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/frameworks/ag2.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/frameworks/langchain.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/frameworks/langgraph.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/frameworks/llama_index.py +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/google_cloud_agentplatform.egg-info/SOURCES.txt +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/google_cloud_agentplatform.egg-info/dependency_links.txt +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/google_cloud_agentplatform.egg-info/requires.txt +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/google_cloud_agentplatform.egg-info/top_level.txt +0 -0
- {google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/setup.cfg +0 -0
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: google-cloud-agentplatform
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.1.3
|
|
4
4
|
Summary: Google Cloud Agent Platform Client Library
|
|
5
5
|
Author-email: Google LLC <googleapis-packages@google.com>
|
|
6
6
|
License: Apache-2.0
|
|
7
|
-
Classifier: Development Status ::
|
|
7
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
8
8
|
Classifier: Intended Audience :: Developers
|
|
9
9
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
13
11
|
Classifier: Programming Language :: Python :: 3.10
|
|
14
12
|
Classifier: Programming Language :: Python :: 3.11
|
|
15
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
-
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
16
|
+
Requires-Python: >=3.10
|
|
17
17
|
Description-Content-Type: text/markdown
|
|
18
18
|
License-File: LICENSE
|
|
19
19
|
Requires-Dist: google-auth
|
|
@@ -74,9 +74,9 @@ Provides-Extra: all
|
|
|
74
74
|
Requires-Dist: google-cloud-agentplatform[a2a,adk,ag2,agent_engines,bigquery,evaluation,langchain,live,llama_index]; extra == "all"
|
|
75
75
|
Dynamic: license-file
|
|
76
76
|
|
|
77
|
-
#
|
|
77
|
+
# Gemini Enterprise Agent Platform
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
Gemini Enterprise Agent Platform Client Library.
|
|
80
80
|
|
|
81
81
|
## Installation
|
|
82
82
|
|
|
@@ -85,9 +85,13 @@ This is the packaging directory for `google-cloud-agentplatform`.
|
|
|
85
85
|
pip install google-cloud-agentplatform
|
|
86
86
|
|
|
87
87
|
# With specific extras
|
|
88
|
+
pip install google-cloud-agentplatform[agent_engines]
|
|
89
|
+
pip install google-cloud-agentplatform[a2a]
|
|
88
90
|
pip install google-cloud-agentplatform[adk]
|
|
89
91
|
pip install google-cloud-agentplatform[langchain]
|
|
92
|
+
pip install google-cloud-agentplatform[ag2]
|
|
93
|
+
pip install google-cloud-agentplatform[llama_index]
|
|
90
94
|
pip install google-cloud-agentplatform[evaluation]
|
|
91
95
|
pip install google-cloud-agentplatform[bigquery]
|
|
96
|
+
pip install google-cloud-agentplatform[live]
|
|
92
97
|
pip install google-cloud-agentplatform[all]
|
|
93
|
-
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Gemini Enterprise Agent Platform
|
|
2
|
+
|
|
3
|
+
Gemini Enterprise Agent Platform Client Library.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Core installation
|
|
9
|
+
pip install google-cloud-agentplatform
|
|
10
|
+
|
|
11
|
+
# With specific extras
|
|
12
|
+
pip install google-cloud-agentplatform[agent_engines]
|
|
13
|
+
pip install google-cloud-agentplatform[a2a]
|
|
14
|
+
pip install google-cloud-agentplatform[adk]
|
|
15
|
+
pip install google-cloud-agentplatform[langchain]
|
|
16
|
+
pip install google-cloud-agentplatform[ag2]
|
|
17
|
+
pip install google-cloud-agentplatform[llama_index]
|
|
18
|
+
pip install google-cloud-agentplatform[evaluation]
|
|
19
|
+
pip install google-cloud-agentplatform[bigquery]
|
|
20
|
+
pip install google-cloud-agentplatform[live]
|
|
21
|
+
pip install google-cloud-agentplatform[all]
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
"""Common utilities for evals."""
|
|
16
16
|
|
|
17
17
|
import asyncio
|
|
18
|
-
import base64
|
|
19
18
|
import collections
|
|
20
19
|
import concurrent.futures
|
|
21
20
|
import contextlib
|
|
@@ -4078,32 +4077,6 @@ async def _convert_evaluation_run_results_async(
|
|
|
4078
4077
|
return eval_result, eval_item_map
|
|
4079
4078
|
|
|
4080
4079
|
|
|
4081
|
-
def _object_to_dict(obj: Any) -> Union[dict[str, Any], Any]:
|
|
4082
|
-
"""Converts an object to a dictionary."""
|
|
4083
|
-
if obj is None:
|
|
4084
|
-
return obj
|
|
4085
|
-
if isinstance(obj, (int, float, str, bool)):
|
|
4086
|
-
return obj
|
|
4087
|
-
if isinstance(obj, datetime.datetime):
|
|
4088
|
-
return obj.isoformat()
|
|
4089
|
-
if isinstance(obj, bytes):
|
|
4090
|
-
return base64.b64encode(obj).decode("utf-8")
|
|
4091
|
-
if isinstance(obj, (list, tuple)):
|
|
4092
|
-
return [_object_to_dict(item) for item in obj]
|
|
4093
|
-
if isinstance(obj, dict):
|
|
4094
|
-
return {k: _object_to_dict(v) for k, v in obj.items()}
|
|
4095
|
-
|
|
4096
|
-
if not hasattr(obj, "__dict__"):
|
|
4097
|
-
return obj # Not an object with attributes, return as is (e.g., set)
|
|
4098
|
-
|
|
4099
|
-
result: dict[str, Any] = {}
|
|
4100
|
-
for key, value in obj.__dict__.items():
|
|
4101
|
-
if value is None:
|
|
4102
|
-
continue
|
|
4103
|
-
result[key] = _object_to_dict(value)
|
|
4104
|
-
return result
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
4080
|
def _get_content(row: dict[str, Any], column: str) -> Optional[genai_types.Content]:
|
|
4108
4081
|
if isinstance(row[column], str):
|
|
4109
4082
|
return genai_types.Content(
|
|
@@ -4248,7 +4221,9 @@ def _create_evaluation_set_from_dataframe(
|
|
|
4248
4221
|
eval_items = []
|
|
4249
4222
|
for eval_item_request in eval_item_requests:
|
|
4250
4223
|
gcs_uri = gcs_utils.upload_json_to_prefix(
|
|
4251
|
-
data=
|
|
4224
|
+
data=eval_item_request.model_dump(
|
|
4225
|
+
mode="json", by_alias=True, exclude_none=True
|
|
4226
|
+
),
|
|
4252
4227
|
gcs_dest_prefix=gcs_dest_prefix,
|
|
4253
4228
|
filename_prefix="request",
|
|
4254
4229
|
)
|
|
@@ -17,13 +17,15 @@ from importlib.metadata import version as get_version
|
|
|
17
17
|
import io
|
|
18
18
|
import json
|
|
19
19
|
import logging
|
|
20
|
-
from typing import Any, Union
|
|
20
|
+
from typing import Any, TYPE_CHECKING, Union
|
|
21
21
|
import uuid
|
|
22
22
|
|
|
23
23
|
from google.cloud import storage # type: ignore[attr-defined]
|
|
24
24
|
from google.genai._api_client import BaseApiClient
|
|
25
25
|
from packaging.version import Version
|
|
26
|
-
|
|
26
|
+
|
|
27
|
+
if TYPE_CHECKING:
|
|
28
|
+
import pandas as pd
|
|
27
29
|
|
|
28
30
|
|
|
29
31
|
logger = logging.getLogger(__name__)
|
|
@@ -211,6 +213,14 @@ class GcsUtils:
|
|
|
211
213
|
self, gcs_filepath: str, file_type: str
|
|
212
214
|
) -> "pd.DataFrame":
|
|
213
215
|
"""Reads a file from Google Cloud Storage into a Pandas DataFrame."""
|
|
216
|
+
try:
|
|
217
|
+
import pandas as pd # pylint: disable=g-import-not-at-top
|
|
218
|
+
except ImportError as e:
|
|
219
|
+
raise ImportError(
|
|
220
|
+
"Reading a Cloud Storage file into a DataFrame requires 'pandas'. "
|
|
221
|
+
"Please install it using pip install "
|
|
222
|
+
"google-cloud-aiplatform[evaluation]"
|
|
223
|
+
) from e
|
|
214
224
|
file_contents = self.read_file_contents(gcs_filepath)
|
|
215
225
|
if file_type == "csv":
|
|
216
226
|
return pd.read_csv(io.StringIO(file_contents), encoding="utf-8")
|
|
@@ -62,6 +62,13 @@ def _CreateSandboxEnvironmentTemplateConfig_to_vertex(
|
|
|
62
62
|
getv(from_object, ["egress_control_config"]),
|
|
63
63
|
)
|
|
64
64
|
|
|
65
|
+
if getv(from_object, ["ingress_control_config"]) is not None:
|
|
66
|
+
setv(
|
|
67
|
+
parent_object,
|
|
68
|
+
["ingressControlConfig"],
|
|
69
|
+
getv(from_object, ["ingress_control_config"]),
|
|
70
|
+
)
|
|
71
|
+
|
|
65
72
|
return to_object
|
|
66
73
|
|
|
67
74
|
|
|
@@ -26,7 +26,6 @@ from typing import Any, Iterator, Optional, Union
|
|
|
26
26
|
from urllib.parse import urlencode
|
|
27
27
|
|
|
28
28
|
from google import auth as google_auth
|
|
29
|
-
from google import genai
|
|
30
29
|
from google.auth.transport import requests as google_auth_requests
|
|
31
30
|
from google.genai import _api_module
|
|
32
31
|
from google.genai import _common
|
|
@@ -34,6 +33,7 @@ from google.genai import types as genai_types
|
|
|
34
33
|
from google.genai._common import get_value_by_path as getv
|
|
35
34
|
from google.genai._common import set_value_by_path as setv
|
|
36
35
|
from google.genai.pagers import Pager
|
|
36
|
+
import requests
|
|
37
37
|
|
|
38
38
|
from . import _runtimes_utils
|
|
39
39
|
from . import types
|
|
@@ -1038,7 +1038,14 @@ class Sandboxes(_api_module.BaseModule):
|
|
|
1038
1038
|
get_operation_fn=self._get_sandbox_operation,
|
|
1039
1039
|
poll_interval_seconds=poll_interval_seconds,
|
|
1040
1040
|
)
|
|
1041
|
-
|
|
1041
|
+
# Only refresh via get() when the LRO response carries a resource
|
|
1042
|
+
# name. The pause LRO's response_type is declared as SandboxEnvironment
|
|
1043
|
+
# in the proto but the backend may return an empty payload for some
|
|
1044
|
+
# code paths, in which case operation.response.name is empty and a
|
|
1045
|
+
# get() call would produce a 404 with an unsubstituted {name} in the
|
|
1046
|
+
# request URL. Callers who want the post-pause state can call
|
|
1047
|
+
# sandboxes.get(name=name) explicitly.
|
|
1048
|
+
if operation.response and getattr(operation.response, "name", None):
|
|
1042
1049
|
operation.response = self.get(name=operation.response.name)
|
|
1043
1050
|
return operation
|
|
1044
1051
|
|
|
@@ -1084,7 +1091,11 @@ class Sandboxes(_api_module.BaseModule):
|
|
|
1084
1091
|
get_operation_fn=self._get_sandbox_operation,
|
|
1085
1092
|
poll_interval_seconds=poll_interval_seconds,
|
|
1086
1093
|
)
|
|
1087
|
-
|
|
1094
|
+
# Only refresh via get() when the LRO response carries a resource
|
|
1095
|
+
# name. Symmetric guard with pause() above: protects against a backend
|
|
1096
|
+
# response payload without a name field, which would otherwise produce
|
|
1097
|
+
# a 404 with an unsubstituted {name} in the request URL.
|
|
1098
|
+
if operation.response and getattr(operation.response, "name", None):
|
|
1088
1099
|
operation.response = self.get(name=operation.response.name)
|
|
1089
1100
|
return operation
|
|
1090
1101
|
|
|
@@ -1157,6 +1168,85 @@ class Sandboxes(_api_module.BaseModule):
|
|
|
1157
1168
|
|
|
1158
1169
|
return response
|
|
1159
1170
|
|
|
1171
|
+
def execute_bash(
|
|
1172
|
+
self,
|
|
1173
|
+
*,
|
|
1174
|
+
name: str,
|
|
1175
|
+
command: str,
|
|
1176
|
+
cwd: Optional[str] = None,
|
|
1177
|
+
timeout: Optional[int] = None,
|
|
1178
|
+
port: str = "8080",
|
|
1179
|
+
config: Optional[types.ExecuteCodeRuntimeSandboxConfigOrDict] = None,
|
|
1180
|
+
) -> dict[str, Any]:
|
|
1181
|
+
"""Runs a bash command in a shell sandbox.
|
|
1182
|
+
|
|
1183
|
+
The sandbox must have been created with a shell environment, either by
|
|
1184
|
+
passing `spec={"shell_environment": {}}` to `create()` or by referencing a
|
|
1185
|
+
template whose `default_container_category` is
|
|
1186
|
+
`DEFAULT_CONTAINER_CATEGORY_SHELL_SANDBOX`.
|
|
1187
|
+
|
|
1188
|
+
Unlike `send_command`, this authenticates with the caller's own credentials,
|
|
1189
|
+
so it needs no service account and no signed JWT.
|
|
1190
|
+
|
|
1191
|
+
Args:
|
|
1192
|
+
name (str):
|
|
1193
|
+
Required. The name of the agent engine sandbox to run the command
|
|
1194
|
+
in, of the form
|
|
1195
|
+
projects/*/locations/*/reasoningEngines/*/sandboxEnvironments/*.
|
|
1196
|
+
command (str):
|
|
1197
|
+
Required. The bash command to run.
|
|
1198
|
+
cwd (str):
|
|
1199
|
+
Optional. The working directory to run the command in. Defaults to
|
|
1200
|
+
the sandbox's workspace directory.
|
|
1201
|
+
timeout (int):
|
|
1202
|
+
Optional. Seconds to allow the command to run before the sandbox
|
|
1203
|
+
kills it. Defaults to the sandbox's own limit.
|
|
1204
|
+
port (str):
|
|
1205
|
+
Optional. The port the shell server listens on. Defaults to "8080".
|
|
1206
|
+
config (ExecuteCodeRuntimeSandboxConfigOrDict):
|
|
1207
|
+
Optional. The configuration for the request.
|
|
1208
|
+
|
|
1209
|
+
Returns:
|
|
1210
|
+
dict[str, Any]: The result of the command, with keys `stdout`,
|
|
1211
|
+
`stderr`, `returncode` and `duration_ms`. A command that exits
|
|
1212
|
+
non-zero is reported here rather than raised.
|
|
1213
|
+
|
|
1214
|
+
Raises:
|
|
1215
|
+
ValueError: If the sandbox returns no output.
|
|
1216
|
+
"""
|
|
1217
|
+
request: dict[str, Any] = {"command": command}
|
|
1218
|
+
if cwd is not None:
|
|
1219
|
+
request["cwd"] = cwd
|
|
1220
|
+
if timeout is not None:
|
|
1221
|
+
request["timeout"] = timeout
|
|
1222
|
+
|
|
1223
|
+
# The sandbox proxy addresses the container by URI and port, and forwards
|
|
1224
|
+
# the JSON chunk as the POST body.
|
|
1225
|
+
response = self._execute_code(
|
|
1226
|
+
name=name,
|
|
1227
|
+
inputs=[
|
|
1228
|
+
types.Chunk(
|
|
1229
|
+
mime_type="application/x.sandbox-request-uri",
|
|
1230
|
+
data=b"/exec",
|
|
1231
|
+
),
|
|
1232
|
+
types.Chunk(
|
|
1233
|
+
mime_type="application/x.sandbox-request-port",
|
|
1234
|
+
data=port.encode("utf-8"),
|
|
1235
|
+
),
|
|
1236
|
+
types.Chunk(
|
|
1237
|
+
mime_type="application/json",
|
|
1238
|
+
data=json.dumps(request).encode("utf-8"),
|
|
1239
|
+
),
|
|
1240
|
+
],
|
|
1241
|
+
config=config,
|
|
1242
|
+
)
|
|
1243
|
+
|
|
1244
|
+
for output in response.outputs or []:
|
|
1245
|
+
if output.data:
|
|
1246
|
+
return json.loads(output.data.decode("utf-8"))
|
|
1247
|
+
|
|
1248
|
+
raise ValueError(f"The sandbox {name} returned no output for the command.")
|
|
1249
|
+
|
|
1160
1250
|
def get(
|
|
1161
1251
|
self,
|
|
1162
1252
|
*,
|
|
@@ -1272,6 +1362,7 @@ class Sandboxes(_api_module.BaseModule):
|
|
|
1272
1362
|
query_params: Optional[dict[str, object]] = None,
|
|
1273
1363
|
headers: Optional[dict[str, str]] = None,
|
|
1274
1364
|
request_dict: Optional[dict[str, object]] = None,
|
|
1365
|
+
psc_endpoint: Optional[str] = None,
|
|
1275
1366
|
) -> genai_types.HttpResponse:
|
|
1276
1367
|
"""Sends a command to the sandbox.
|
|
1277
1368
|
|
|
@@ -1292,6 +1383,16 @@ class Sandboxes(_api_module.BaseModule):
|
|
|
1292
1383
|
Optional. The headers to include in the command.
|
|
1293
1384
|
request_dict (dict[str, object]):
|
|
1294
1385
|
Optional. The request body to include in the command.
|
|
1386
|
+
psc_endpoint (str):
|
|
1387
|
+
Optional. Host (RFC1918 IP or resolvable internal hostname) of the
|
|
1388
|
+
customer-side PSC endpoint forwarding rule that targets
|
|
1389
|
+
``connection_info.service_attachment``. Needed for VPC-SC sandboxes
|
|
1390
|
+
(``ingressControlConfig.enablePrivateServiceConnect=true``) where
|
|
1391
|
+
``connection_info.load_balancer_hostname`` and ``load_balancer_ip``
|
|
1392
|
+
are both unset because ingress goes through PSC in the customer's
|
|
1393
|
+
VPC rather than a Google-managed load balancer. When provided, it
|
|
1394
|
+
is used as the data-plane host in place of the load balancer
|
|
1395
|
+
address.
|
|
1295
1396
|
|
|
1296
1397
|
Returns:
|
|
1297
1398
|
genai_types.HttpResponse: The response from the sandbox.
|
|
@@ -1301,12 +1402,21 @@ class Sandboxes(_api_module.BaseModule):
|
|
|
1301
1402
|
connection_info = sandbox_environment.connection_info
|
|
1302
1403
|
if not connection_info:
|
|
1303
1404
|
raise ValueError("Connection info is not available.")
|
|
1304
|
-
if
|
|
1405
|
+
if psc_endpoint:
|
|
1406
|
+
# VPC-SC path: caller has provisioned a PSC endpoint against
|
|
1407
|
+
# connection_info.service_attachment and passes its host here.
|
|
1408
|
+
endpoint = "https://" + psc_endpoint
|
|
1409
|
+
elif connection_info.load_balancer_hostname:
|
|
1305
1410
|
endpoint = "https://" + connection_info.load_balancer_hostname
|
|
1306
1411
|
elif connection_info.load_balancer_ip:
|
|
1307
1412
|
endpoint = "http://" + connection_info.load_balancer_ip
|
|
1308
1413
|
else:
|
|
1309
|
-
raise ValueError(
|
|
1414
|
+
raise ValueError(
|
|
1415
|
+
"No data-plane endpoint available. Non-VPC-SC sandboxes populate"
|
|
1416
|
+
" connection_info.load_balancer_hostname; VPC-SC sandboxes require"
|
|
1417
|
+
" the caller to pass psc_endpoint (the host of the forwarding"
|
|
1418
|
+
" rule targeting connection_info.service_attachment)."
|
|
1419
|
+
)
|
|
1310
1420
|
|
|
1311
1421
|
routing_token = connection_info.routing_token
|
|
1312
1422
|
if not routing_token:
|
|
@@ -1318,15 +1428,27 @@ class Sandboxes(_api_module.BaseModule):
|
|
|
1318
1428
|
headers["Authorization"] = f"Bearer {access_token}"
|
|
1319
1429
|
headers["X-Sandbox-Routing-Token"] = routing_token
|
|
1320
1430
|
headers["X-Sandbox-Port"] = port
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
#
|
|
1325
|
-
#
|
|
1326
|
-
|
|
1431
|
+
url = endpoint + path if path.startswith("/") else endpoint + "/" + path
|
|
1432
|
+
# The sandbox data plane authenticates via the Authorization,
|
|
1433
|
+
# X-Sandbox-Routing-Token and X-Sandbox-Port headers set above, not via
|
|
1434
|
+
# ADC. Routing this through genai.Client(vertexai=True) builds an
|
|
1435
|
+
# authorized session with no credentials, whose request() then fails with
|
|
1436
|
+
# "'NoneType' object has no attribute 'before_request'". Issue the request
|
|
1437
|
+
# directly instead, mirroring generate_access_token above which also talks
|
|
1438
|
+
# to a non-aiplatform endpoint with plain requests.
|
|
1439
|
+
body = None
|
|
1440
|
+
if request_dict:
|
|
1441
|
+
body = json.dumps(request_dict)
|
|
1442
|
+
headers.setdefault("Content-Type", "application/json")
|
|
1443
|
+
response = requests.request(
|
|
1444
|
+
http_method,
|
|
1445
|
+
url,
|
|
1446
|
+
headers=headers,
|
|
1447
|
+
data=body,
|
|
1448
|
+
)
|
|
1327
1449
|
return genai_types.HttpResponse(
|
|
1328
|
-
headers=response.headers,
|
|
1329
|
-
body=response.
|
|
1450
|
+
headers=dict(response.headers),
|
|
1451
|
+
body=response.text,
|
|
1330
1452
|
)
|
|
1331
1453
|
|
|
1332
1454
|
def generate_browser_ws_headers(
|
|
@@ -1335,6 +1457,7 @@ class Sandboxes(_api_module.BaseModule):
|
|
|
1335
1457
|
service_account_email: str,
|
|
1336
1458
|
port: str = "8080",
|
|
1337
1459
|
timeout: int = 3600,
|
|
1460
|
+
psc_endpoint: Optional[str] = None,
|
|
1338
1461
|
) -> tuple[str, dict[str, str]]:
|
|
1339
1462
|
"""Generates the websocket upgrade headers for the browser.
|
|
1340
1463
|
|
|
@@ -1348,6 +1471,15 @@ class Sandboxes(_api_module.BaseModule):
|
|
|
1348
1471
|
Defaults to "8080". This should be one of the ports specified during template creation.
|
|
1349
1472
|
timeout (int):
|
|
1350
1473
|
Optional. The timeout in seconds for the token. Defaults to 3600.
|
|
1474
|
+
psc_endpoint (str):
|
|
1475
|
+
Optional. Host (RFC1918 IP or resolvable internal hostname) of the
|
|
1476
|
+
customer-side PSC endpoint forwarding rule that targets
|
|
1477
|
+
``connection_info.service_attachment``. Needed for VPC-SC
|
|
1478
|
+
sandboxes; see ``send_command`` for details. When provided, it is
|
|
1479
|
+
used as the websocket host in place of the load balancer address,
|
|
1480
|
+
and is propagated to the internal ``send_command`` call that
|
|
1481
|
+
fetches the CDP endpoint.
|
|
1482
|
+
|
|
1351
1483
|
Returns:
|
|
1352
1484
|
tuple[str, dict[str, str]]: A tuple containing the websocket URL and
|
|
1353
1485
|
the headers for websocket upgrade.
|
|
@@ -1356,12 +1488,19 @@ class Sandboxes(_api_module.BaseModule):
|
|
|
1356
1488
|
raise ValueError("Connection info is not available.")
|
|
1357
1489
|
|
|
1358
1490
|
connection_info = sandbox_environment.connection_info
|
|
1359
|
-
if
|
|
1491
|
+
if psc_endpoint:
|
|
1492
|
+
ws_base_url = "wss://" + psc_endpoint
|
|
1493
|
+
elif connection_info.load_balancer_hostname:
|
|
1360
1494
|
ws_base_url = "wss://" + connection_info.load_balancer_hostname
|
|
1361
1495
|
elif connection_info.load_balancer_ip:
|
|
1362
1496
|
ws_base_url = "ws://" + connection_info.load_balancer_ip
|
|
1363
1497
|
else:
|
|
1364
|
-
raise ValueError(
|
|
1498
|
+
raise ValueError(
|
|
1499
|
+
"No data-plane endpoint available. Non-VPC-SC sandboxes populate"
|
|
1500
|
+
" connection_info.load_balancer_hostname; VPC-SC sandboxes require"
|
|
1501
|
+
" the caller to pass psc_endpoint (the host of the forwarding"
|
|
1502
|
+
" rule targeting connection_info.service_attachment)."
|
|
1503
|
+
)
|
|
1365
1504
|
|
|
1366
1505
|
http_access_token = self.generate_access_token(service_account_email, timeout)
|
|
1367
1506
|
response = self.send_command(
|
|
@@ -1370,6 +1509,7 @@ class Sandboxes(_api_module.BaseModule):
|
|
|
1370
1509
|
sandbox_environment=sandbox_environment,
|
|
1371
1510
|
port=port,
|
|
1372
1511
|
path="/cdp_ws_endpoint",
|
|
1512
|
+
psc_endpoint=psc_endpoint,
|
|
1373
1513
|
)
|
|
1374
1514
|
if not response:
|
|
1375
1515
|
raise ValueError("Failed to get the websocket endpoint.")
|
|
@@ -1968,6 +1968,7 @@ from .common import SandboxEnvironmentTemplateOrDict
|
|
|
1968
1968
|
from .common import SandboxEnvironmentTemplateResourceRequirements
|
|
1969
1969
|
from .common import SandboxEnvironmentTemplateResourceRequirementsDict
|
|
1970
1970
|
from .common import SandboxEnvironmentTemplateResourceRequirementsOrDict
|
|
1971
|
+
from .common import SandboxEnvironmentTemplateState
|
|
1971
1972
|
from .common import SandboxState
|
|
1972
1973
|
from .common import SavedQuery
|
|
1973
1974
|
from .common import SavedQueryDict
|
|
@@ -3457,15 +3458,15 @@ __all__ = [
|
|
|
3457
3458
|
"SandboxEnvironmentTemplateEgressControlConfig",
|
|
3458
3459
|
"SandboxEnvironmentTemplateEgressControlConfigDict",
|
|
3459
3460
|
"SandboxEnvironmentTemplateEgressControlConfigOrDict",
|
|
3460
|
-
"CreateSandboxEnvironmentTemplateConfig",
|
|
3461
|
-
"CreateSandboxEnvironmentTemplateConfigDict",
|
|
3462
|
-
"CreateSandboxEnvironmentTemplateConfigOrDict",
|
|
3463
3461
|
"PSCAutomationConfig",
|
|
3464
3462
|
"PSCAutomationConfigDict",
|
|
3465
3463
|
"PSCAutomationConfigOrDict",
|
|
3466
3464
|
"PrivateServiceConnectConfig",
|
|
3467
3465
|
"PrivateServiceConnectConfigDict",
|
|
3468
3466
|
"PrivateServiceConnectConfigOrDict",
|
|
3467
|
+
"CreateSandboxEnvironmentTemplateConfig",
|
|
3468
|
+
"CreateSandboxEnvironmentTemplateConfigDict",
|
|
3469
|
+
"CreateSandboxEnvironmentTemplateConfigOrDict",
|
|
3469
3470
|
"SandboxEnvironmentTemplate",
|
|
3470
3471
|
"SandboxEnvironmentTemplateDict",
|
|
3471
3472
|
"SandboxEnvironmentTemplateOrDict",
|
|
@@ -4309,6 +4310,7 @@ __all__ = [
|
|
|
4309
4310
|
"Protocol",
|
|
4310
4311
|
"DefaultContainerCategory",
|
|
4311
4312
|
"PscAutomationState",
|
|
4313
|
+
"SandboxEnvironmentTemplateState",
|
|
4312
4314
|
"PostSnapshotAction",
|
|
4313
4315
|
"Framework",
|
|
4314
4316
|
"SkillSource",
|
|
@@ -322,6 +322,12 @@ class SandboxState(_common.CaseInSensitiveEnum):
|
|
|
322
322
|
"""Sandbox has terminated with underlying runtime failure."""
|
|
323
323
|
STATE_DELETED = "STATE_DELETED"
|
|
324
324
|
"""Sandbox runtime has been deleted."""
|
|
325
|
+
STATE_PAUSED = "STATE_PAUSED"
|
|
326
|
+
"""Sandbox runtime is paused."""
|
|
327
|
+
STATE_PAUSING = "STATE_PAUSING"
|
|
328
|
+
"""Sandbox runtime is pausing."""
|
|
329
|
+
STATE_RESUMING = "STATE_RESUMING"
|
|
330
|
+
"""Sandbox runtime is resuming."""
|
|
325
331
|
|
|
326
332
|
|
|
327
333
|
class Protocol(_common.CaseInSensitiveEnum):
|
|
@@ -359,6 +365,23 @@ class PscAutomationState(_common.CaseInSensitiveEnum):
|
|
|
359
365
|
"""The PSC service automation has failed."""
|
|
360
366
|
|
|
361
367
|
|
|
368
|
+
class SandboxEnvironmentTemplateState(_common.CaseInSensitiveEnum):
|
|
369
|
+
"""Output only. The state of the sandbox environment template."""
|
|
370
|
+
|
|
371
|
+
UNSPECIFIED = "UNSPECIFIED"
|
|
372
|
+
"""The default value. This value is unused."""
|
|
373
|
+
PROVISIONING = "PROVISIONING"
|
|
374
|
+
"""Runtime resources are being allocated for the sandbox environment."""
|
|
375
|
+
ACTIVE = "ACTIVE"
|
|
376
|
+
"""Sandbox runtime is ready for serving."""
|
|
377
|
+
DEPROVISIONING = "DEPROVISIONING"
|
|
378
|
+
"""Sandbox runtime is halted, performing tear down tasks."""
|
|
379
|
+
DELETED = "DELETED"
|
|
380
|
+
"""Sandbox has terminated with underlying runtime failure."""
|
|
381
|
+
FAILED = "FAILED"
|
|
382
|
+
"""Sandbox has failed to provision."""
|
|
383
|
+
|
|
384
|
+
|
|
362
385
|
class PostSnapshotAction(_common.CaseInSensitiveEnum):
|
|
363
386
|
"""Input only. Action to take on the source SandboxEnvironment after the snapshot is taken. This field is only used in CreateSandboxEnvironmentSnapshotRequest and it is not stored in the resource."""
|
|
364
387
|
|
|
@@ -17603,98 +17626,6 @@ SandboxEnvironmentTemplateEgressControlConfigOrDict = Union[
|
|
|
17603
17626
|
]
|
|
17604
17627
|
|
|
17605
17628
|
|
|
17606
|
-
class CreateSandboxEnvironmentTemplateConfig(_common.BaseModel):
|
|
17607
|
-
"""Config for creating a Sandbox Template."""
|
|
17608
|
-
|
|
17609
|
-
http_options: Optional[genai_types.HttpOptions] = Field(
|
|
17610
|
-
default=None, description="""Used to override HTTP request options."""
|
|
17611
|
-
)
|
|
17612
|
-
wait_for_completion: Optional[bool] = Field(
|
|
17613
|
-
default=True,
|
|
17614
|
-
description="""Waits for the operation to complete before returning.""",
|
|
17615
|
-
)
|
|
17616
|
-
custom_container_environment: Optional[
|
|
17617
|
-
SandboxEnvironmentTemplateCustomContainerEnvironment
|
|
17618
|
-
] = Field(
|
|
17619
|
-
default=None,
|
|
17620
|
-
description="""The custom container environment for the sandbox template.""",
|
|
17621
|
-
)
|
|
17622
|
-
default_container_environment: Optional[
|
|
17623
|
-
SandboxEnvironmentTemplateDefaultContainerEnvironment
|
|
17624
|
-
] = Field(
|
|
17625
|
-
default=None,
|
|
17626
|
-
description="""The default container environment for the sandbox template.""",
|
|
17627
|
-
)
|
|
17628
|
-
egress_control_config: Optional[SandboxEnvironmentTemplateEgressControlConfig] = (
|
|
17629
|
-
Field(
|
|
17630
|
-
default=None,
|
|
17631
|
-
description="""The egress control config for the sandbox template.""",
|
|
17632
|
-
)
|
|
17633
|
-
)
|
|
17634
|
-
|
|
17635
|
-
|
|
17636
|
-
class CreateSandboxEnvironmentTemplateConfigDict(TypedDict, total=False):
|
|
17637
|
-
"""Config for creating a Sandbox Template."""
|
|
17638
|
-
|
|
17639
|
-
http_options: Optional[genai_types.HttpOptions]
|
|
17640
|
-
"""Used to override HTTP request options."""
|
|
17641
|
-
|
|
17642
|
-
wait_for_completion: Optional[bool]
|
|
17643
|
-
"""Waits for the operation to complete before returning."""
|
|
17644
|
-
|
|
17645
|
-
custom_container_environment: Optional[
|
|
17646
|
-
SandboxEnvironmentTemplateCustomContainerEnvironmentDict
|
|
17647
|
-
]
|
|
17648
|
-
"""The custom container environment for the sandbox template."""
|
|
17649
|
-
|
|
17650
|
-
default_container_environment: Optional[
|
|
17651
|
-
SandboxEnvironmentTemplateDefaultContainerEnvironmentDict
|
|
17652
|
-
]
|
|
17653
|
-
"""The default container environment for the sandbox template."""
|
|
17654
|
-
|
|
17655
|
-
egress_control_config: Optional[SandboxEnvironmentTemplateEgressControlConfigDict]
|
|
17656
|
-
"""The egress control config for the sandbox template."""
|
|
17657
|
-
|
|
17658
|
-
|
|
17659
|
-
CreateSandboxEnvironmentTemplateConfigOrDict = Union[
|
|
17660
|
-
CreateSandboxEnvironmentTemplateConfig, CreateSandboxEnvironmentTemplateConfigDict
|
|
17661
|
-
]
|
|
17662
|
-
|
|
17663
|
-
|
|
17664
|
-
class _CreateSandboxEnvironmentTemplateRequestParameters(_common.BaseModel):
|
|
17665
|
-
"""Parameters for creating Sandbox Environment Templates."""
|
|
17666
|
-
|
|
17667
|
-
name: Optional[str] = Field(
|
|
17668
|
-
default=None,
|
|
17669
|
-
description="""Name of the agent runtime to create the template under.""",
|
|
17670
|
-
)
|
|
17671
|
-
display_name: Optional[str] = Field(
|
|
17672
|
-
default=None, description="""The display name of the sandbox template."""
|
|
17673
|
-
)
|
|
17674
|
-
config: Optional[CreateSandboxEnvironmentTemplateConfig] = Field(
|
|
17675
|
-
default=None, description=""""""
|
|
17676
|
-
)
|
|
17677
|
-
|
|
17678
|
-
|
|
17679
|
-
class _CreateSandboxEnvironmentTemplateRequestParametersDict(TypedDict, total=False):
|
|
17680
|
-
"""Parameters for creating Sandbox Environment Templates."""
|
|
17681
|
-
|
|
17682
|
-
name: Optional[str]
|
|
17683
|
-
"""Name of the agent runtime to create the template under."""
|
|
17684
|
-
|
|
17685
|
-
display_name: Optional[str]
|
|
17686
|
-
"""The display name of the sandbox template."""
|
|
17687
|
-
|
|
17688
|
-
config: Optional[CreateSandboxEnvironmentTemplateConfigDict]
|
|
17689
|
-
""""""
|
|
17690
|
-
|
|
17691
|
-
|
|
17692
|
-
_CreateSandboxEnvironmentTemplateRequestParametersOrDict = Union[
|
|
17693
|
-
_CreateSandboxEnvironmentTemplateRequestParameters,
|
|
17694
|
-
_CreateSandboxEnvironmentTemplateRequestParametersDict,
|
|
17695
|
-
]
|
|
17696
|
-
|
|
17697
|
-
|
|
17698
17629
|
class PSCAutomationConfig(_common.BaseModel):
|
|
17699
17630
|
"""PSC config that is used to automatically create PSC endpoints in the user projects."""
|
|
17700
17631
|
|
|
@@ -17798,6 +17729,105 @@ PrivateServiceConnectConfigOrDict = Union[
|
|
|
17798
17729
|
]
|
|
17799
17730
|
|
|
17800
17731
|
|
|
17732
|
+
class CreateSandboxEnvironmentTemplateConfig(_common.BaseModel):
|
|
17733
|
+
"""Config for creating a Sandbox Template."""
|
|
17734
|
+
|
|
17735
|
+
http_options: Optional[genai_types.HttpOptions] = Field(
|
|
17736
|
+
default=None, description="""Used to override HTTP request options."""
|
|
17737
|
+
)
|
|
17738
|
+
wait_for_completion: Optional[bool] = Field(
|
|
17739
|
+
default=True,
|
|
17740
|
+
description="""Waits for the operation to complete before returning.""",
|
|
17741
|
+
)
|
|
17742
|
+
custom_container_environment: Optional[
|
|
17743
|
+
SandboxEnvironmentTemplateCustomContainerEnvironment
|
|
17744
|
+
] = Field(
|
|
17745
|
+
default=None,
|
|
17746
|
+
description="""The custom container environment for the sandbox template.""",
|
|
17747
|
+
)
|
|
17748
|
+
default_container_environment: Optional[
|
|
17749
|
+
SandboxEnvironmentTemplateDefaultContainerEnvironment
|
|
17750
|
+
] = Field(
|
|
17751
|
+
default=None,
|
|
17752
|
+
description="""The default container environment for the sandbox template.""",
|
|
17753
|
+
)
|
|
17754
|
+
egress_control_config: Optional[SandboxEnvironmentTemplateEgressControlConfig] = (
|
|
17755
|
+
Field(
|
|
17756
|
+
default=None,
|
|
17757
|
+
description="""The egress control config for the sandbox template.""",
|
|
17758
|
+
)
|
|
17759
|
+
)
|
|
17760
|
+
ingress_control_config: Optional[PrivateServiceConnectConfig] = Field(
|
|
17761
|
+
default=None,
|
|
17762
|
+
description="""The ingress control config for the sandbox template.""",
|
|
17763
|
+
)
|
|
17764
|
+
|
|
17765
|
+
|
|
17766
|
+
class CreateSandboxEnvironmentTemplateConfigDict(TypedDict, total=False):
|
|
17767
|
+
"""Config for creating a Sandbox Template."""
|
|
17768
|
+
|
|
17769
|
+
http_options: Optional[genai_types.HttpOptions]
|
|
17770
|
+
"""Used to override HTTP request options."""
|
|
17771
|
+
|
|
17772
|
+
wait_for_completion: Optional[bool]
|
|
17773
|
+
"""Waits for the operation to complete before returning."""
|
|
17774
|
+
|
|
17775
|
+
custom_container_environment: Optional[
|
|
17776
|
+
SandboxEnvironmentTemplateCustomContainerEnvironmentDict
|
|
17777
|
+
]
|
|
17778
|
+
"""The custom container environment for the sandbox template."""
|
|
17779
|
+
|
|
17780
|
+
default_container_environment: Optional[
|
|
17781
|
+
SandboxEnvironmentTemplateDefaultContainerEnvironmentDict
|
|
17782
|
+
]
|
|
17783
|
+
"""The default container environment for the sandbox template."""
|
|
17784
|
+
|
|
17785
|
+
egress_control_config: Optional[SandboxEnvironmentTemplateEgressControlConfigDict]
|
|
17786
|
+
"""The egress control config for the sandbox template."""
|
|
17787
|
+
|
|
17788
|
+
ingress_control_config: Optional[PrivateServiceConnectConfigDict]
|
|
17789
|
+
"""The ingress control config for the sandbox template."""
|
|
17790
|
+
|
|
17791
|
+
|
|
17792
|
+
CreateSandboxEnvironmentTemplateConfigOrDict = Union[
|
|
17793
|
+
CreateSandboxEnvironmentTemplateConfig, CreateSandboxEnvironmentTemplateConfigDict
|
|
17794
|
+
]
|
|
17795
|
+
|
|
17796
|
+
|
|
17797
|
+
class _CreateSandboxEnvironmentTemplateRequestParameters(_common.BaseModel):
|
|
17798
|
+
"""Parameters for creating Sandbox Environment Templates."""
|
|
17799
|
+
|
|
17800
|
+
name: Optional[str] = Field(
|
|
17801
|
+
default=None,
|
|
17802
|
+
description="""Name of the agent runtime to create the template under.""",
|
|
17803
|
+
)
|
|
17804
|
+
display_name: Optional[str] = Field(
|
|
17805
|
+
default=None, description="""The display name of the sandbox template."""
|
|
17806
|
+
)
|
|
17807
|
+
config: Optional[CreateSandboxEnvironmentTemplateConfig] = Field(
|
|
17808
|
+
default=None, description=""""""
|
|
17809
|
+
)
|
|
17810
|
+
|
|
17811
|
+
|
|
17812
|
+
class _CreateSandboxEnvironmentTemplateRequestParametersDict(TypedDict, total=False):
|
|
17813
|
+
"""Parameters for creating Sandbox Environment Templates."""
|
|
17814
|
+
|
|
17815
|
+
name: Optional[str]
|
|
17816
|
+
"""Name of the agent runtime to create the template under."""
|
|
17817
|
+
|
|
17818
|
+
display_name: Optional[str]
|
|
17819
|
+
"""The display name of the sandbox template."""
|
|
17820
|
+
|
|
17821
|
+
config: Optional[CreateSandboxEnvironmentTemplateConfigDict]
|
|
17822
|
+
""""""
|
|
17823
|
+
|
|
17824
|
+
|
|
17825
|
+
_CreateSandboxEnvironmentTemplateRequestParametersOrDict = Union[
|
|
17826
|
+
_CreateSandboxEnvironmentTemplateRequestParameters,
|
|
17827
|
+
_CreateSandboxEnvironmentTemplateRequestParametersDict,
|
|
17828
|
+
]
|
|
17829
|
+
|
|
17830
|
+
|
|
17801
17831
|
class SandboxEnvironmentTemplate(_common.BaseModel):
|
|
17802
17832
|
"""A sandbox environment template."""
|
|
17803
17833
|
|
|
@@ -17831,16 +17861,7 @@ class SandboxEnvironmentTemplate(_common.BaseModel):
|
|
|
17831
17861
|
default=None,
|
|
17832
17862
|
description="""Identifier. The resource name of the SandboxEnvironmentTemplate. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sandboxEnvironmentTemplates/{sandbox_environment_template}`""",
|
|
17833
17863
|
)
|
|
17834
|
-
state: Optional[
|
|
17835
|
-
Literal[
|
|
17836
|
-
"UNSPECIFIED",
|
|
17837
|
-
"PROVISIONING",
|
|
17838
|
-
"ACTIVE",
|
|
17839
|
-
"DEPROVISIONING",
|
|
17840
|
-
"DELETED",
|
|
17841
|
-
"FAILED",
|
|
17842
|
-
]
|
|
17843
|
-
] = Field(
|
|
17864
|
+
state: Optional[SandboxEnvironmentTemplateState] = Field(
|
|
17844
17865
|
default=None,
|
|
17845
17866
|
description="""Output only. The state of the sandbox environment template.""",
|
|
17846
17867
|
)
|
|
@@ -17879,16 +17900,7 @@ class SandboxEnvironmentTemplateDict(TypedDict, total=False):
|
|
|
17879
17900
|
name: Optional[str]
|
|
17880
17901
|
"""Identifier. The resource name of the SandboxEnvironmentTemplate. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sandboxEnvironmentTemplates/{sandbox_environment_template}`"""
|
|
17881
17902
|
|
|
17882
|
-
state: Optional[
|
|
17883
|
-
Literal[
|
|
17884
|
-
"UNSPECIFIED",
|
|
17885
|
-
"PROVISIONING",
|
|
17886
|
-
"ACTIVE",
|
|
17887
|
-
"DEPROVISIONING",
|
|
17888
|
-
"DELETED",
|
|
17889
|
-
"FAILED",
|
|
17890
|
-
]
|
|
17891
|
-
]
|
|
17903
|
+
state: Optional[SandboxEnvironmentTemplateState]
|
|
17892
17904
|
"""Output only. The state of the sandbox environment template."""
|
|
17893
17905
|
|
|
17894
17906
|
update_time: Optional[datetime.datetime]
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: google-cloud-agentplatform
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.1.3
|
|
4
4
|
Summary: Google Cloud Agent Platform Client Library
|
|
5
5
|
Author-email: Google LLC <googleapis-packages@google.com>
|
|
6
6
|
License: Apache-2.0
|
|
7
|
-
Classifier: Development Status ::
|
|
7
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
8
8
|
Classifier: Intended Audience :: Developers
|
|
9
9
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
13
11
|
Classifier: Programming Language :: Python :: 3.10
|
|
14
12
|
Classifier: Programming Language :: Python :: 3.11
|
|
15
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
-
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
16
|
+
Requires-Python: >=3.10
|
|
17
17
|
Description-Content-Type: text/markdown
|
|
18
18
|
License-File: LICENSE
|
|
19
19
|
Requires-Dist: google-auth
|
|
@@ -74,9 +74,9 @@ Provides-Extra: all
|
|
|
74
74
|
Requires-Dist: google-cloud-agentplatform[a2a,adk,ag2,agent_engines,bigquery,evaluation,langchain,live,llama_index]; extra == "all"
|
|
75
75
|
Dynamic: license-file
|
|
76
76
|
|
|
77
|
-
#
|
|
77
|
+
# Gemini Enterprise Agent Platform
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
Gemini Enterprise Agent Platform Client Library.
|
|
80
80
|
|
|
81
81
|
## Installation
|
|
82
82
|
|
|
@@ -85,9 +85,13 @@ This is the packaging directory for `google-cloud-agentplatform`.
|
|
|
85
85
|
pip install google-cloud-agentplatform
|
|
86
86
|
|
|
87
87
|
# With specific extras
|
|
88
|
+
pip install google-cloud-agentplatform[agent_engines]
|
|
89
|
+
pip install google-cloud-agentplatform[a2a]
|
|
88
90
|
pip install google-cloud-agentplatform[adk]
|
|
89
91
|
pip install google-cloud-agentplatform[langchain]
|
|
92
|
+
pip install google-cloud-agentplatform[ag2]
|
|
93
|
+
pip install google-cloud-agentplatform[llama_index]
|
|
90
94
|
pip install google-cloud-agentplatform[evaluation]
|
|
91
95
|
pip install google-cloud-agentplatform[bigquery]
|
|
96
|
+
pip install google-cloud-agentplatform[live]
|
|
92
97
|
pip install google-cloud-agentplatform[all]
|
|
93
|
-
```
|
|
@@ -10,18 +10,18 @@ authors = [
|
|
|
10
10
|
{name = "Google LLC", email = "googleapis-packages@google.com"}
|
|
11
11
|
]
|
|
12
12
|
readme = "README.md"
|
|
13
|
-
requires-python = ">=3.
|
|
13
|
+
requires-python = ">=3.10"
|
|
14
14
|
license = {text = "Apache-2.0"}
|
|
15
15
|
classifiers = [
|
|
16
|
-
"Development Status ::
|
|
16
|
+
"Development Status :: 5 - Production/Stable",
|
|
17
17
|
"Intended Audience :: Developers",
|
|
18
18
|
"License :: OSI Approved :: Apache Software License",
|
|
19
19
|
"Programming Language :: Python :: 3",
|
|
20
|
-
"Programming Language :: Python :: 3.8",
|
|
21
|
-
"Programming Language :: Python :: 3.9",
|
|
22
20
|
"Programming Language :: Python :: 3.10",
|
|
23
21
|
"Programming Language :: Python :: 3.11",
|
|
24
22
|
"Programming Language :: Python :: 3.12",
|
|
23
|
+
"Programming Language :: Python :: 3.13",
|
|
24
|
+
"Programming Language :: Python :: 3.14",
|
|
25
25
|
]
|
|
26
26
|
dependencies = [
|
|
27
27
|
"google-auth",
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# Google Cloud Agent Platform
|
|
2
|
-
|
|
3
|
-
This is the packaging directory for `google-cloud-agentplatform`.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
# Core installation
|
|
9
|
-
pip install google-cloud-agentplatform
|
|
10
|
-
|
|
11
|
-
# With specific extras
|
|
12
|
-
pip install google-cloud-agentplatform[adk]
|
|
13
|
-
pip install google-cloud-agentplatform[langchain]
|
|
14
|
-
pip install google-cloud-agentplatform[evaluation]
|
|
15
|
-
pip install google-cloud-agentplatform[bigquery]
|
|
16
|
-
pip install google-cloud-agentplatform[all]
|
|
17
|
-
```
|
|
File without changes
|
{google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/__init__.py
RENAMED
|
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
|
{google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/evals.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/live.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/rag.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{google_cloud_agentplatform-2.0.1 → google_cloud_agentplatform-2.1.3}/agentplatform/_genai/skills.py
RENAMED
|
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
|