Skip to content

Commit a5b742b

Browse files
google-genai-botcopybara-github
authored andcommitted
feat: introduces a new AgentEngineSandboxCodeExecutor class that supports executes agent generated code
The AgentEngineSandboxCodeExecutor uses the Vertex AI Code Execution Sandbox API to execute code PiperOrigin-RevId: 821197794
1 parent af74eba commit a5b742b

File tree

8 files changed

+3
-455
lines changed

8 files changed

+3
-455
lines changed

contributing/samples/agent_engine_code_execution/README

Lines changed: 0 additions & 18 deletions
This file was deleted.

contributing/samples/agent_engine_code_execution/__init__.py

Lines changed: 0 additions & 15 deletions
This file was deleted.

contributing/samples/agent_engine_code_execution/agent.py

Lines changed: 0 additions & 95 deletions
This file was deleted.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ dependencies = [
3232
"click>=8.1.8, <9.0.0", # For CLI tools
3333
"fastapi>=0.115.0, <1.0.0", # FastAPI framework
3434
"google-api-python-client>=2.157.0, <3.0.0", # Google API client discovery
35-
"google-cloud-aiplatform[agent_engines]>=1.121.0, <2.0.0",# For VertexAI integrations, e.g. example store.
35+
"google-cloud-aiplatform[agent_engines]>=1.112.0, <2.0.0",# For VertexAI integrations, e.g. example store.
3636
"google-cloud-bigtable>=2.32.0", # For Bigtable database
3737
"google-cloud-discoveryengine>=0.13.12, <0.14.0", # For Discovery Engine Search Tool
3838
"google-cloud-secret-manager>=2.22.0, <3.0.0", # Fetching secrets in RestAPI Tool

src/google/adk/code_executors/__init__.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from __future__ import annotations
16-
1715
import logging
1816

1917
from .base_code_executor import BaseCodeExecutor
@@ -31,7 +29,6 @@
3129
'VertexAiCodeExecutor',
3230
'ContainerCodeExecutor',
3331
'GkeCodeExecutor',
34-
'AgentEngineSandboxCodeExecutor',
3532
]
3633

3734

@@ -66,14 +63,4 @@ def __getattr__(name: str):
6663
'GkeCodeExecutor requires additional dependencies. '
6764
'Please install with: pip install "google-adk[extensions]"'
6865
) from e
69-
elif name == 'AgentEngineSandboxCodeExecutor':
70-
try:
71-
from .agent_engine_sandbox_code_executor import AgentEngineSandboxCodeExecutor
72-
73-
return AgentEngineSandboxCodeExecutor
74-
except ImportError as e:
75-
raise ImportError(
76-
'AgentEngineSandboxCodeExecutor requires additional dependencies. '
77-
'Please install with: pip install "google-adk[extensions]"'
78-
) from e
7966
raise AttributeError(f"module '{__name__}' has no attribute '{name}'")

src/google/adk/code_executors/agent_engine_sandbox_code_executor.py

Lines changed: 0 additions & 187 deletions
This file was deleted.

src/google/adk/code_executors/code_execution_utils.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
"""Utility functions for code execution."""
1616

17-
from __future__ import annotations
18-
1917
import base64
2018
import binascii
2119
import copy
@@ -36,9 +34,9 @@ class File:
3634
The name of the file with file extension (e.g., "file.csv").
3735
"""
3836

39-
content: str | bytes
37+
content: str
4038
"""
41-
The base64-encoded bytes of the file content or the original bytes of the file content.
39+
The base64-encoded bytes of the file content.
4240
"""
4341

4442
mime_type: str = 'text/plain'

0 commit comments

Comments
 (0)