Module vertex_ai

Module vertex_ai 

Source
Expand description

Vertex AI managed code executor (REST; requires vertex-ai-code-executor). Vertex AI code executor — runs code via the Vertex AI Code Interpreter Extension.

Mirrors ADK-Python’s vertex_ai_code_executor. The Python SDK wraps the Vertex AI Extension service (vertexai.preview.extensions.Extension): it loads an existing code-interpreter extension (or imports one from the prebuilt hub) and then calls its execute operation. This Rust port talks directly to the underlying Vertex AI Extension Execution REST API:

  • Import from hub: POST https://{loc}-aiplatform.googleapis.com/v1beta1/projects/{p}/locations/{loc}/extensions:import
  • Execute: POST https://{loc}-aiplatform.googleapis.com/v1beta1/{resource_name}:execute with body {"operationId": "execute", "operationParams": {...}}.

The execute response carries a content payload holding execution_result (stdout), execution_error (stderr) and output_files (a list of {name, contents}), exactly as ADK consumes them.

The HTTP integration is gated behind the vertex-ai-code-executor feature (which pulls in reqwest). Without it, the executor and its types still compile as a drop-in, but execute_code returns an error explaining the feature is required — so the request/response helpers are only exercised when the feature is enabled.

Structs§

VertexAiCodeExecutor
Code executor that runs code via the Vertex AI Code Interpreter Extension.
VertexAiCodeExecutorConfig
Configuration for Vertex AI code execution.