Merge https://github.com/google/adk-python/pull/3394 This PR corrects misspellings identified by the [check-spelling action](https://github.com/marketplace/actions/check-spelling) Note: while I use tooling to identify errors, the tooling doesn't _actually_ provide the corrections, I'm picking them on my own. I'm a human, and I may make mistakes. ### Testing Plan The misspellings have been reported at https://github.com/jsoref/adk-python/actions/runs/19056081305/attempts/1#summary-54426435973 The action reports that the changes in this PR would make it happy: https://github.com/jsoref/adk-python/actions/runs/19056081446/attempts/1#summary-54426436321 **Unit Tests:** - [ ] I have added or updated unit tests for my change. - [ ] All unit tests pass locally. _Please include a summary of passed `pytest` results._ **Manual End-to-End (E2E) Tests:** _Please provide instructions on how to manually test your changes, including any necessary setup or configuration. Please provide logs or screenshots to help reviewers better understand the fix._ ### Checklist - [x] I have read the [CONTRIBUTING.md](https://github.com/google/adk-python/blob/main/CONTRIBUTING.md) document. - [x] I have performed a self-review of my own code. - [ ] I have commented my code, particularly in hard-to-understand areas. - [ ] I have added tests that prove my fix is effective or that my feature works. - [ ] New and existing unit tests pass locally with my changes. - [ ] I have manually tested my changes end-to-end. - [ ] Any dependent changes have been merged and published in downstream modules. ### Additional context - https://github.com/google/adk-python/pull/3382#issuecomment-3488654110 COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/3394 from jsoref:spelling-contributing c3d5e342c4350f7cae9f8f0c6638b176f2e30e80 PiperOrigin-RevId: 828659867
Vertex AI Code Execution Agent Sample
This directory contains a sample agent that demonstrates how to use the
VertexAiCodeExecutor for data science tasks.
Overview
The agent is designed to assist with data analysis in a Python environment. It can execute Python code to perform tasks like data manipulation, analysis, and visualization. This agent is particularly useful for tasks that require a secure and sandboxed code execution environment with common data science libraries pre-installed.
This sample is a direct counterpart to the
code execution sample which uses the
BuiltInCodeExecutor. The key difference in this sample is the use of
VertexAiCodeExecutor.
VertexAiCodeExecutor
The VertexAiCodeExecutor leverages the
Vertex AI Code Interpreter Extension
to run Python code. This provides several advantages:
- Security: Code is executed in a sandboxed environment on Google Cloud, isolating it from your local system.
- Pre-installed Libraries: The environment comes with many common Python
data science libraries pre-installed, such as
pandas,numpy, andmatplotlib. - Stateful Execution: The execution environment is stateful, meaning variables and data from one code execution are available in subsequent executions within the same session.
How to use
Prerequisites
Ensure you have configured your environment for using Google Cloud Vertex AI. You will need to have a Google Cloud Project with the Vertex AI API enabled.
Running the agent
You can run this agent using the ADK CLI from the root of the repository.
To interact with the agent through the command line:
adk run contributing/samples/vertex_code_execution "Plot a sine wave from 0 to 10"
To use the web interface:
adk web contributing/samples/
Then select vertex_code_execution from the list of agents and interact with
it.